Pregunta

I have an bundle product like this:

Bundle product:
**Option 1:
-subproduct:15$
-subproduct:7$
**Option 2:
-subproduct:5$
-subproduct:20$
In admin of product page, i set Special Price 90%.

In category page, it's display:

Bundle product
As low as:
10.8$

How can i show regular price like this?

As low as:
Reg:12$  Spec:10.8$

Thanks for read.

¿Fue útil?

Solución

Finally i find a answer, here my code:

$_product     = $this->getProduct();
$typeInstance = $_product->getTypeInstance(true);
$typeInstance->setStoreFilter($_product->getStoreId(), $_product);

$optionCollection = $typeInstance->getOptionsCollection($_product);

$selectionCollection = $typeInstance->getSelectionsCollection(
    $typeInstance->getOptionsIds($_product),
    $_product
);

$options = $optionCollection->appendSelections($selectionCollection, false,
    Mage::helper('catalog/product')->getSkipSaleableCheck()
);
$summin = 0;
$summax = 0;
foreach ($options as $option){
    $selections  = $option->getSelections();
    $minprice = array();
    foreach ($selections as $key => $_selection){
        $minprice[] = $_selection->getFinalPrice();
    }
    $summin += min($minprice);
    $summax += max($minprice);
}

$_minimalPriceBundle = $summin; $_maximalPriceBundle = $summax;

you can put code wherever you want to display.

Otros consejos

A good place to start would be the active price.phtml template. Examine the section responsible for rendering the grouped product prices. Add in the necessary code to render the regular price.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a magento.stackexchange
scroll top