Quantity is not updating in magento site

后端 未结 1 1805
迷失自我
迷失自我 2021-01-28 14:30

we have marketplace multi vendor/seller site. we gave an option for seller to update the product information through frontend.....

As it is marketplace site, we have man

相关标签:
1条回答
  • 2021-01-28 14:58

    I found solution for 1st problem.

    public function massupdatesellerproAction(){
        if($this->getRequest()->isPost()){
        if(!$this->_validateFormKey()){
         $this->_redirect('marketplace/marketplaceaccount/myproductslist/');
        }
         $ids= $this->getRequest()->getParam('product_mass_update');
         $price= $this->getRequest()->getParam('price');
         $special= $this->getRequest()->getParam('specialprice');
    
         $i=1;
         foreach ($ids as $key => $value) {
            $i=$i+1;
              $qty = $this->getRequest()->getParam('stock'.$i);
         $product = Mage::getModel('catalog/product')->load($value);
         $product->setPrice($price[$key]);
         $product->setSpecialPrice($special[$key]);
         //$product->setQty($qty);
    
        $product->save();
    
        $stockItem = Mage::getModel('cataloginventory/stock_item')->loadByProduct($value);
        $stockItem->setData('manage_stock', 1);
        $stockItem->setData('qty', $qty);
    
        $stockItem->save();
         }
        Mage::getSingleton('core/session')->addSuccess( Mage::helper('marketplace')->__('Products has been sucessfully deleted from your account'));
        $this->_redirect('marketplace/marketplaceaccount/myproductslist/');
        }}
    
    0 讨论(0)
提交回复
热议问题