3

How can i get custom product attribute custom_attribute_1 using $product->getCustomAttribute1 .Is camel casing works for numbers?

  • 1
    use $_product->getData($attributeCode) – Arunendra Jul 3 '17 at 7:54
2

This does not work:

$product->getCustomAttribute1()

This does work:

$product->getCustomAttribute_1()
$product->getData('custom_attribute_1')
0

If camel case won't working, you should try with

->getData('attribute')

0

Use $product->getCustomAttribute_1() for getting custom_attribute_1 value

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.