I am working on Magento and I have to show some simple products on the home page but their price should be displayed in the format of Price: minimum_price To maximum_price instead of base price.

Suppose I have a product in the admin panel with name Gwyneth Basket

  • Its base price 0
  • And Under the custom option, I create a drop-down Like

enter image description here

Now in the frontend, I have to show Gwyneth Basket product like

enter image description here

It working as desired on category page using This Reference But how do I achieve this on custom templates.

Thank You


1 Answer 1

        $product = Mage::getModel("catalog/product")->load(1); //product id 1
        $i = 1;
        $array = array();
        echo "<pre>";
        foreach ($product->getOptions() as $o) {
            $values = $o->getValues();
            foreach ($values as $v) {
                $array[] = $v->getPrice();
            echo "<br/>";

        $max = count($array) - 1 ;
        echo "<pre>";
        echo $minPrice = $array[0];
        echo $maxPrice = $array[$max];

            $price = $product->getPrice();

        echo "Base Price" . $price;

Work Fine for me.

  • Thank You :) Its working as desired. One question if how do I show base price if custom option is not available? Commented Dec 30, 2016 at 12:56
  • Please check my updated answer.
    – Ajay Patel
    Commented Dec 30, 2016 at 13:11
  • you need to just set one condition for base price if custom price array is empty set base price
    – Ajay Patel
    Commented Dec 30, 2016 at 13:12
  • ThankYou @AjayPatel :) Happy Coding.... Commented Dec 30, 2016 at 18:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.