Guest User

yes

a guest
Feb 16th, 2016
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1. public function updateFieldLocalAction(){
  2. Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
  3. $id= $this->getRequest()->getParam('id');
  4. $customerid=Mage::getSingleton('customer/session')->getCustomerId();
  5. $collection_product = Mage::getModel('marketplace/product')->getCollection()->addFieldToFilter('mageproductid',array('eq'=>$id))->addFieldToFilter('userid',array('eq'=>$customerid));
  6.  
  7. try{
  8. $upd_local = $this->getRequest()->getParam('local');
  9. $mp_local_shipping_charge = $this->getRequest()->getParam('mp_local_shipping_charge');
  10. $product = Mage::getModel('catalog/product')->load($id);
  11. $product->setData('mp_local_shipping_charge',$mp_local_shipping_charge);
  12. $product->getResource()->saveAttribute($product,'mp_local_shipping_charge');
  13.  
  14. $product->setLocal($upd_local);
  15.  
  16. $product->save();
  17.  
  18. echo $local = $product->getLocal();
  19. echo $name = $product->getName();
  20.  
  21. $response['message'] = 'Your Product Is Been Sucessfully Updated';
  22. $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($response));
  23.  
  24. }catch(Exception $e){
  25. echo "Not Saving"; exit;
  26. Mage::log($e->getMessage());
  27. }
  28.  
  29. }
Add Comment
Please, Sign In to add comment