Magento bulk price changes

后端 未结 4 827
孤城傲影
孤城傲影 2021-02-10 01:22

What I\'m trying to do is, a bulk price change on products in a certain category. We receive suggested retail prices from our vendor, but sometimes these don\'t work for us. So

相关标签:
4条回答
  • 2021-02-10 02:09

    Stepping away from Magento's ORM (as resource hungry as it can be) isn't really a good idea. Here's a patch for 1.4 CE memory leak and I would do it the "Magento" way and save the headaches of missing or partial data needed. You may also consider Unigry's Data RapidFlow as well, hefty price tag but well worth every penny if your having to manage a lot of product/category data often.

    0 讨论(0)
  • 2021-02-10 02:09

    however you can use magento data object to update example:

    $product = Mage::getModel('catalog/product')->load($id);
    $product->setData('price',$value);
    $product->save();
    
    0 讨论(0)
  • 2021-02-10 02:21

    Honestly, B00MER has the right idea, but I've also had to do similar things in a pinch before. Plus, I felt like writing a little SQL. If you just want to multiply costs by 1.2 for all products in a category, you can do something like this:

    update catalog_product_entity_decimal
      set value = value*1.2
      where attribute_id = 75 and
            entity_id IN (select product_id from catalog_category_product
                        where category_id = X);
    

    You'll doubtless need to reindex everything and check your results to make sure. Obviously, replace X with your target category, and it appears that you use a table prefix of m_, so append that too (I'm leaving it off for other searchers who come here).

    Hope that helps!

    Thanks, Joe

    0 讨论(0)
  • 2021-02-10 02:22

    Consider magmi , it can do such things and many more and uses direct SQL. it also works for multi store setups.

    0 讨论(0)
提交回复
热议问题