Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在 magento 商店中有大量产品,需要根据不同的属性将其分类到新的类别中,任何人都知道如何使用脚本来做到这一点。
例子:
如果产品属性“COLOR”的值为 Blue,则产品应在 cat 10 中,依此类推
迭代产品后,您可以使用 setCategoryIds 方法(此代码用于下拉属性,因为它使用 getAttributeTextMethod):
$product->load($productId); if( strcmp($product->getAttributeText('COLOR') , 'Blue') == 0 ){ $product->setCategoryIds(array('cat1Id' ,'cat2Id')); } $product->save();
I'm using a template that I bought and I'm having this issue:
Uncaught TypeError: Object #<Object> has no method 'peity' in unicorn.dashboard.js:11