How do you show the price range for a configurable product that contains simple products?
<?php
$productId = $_product['entity_id'];
$product = Mage::getModel('catalog/product')->load($productId);
$block = Mage::app()->getLayout()->createBlock('catalog/product_view_type_configurable');
$block->setProduct($product);
$config = json_decode($block->getJsonConfig(), true);
$basePrice = $config['basePrice'];
$min = null;
$max = null;
foreach ($config['attributes'] as $aId=>$aValues){
foreach ($aValues['options'] as $key=>$value){
if (is_null($min) || $min>$value['price']){
$min = $value['price'];
}
if (is_null($max) || $max<$value['price']){
$max = $value['price'];
}
}
}
//until here we have the min and max price differences. Now just add the base price.
echo "MinimumPrice :- " . $min += $basePrice . "</br>";
echo "MaximumPrice :- " . $max += $basePrice . "</br>";
?>Hello,
I copied and pasted the code you provided into the view.phtml page and it does not work:
http://45.40.134.230/~sportsmedcom/index.php/por-marca/cramer.html
Any ideas? Thank you.
Hi @jeffgrech
The code is working absolutely fine at our end. Can you please share your FTP details so we can solve your query.
Hi @jeffgrech
We have followed the same code we mentioned above.
Kindly check at your end now its done. http://45.40.134.230/~sportsmedcom/index.php/por-marca/cramer/original-tuf-skin-spray.html
Hello,
Just checked and it seems a little buggy.
This is what we are looking for on the catalog page:
http://45.40.134.230/~sportsmedcom/screencaps/storefront-products-electronics.png
Also on the actual product page, it should look like this:
http://45.40.134.230/~sportsmedcom/screencaps/storefront-products-page.png
Let me know if this is possible.
Thank you,
Hello,
I sent you a contact request to SKYPE.
Thank you,