1

I have more than 1000 products in my website.

I would like to add tier price based on category.. I mean each category has different tier price... Is there a way in magento to edit product attributes based on category?

So i can mass update those product attributes by adding tier price?

Thanks

4

2 回答 2

1

you can do a Module to do this. Create one observer to look for youmodule_core_block_abstract_prepare_layout_before, and in your observer method you do this:

 $block = $observer->getEvent()->getBlock();
    if(get_class($block) =='Mage_Adminhtml_Block_Widget_Grid_Massaction'
        && $block->getRequest()->getControllerName() == 'catalog_product') //change catalog_product to others grids.
    {
        $block->addItem('yourmodule', array(
            'label' => 'Price by Category',
            'url' => Mage::app()->getStore()->getUrl('yourmodule/controller/update'),
        ));
    }

And then, you get selected product in your updateAction() with $_post, and change their price.

于 2012-08-21T22:34:14.063 回答
1

Following from Guerra's answer you need a way to update the tier pricing on the products once you are inside the updateAction.

You can use the api functions on Mage_Catalog_Model_Product_Attribute_Tierprice_Api_V2 to create or update tier pricing. Have a look at the implementation in Mage_Catalog_Model_Product_Attribute_Tierprice_Api::update to get an idea of how to use the API.

It's tempting to do inserts into the database instead, which would obviously be faster but has risks and is never a good idea.

You also need a method to specify the tier prices - other than hard coding into your module.

May I suggest having a look at some commercial bulk price update extensions that will do all of this for you. You could modify them to filter based on category. For example - our Price Updater is 90% there.

于 2012-09-04T03:09:25.197 回答