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()); } }
相关推荐
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 ...
一款很好用的卸载程序,很多顽固程序手动无法卸载的均可使用此程序卸载.
/>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=",,,&...
超強 軟體安裝 移除程式,它可以讓你 重覆 註冊 試用軟件 無 數次 !!
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 ...
Add Custom Properties to a PropertyGrid.c#属性有用的例子。 http://www.codeproject.com/KB/vb/PropertyGridEx.aspx
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 ...
vue-cli3增删改,不需要后端接口,纯前端逻辑,复制粘贴就能用,主要提供学习,绝对适合新手非常适合新手学习非常适合新手学习
You don‘t even need to know the database is there, and you can change from one database to another simply by changing a few statements in a configuration file. If you’ve needed to add a database ...
When you get or check out one of these objects, the Access Source Code Control add-in copies the text file from the Visual SourceSafe project to a working folder on your machine. Microsoft Access ...
将数据库数据转换成insert sql语句,目前只在sql server测试过。 在SqlData2Insert.exe.config文件中修改连接数据库, ...insert into T_DIM_SENSOR_PRODUCT(PRODUCT_ID,PRODUCT_NAME) values (4,'内埋式应力计')
"BIT-PRUNING A SPARSE MULTIPLICATION-LESS DOT-PRODUCT的全文翻译" BIT-PRUNING A SPARSE MULTIPLICATION-LESS DOT-PRODUCT是一种新的稀疏点积方法,该方法可以减少神经网络中的能耗和空间成本。该方法的关键在于...
A Visual Studio add-in provides a number of useful workspace-related functions(673KB)