3

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

1
  • 1
    use $_product->getData($attributeCode)
    – Arunendra
    Commented Jul 3, 2017 at 7:54

3 Answers 3

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 and acknowledge you have read our privacy policy.

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