Question

I'm trying to separate normal price and special price on my catalog/product/view.phtml page. I want to display them like this:

Retail Price: £5.99 Trade Price: £4.09

It's currently set up like this:

<div class="price-info">
<p class="retailprice"> Retail Price : </p><?php echo $this->getPriceHtml($_product); ?>
</div>

But it seems getPriceHtml($_product); gets both normal and special price so I'm unable to separate them. I can only get it to look like this:

Retail Price: £5.99
£4.09
Trade Price:

Ive tried this - which I hashed together from various other answers here

<div class="price-info">
<p class="retailprice"> Retail Price : </p><?php echo $_product->getRegularPrice(); ?>
<p class="specialprice"> Special Price: </p><?php echo $_product->getSpecialPrice(); ?>
</div>

But this is just showing blank.

Ideally I would actually like the regular retail price to come from another store view price and trade price to be the regular price of a second store view - but I can work around that with catalog price rules it if that is not possible.

Apologies for the convoluted question, i know 0 PHP

Was it helpful?

Solution

You need to get product price by store id, use below code for that (regular retail price to come from another store view, i.e. as per store id):

$product = Mage::getModel('catalog/product')->setStoreId($storeId)->load($key);

echo Mage::helper('checkout')->formatPrice($product->getPrice());

Now you can use the same code for getting price from second store, as per your question.

OTHER TIPS

This seemed to work for getting the prices separately

Get normal price:

<?php echo Mage::helper('checkout')->formatPrice($_product->getPrice()); ?>

Get final(special Price):

<?php echo Mage::helper('checkout')->formatPrice($_product->getFinalPrice()); ?>

not exactly sure why I needed to use 'checkout' tho

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top