0
我不知道如何做到這一點,這確實需要添加到一個正常產品的工作商店,我很好,在做一個新的模板來做到這一點。Magento:更新產品價格的前端文本字段?
我不知道如何做到這一點,這確實需要添加到一個正常產品的工作商店,我很好,在做一個新的模板來做到這一點。Magento:更新產品價格的前端文本字段?
與控制器創建自定義的Magento模塊
然後在你的SavepriceController.php創建一個保存操作
public function saveAction(){
$websites = Mage::app()->getWebsites();
$product_id = $this->getRequest()->getParam('product_id');
// need to validate price here
$price = $this->getRequest()->getParam('price');
$product = Mage::getModel('catalog/product')->load($product_id)
if($product->getId()){
$product->setPrice($price)->save();
}
}
然後文本字段添加到您的前端頁面
<form action='http://site.com/modulename/Saveprice/save' method='post'>
<input type='hidden' name='product_id' value='add product id here' />
<input type='text' name='price' />
<input type='submit' value='submit' />
</form>