When I run the following two lines of code, I get returned the value 161. Now if I dig through customer_eav
, I see 161 relates to attribute_id
477, and then if I dig further into customer_entity_varchar
I find a row with field['attribute_id']=477
and the value is USD. How can I get this attribute string value using magento's models / methods...
$customer = $session->getCustomer();
$attributes = $customer->getDefaultCurrency(); // returns 161... not USD
When we talk about customer attributes, we are referring to non-personal labels that can be used to group behavioral data into persona groups or categories (e.g. gender, loyalty level, age group, propensity to buy, etc.) Personal data should not be onboarded to the Marketing Cloud.
Use the following code to load Customer by ID using Object Manager in your Magento store. $customerId=1; $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $customerData = $objectManager->create('Magento\Customer\Model\Customer')->load($customerId);
echo $customer->getResource()
->getAttribute('default_currency')
->getFrontend()
->getValue($customer);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With