Get Custom Product attribute using camel case
-
10-10-2020 - |
Domanda
How can i get custom product attribute custom_attribute_1
using $product->getCustomAttribute1
.Is camel casing works for numbers?
Soluzione
This does not work:
$product->getCustomAttribute1()
This does work:
$product->getCustomAttribute_1()
$product->getData('custom_attribute_1')
Altri suggerimenti
If camel case won't working, you should try with
->getData('attribute')
Use $product->getCustomAttribute_1()
for getting custom_attribute_1
value
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a magento.stackexchange