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,

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

If it is product custom attribute, you can try

echo $_product->getBum();
  • 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 '17 at 7:37
  • Do you know why? Thanks, – Vianney03 Jul 27 '17 at 8:06

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.