<?php $vezes = $_product->getData('parcelas'); ?> <?php echo $_coreHelper->formatPrice($_regularPrice, false).'</span><span class="descricao_x"> até '.$vezes.'x de '.$_coreHelper->currency($_product->getPrice()/$vezes, true, false).'</span>';?>
Hello everyone, I created an attribute called "parcelas". I write the value of the attribute in the product.
In example "12" x.
But on the product screen it works fine (correct)
but when it is listed in the category (Hardware and others) it can not pull the "parcelas" value for the "price / parcel" calculation formula (265.00 / 12).(wrong)
What happens in this case? Why does it show one way or the other? by the tests that I did the problem is in the "parcelas" that comes with value zero and does not generate the result.
if I replace the cod.
<?php $vezes = $_product->getData('parcelas'); ?> to <?php $vezes = '12'; ?>
It works in both cases, but I can not leave it because the value of the attribute must be different for each product.
Solved! Go to Solution.
Maybe is a a configuration issue.
Can you share the attribute configuration?
Tks for help. if it is attribute error, pq appears correct in one view and the other does not?
I find the file that calls the price for the parts with error .. in file \template\common\list\default.phtml of the theme,
<?php if($show_price): ?> <div class="price"> <?php echo $this->getPriceHtml($_product, true, $price_prefix)?> </div> <?php endif; ?>
so why not accept the variable $vezes of the price.phtml?
You should change the attribute configuration. Take a look to the "Used on product listing" option. It should say "Yes".
Here you'll find more information about attribute configurations and options: http://docs.magento.com/m1/ce/user_guide/catalog/attribute-frontend-properties.html