I'm not an Magento expert, but it seems to me that these codes may vary depending on configuration and modules installed on Magento. Someone can confirm / infirm that ?
You have to ensure that your configuration of Magento uses the same codes that the ones defined in the available_sort_by and default_sort_by fields of product.category.
To know them, you can display the source of the web page in the magento's administration where the fields are displayed (edit categories). In the source, check the value attribute of each option.
In our case, we have specific customizations on Magento so we anyway had to modify these codes.
You can put them in a configuration module just by overriding the columns, something like that :
class ProductCategory(magerp_osv.magerp_osv):
"""Modify the available magento sorting options."""
_inherit = "product.category"
Hello,
I'm not an Magento expert, but it seems to me that these codes may vary depending on configuration and modules installed on Magento. Someone can confirm / infirm that ?
You have to ensure that your configuration of Magento uses the same codes that the ones defined in the available_sort_by and default_sort_by fields of product.category.
To know them, you can display the source of the web page in the magento's administration where the fields are displayed (edit categories). In the source, check the value attribute of each option.
In our case, we have specific customizations on Magento so we anyway had to modify these codes.
You can put them in a configuration module just by overriding the columns, something like that :
class ProductCategory (magerp_ osv.magerp_ osv):
"""Modify the available magento sorting options."""
_inherit = "product.category"
SORT_BY_OPTIONS = (
('position' , 'Position'),
('custom_ default_ manufacturer' , 'Manufacturer'),
('custom_ rdc_availabilit y', 'Availability'),
('None', 'Use Config Settings'),
('price', 'Price'),
)
_columns = {
'available_ sort_by' : fields.selection(
SORT_BY_ OPTIONS,
'Available Product Listing (Sort By)',
size=32) ,
'default_ sort_by' : fields.selection(
SORT_BY_ OPTIONS,
'Default Product Listing Sort (Sort By)',
size=32) ,
}
ProductCategory()
Regards
Guewen