Skip to content

Instantly share code, notes, and snippets.

@ironizm
Created October 8, 2013 08:21
Show Gist options
  • Save ironizm/2b2dd07fa77ec14c6300 to your computer and use it in GitHub Desktop.
Save ironizm/2b2dd07fa77ec14c6300 to your computer and use it in GitHub Desktop.
$_product = Mage::getModel('catalog/product')->setStoreId($webId)->loadByAttribute('sku', $arrprice['sku']);
$productEntity = Mage::getModel('catalog/product');
$productEntity->setStoreId(Mage_Core_Model_App::ADMIN_STORE_ID)
->load($id);
$groupPrices = array(
array('website_id' => $webId, 'cust_group' => $cutGrpId, 'all_groups' => false,'price' => $arrprice['someprice'])
);
try{
$productEntity->setData('group_price', $groupPrices)
->save();
}catch (Exception $e)
{
Mage::log(print_r($e,true), NULL, 'my_exception.log',true);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment