Skip to content

Instantly share code, notes, and snippets.

@bka
Last active January 30, 2017 15:54
Show Gist options
  • Save bka/0070f1a19f0f1a63de8f0db85d97146c to your computer and use it in GitHub Desktop.
Save bka/0070f1a19f0f1a63de8f0db85d97146c to your computer and use it in GitHub Desktop.
Magento2 access customerData
<script type="text/javascript">
require(
['jquery', 'Magento_Customer/js/customer-data', 'domReady!'],
function($, customerData){
$(function(){
customerData.get('customer').subscribe(function(customer) {
alert("Name is" + customer.fullname);
});
});
}
);
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment