Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function updateFieldLocalAction(){
- Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
- $id= $this->getRequest()->getParam('id');
- $customerid=Mage::getSingleton('customer/session')->getCustomerId();
- $collection_product = Mage::getModel('marketplace/product')->getCollection()->addFieldToFilter('mageproductid',array('eq'=>$id))->addFieldToFilter('userid',array('eq'=>$customerid));
- try{
- $upd_local = $this->getRequest()->getParam('local');
- $mp_local_shipping_charge = $this->getRequest()->getParam('mp_local_shipping_charge');
- $product = Mage::getModel('catalog/product')->load($id);
- $product->setData('mp_local_shipping_charge',$mp_local_shipping_charge);
- $product->getResource()->saveAttribute($product,'mp_local_shipping_charge');
- $product->setLocal($upd_local);
- $product->save();
- echo $local = $product->getLocal();
- echo $name = $product->getName();
- $response['message'] = 'Your Product Is Been Sucessfully Updated';
- $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($response));
- }catch(Exception $e){
- echo "Not Saving"; exit;
- Mage::log($e->getMessage());
- }
- }
Add Comment
Please, Sign In to add comment