Skip to main content
added 43 characters in body
Source Link
laketuna
  • 6.9k
  • 7
  • 40
  • 82

I think there are a few ways to do this. One way is this.

  1. Create an attribute that holds an integer and doesn't show on the frontend. Name this "Number of Associated/Child Products".

  2. Create an observer to hook onto the catalog_product_save_before event to save the number of child products for grouped products only.

  3. Rewrite Mage_Catalog_Block_Product_List::_getProductCollection to add an ORDER BY clause using your custom attribute. $collection->getSelect()->__toString()->order('e.my_attribute ASC') (or DESC) is the syntax.

This will require you to go through all of your grouped products and save them without once to populate the custom attribute. This in effect acts as a global position value as opposed to the category product positions, which apply to specific categories. I've never tried this, but it should work.

I think there are a few ways to do this. One way is this.

  1. Create an attribute that holds an integer and doesn't show on the frontend. Name this "Number of Associated/Child Products".

  2. Create an observer to hook onto the catalog_product_save_before event to save the number of child products for grouped products only.

  3. Rewrite Mage_Catalog_Block_Product_List::_getProductCollection to add an ORDER BY clause using your custom attribute. $collection->getSelect()->__toString()->order('e.my_attribute ASC') (or DESC) is the syntax.

This will require you to go through all of your grouped products and save them without once to populate the custom attribute. This in effect acts as a global position value as opposed to the category product positions, which apply to specific categories.

I think there are a few ways to do this. One way is this.

  1. Create an attribute that holds an integer and doesn't show on the frontend. Name this "Number of Associated/Child Products".

  2. Create an observer to hook onto the catalog_product_save_before event to save the number of child products for grouped products only.

  3. Rewrite Mage_Catalog_Block_Product_List::_getProductCollection to add an ORDER BY clause using your custom attribute. $collection->getSelect()->__toString()->order('e.my_attribute ASC') (or DESC) is the syntax.

This will require you to go through all of your grouped products and save them without once to populate the custom attribute. This in effect acts as a global position value as opposed to the category product positions, which apply to specific categories. I've never tried this, but it should work.

Source Link
laketuna
  • 6.9k
  • 7
  • 40
  • 82

I think there are a few ways to do this. One way is this.

  1. Create an attribute that holds an integer and doesn't show on the frontend. Name this "Number of Associated/Child Products".

  2. Create an observer to hook onto the catalog_product_save_before event to save the number of child products for grouped products only.

  3. Rewrite Mage_Catalog_Block_Product_List::_getProductCollection to add an ORDER BY clause using your custom attribute. $collection->getSelect()->__toString()->order('e.my_attribute ASC') (or DESC) is the syntax.

This will require you to go through all of your grouped products and save them without once to populate the custom attribute. This in effect acts as a global position value as opposed to the category product positions, which apply to specific categories.