public function addToCategory($sku,$categoryId) { $category = Mage::getModel('catalog/category')->load($categoryId); $positions = $category->getProductsPosition(); $product = Mage::getModel('catalog/product')->loadByAttribute('sku',$sku); $productId = $product->getId(); $positions[$productId] = $position; $category->setPostedProducts($positions); try { $category->save(); } catch (Mage_Core_Exception $e) { Mage::log('data_invalid' . $e->getMessage()); } } public function removeFromCategory($sku,$categoryId) { $product = Mage::getModel('catalog/product')->loadByAttribute('sku', $sku); $category = Mage::getModel('catalog/category')->load($categoryId); $positions = $category->getProductsPosition(); $productId = $product->getId(); if (!isset($positions[$productId])) { Mage::log('product_not_assigned'); } unset($positions[$productId]); $category->setPostedProducts($positions); try { $category->save(); } catch (Mage_Core_Exception $e) { $this->_fault('data_invalid', $e->getMessage()); } }
相关推荐
Create Tests Node: assigns a set of tests from a test schedule to a sample. Action Node: Defines a branch of the workflow that will be executed in response to a user action. Event Node: Defines a ...
Control Panel - Add/Remove Programs
When mapping from an ER model to a relational model, a strong entity is mapped into a (a) table (b) row (c) column (d) key Correct answer is (a) 10. Which of the following is true about ...
一款很好用的卸载程序,很多顽固程序手动无法卸载的均可使用此程序卸载.
This document describes how to add a file into WinCE 6.0 Emulator OS image using PB 6.0.
/>put into appsettingRun licensepro.exe to remove all limitations, regsiter it with anyname/company and serial: DD-APN-10-C001733将<appSettings><add key="DataDynamicsARLic" value=",,,&...
iDR SERIES WHAT IS IT? 2 The iDR is a 16 x 16 matrix mixer with an extensive array of audio management tools designed to ...programmed into iDR and run from the PL series remote controllers.
超強 軟體安裝 移除程式,它可以讓你 重覆 註冊 試用軟件 無 數次 !!
This document describes how to edit File system tree and add your folders into WinCE 6.0 Emulator OS image.
An easy way to add a Ribbon Panel Office 2007style
ORACLE 19C RAC remove add node
1. Unzip "Simple tags" archive and put all files into a folder like "/wp-content/plugins/simple-tags/" 2. Activate the plugin through the 'Plugins' menu in WordPress 3. Inside the Wordpress admin, go ...
指导如何新增NOKIA设备Common Bcch 小区文档
Add Custom Properties to a PropertyGrid.c#属性有用的例子。 http://www.codeproject.com/KB/vb/PropertyGridEx.aspx
jsa 向导 JADE Semantics Add-on tutorial & practical exercisesJADE Semantics Add-on tutorial & practical exercisesJADE Semantics Add-on tutorial & practical exercisesJADE Semantics Add-on tutorial & ...
product_add.jsp
POPUP_LABEL &Add/Remove Members... POPUP_MESSAGE Adds or removes members of the selected feature set. ACTIONS STANDARD END_OF_MENU ! *************** Edit Menu *************** AFTER UG_EDIT_UNDO_...
intent addCategory Intent CATEGORY HOME ; List<ResolveInfo> res context getPackageManager queryIntentActivities intent PackageManager GET ACTIVITIES ; if res null { for int i 0; i...
b||a.filter(b,[this]).length)&&a("*",this).add([this]).each(function(){try{a(this).triggerHandler("remove")}catch(b){}});return d.call(a(this),b,c)})}}a.widget=function(b,c,d){var e=b.split(".")[0],f;...
In this book, we will build a complete website for a fictional client from scratch. We start at the beginning by downloading and installing Drupal, progress to creating and editing pages, and then we ...