0

I would like to add a custom attribute (bum) in the final_price.phtml file.

I put this code: enter image description here

It doesn't work, nothing appears. Can you help me please?

When I tried, <?php echo $_product->getBum(); I have this error message :

enter image description here

Fatal error: Call to a member function getBum() on null in /home/magento/www/app/design/frontend/Smartwave/porto/Magento_Catalog/templates/product/price/final_price.phtml on line 33

Thanks,

2
  • is final_price.phtml custom file you created ?
    – Pawan
    Jul 28, 2017 at 3:45
  • when you print_r($_product), are you able to see your attribute ?
    – Pawan
    Jul 28, 2017 at 3:47

1 Answer 1

0

If it is product custom attribute, you can try

echo $_product->getBum();
2
  • Hello, Thank you for your repply. When I tried your answer, I have this error message : Fatal error: Call to a member function getBum() on null in /home/magento/www/app/design/frontend/Smartwave/porto/Magento_Catalog/templates/product/price/final_price.phtml on line 33
    – Vianney03
    Jul 27, 2017 at 7:37
  • Do you know why? Thanks,
    – Vianney03
    Jul 27, 2017 at 8:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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