2013-10-25 201 views
0

我想在前端自定義magento相關產品下拉菜單。 到目前爲止,它的工作良好,但我需要以某種方式能夠在用戶點擊單選按鈕時更新價格。我想我需要使用一些jQuery的東西?價格存儲在無線電值中。有什麼建議麼? :)Magento更新產品價格

我目前正在使用的代碼是:

<?php 
if($_product->getTypeId() == "configurable"): 
       $conf = Mage::getModel('catalog/product_type_configurable')->setProduct($_product); 
       $simple_collection = $conf->getUsedProductCollection()->addAttributeToSelect('*')->addFilterByRequiredOptions(); 
       foreach($simple_collection as $simple_product){ ?> 

        <input type="radio" id="attribute135" name="attribute135" value="<?php echo strip_tags(Mage::helper('core')->currency($simple_product->getPrice())) ?>" /> <?php echo $simple_product->getName(); 
} 
endif; 
?> 

回答

0

我使用結束: $ _product-> setPrice(新的價格在這裏值)

+0

可惜setPrice不Magento的車體現。任何想法如何解決這個問題? – simon