I am trying to divide product price by pack to display an each price.
My PHP knowledge is very poor, so any help/direction would be a massive help.
Each product/price is part of a pack, I will be selling by the pack price but I would also like to display an each price.
So far I have the following:
<?php $_packAmount = $_product->getPack(); ?> <?php $_productPrice = $_product->getPrice(); ?> <?php $_each = $_productPrice / $_packAmount; ?> <?php echo (round($_each,2)); ?>
This appears to work ok, but if the product is using a special price it ignores the special price and uses the main product price.
I need to be able to divide by the product price it is using at the time (regular or special price) also needs to display in the correct currency.
I have also setup an additional attribute in back end called "mkt_price" I would like this to override the each price if a value exists.
Thanks in advance (Magento version 1.9.2)