Last active
January 30, 2017 15:54
-
-
Save bka/0070f1a19f0f1a63de8f0db85d97146c to your computer and use it in GitHub Desktop.
Magento2 access customerData
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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