I am able to display attribute values using the code below BUT if the attribute is empty it just prints out the word “No”
<?php echo $_product->getResource()->getAttribute('c_address')->getFrontend()->getValue($_product); ?>
I am able to display attribute values using the code below BUT if the attribute is empty it just prints out the word “No”
<?php echo $_product->getResource()->getAttribute('c_address')->getFrontend()->getValue($_product); ?>
2
Answers
To get the customer attribute,you can use like this:
To get the product attribute,you can use like this:
The simplest way is,
But you need to control
$customer->getCustomAttribute('variable_name')
is not NULL