Set allowable sort methods in:
Admin>Catalog>Attributes>Manage Attributes>Properties>Frontend Properties>"Used for sorting in product listing”
Any that are set to “yes” in this field are allowed attributes to sort by.
Unfortunately it makes it rather more difficult to put other properties into the list that are not simple attributes.
It is simpler to use and quite flexible and I’m sure someone will find the bit of code to add to put other stuff in there. If you have modified toolbar.php for an earlier version you need to either re[place it with the new one or remove it from local. The previous methods no longer work.
I prefer to use date (created_at) as default, tried lots of stuff including messing around with catalog.xml but ended up with this (temporary) solution. Also hard coded sort options in the array. It’s not perfect but anyway…
The option is at the bottom of the “Edit Attribute” page, see attached screen shot.
My problem is that I can’t select my previously created attributes as sortable options. The dropdown menu is just greyed out (see attached screen shot). Anyone have any ideas about that?
·GuyGadbois
I am also wanna sort by date, and I was following the detail about above , But It did not work out, Can anyone tell me what to do, the Toolbar.php, can you show full codes in it ?
This isn’t working for me at all. I think something is over riding the settings somewhere. I got all my new products on my main page, and I increased the number that show up to the amount I wanted, but I just can’t seem to get them to sort properly.
I would like them to sort on news_from_date and then alphabetically after that (for products that have the same news_from_date entry).
They seem to be sorting by entity_id and from oldest to newest order.
I am really not much of a coder (a little html, shell, perl, php), and I have gone crosseyed reading forums trying to fix this. I have tried many different methods mentioned in the forums, to no avail.
Can anyone please point me in the right (very specific) direction? You can even point and call me n00b, if you want… grin
Running 1.3.0
Grunge Theme from magthemes.com
Zblocks
color views plus
Manage Products (Enhanced)
GoDaddy.com deluxe hosting plan
Hi there,
Going by MikeL117’s comments, i can see how to change that, but I’m actually looking for a way to order by the ID number rather than sku. Is there a way to do this is 1.31?
Thanks
Nic
Sorry so slow responding, I had forgotten I had left this post (in fact, I had completely forgotten what the method was until I stumbled across this thread when trying to implement it in my live store ).
Just to clarify the process:
In Admin select Manage Attributes from the menu. then from the list of attributes edit the one you want to add to the list of available sort orders. At the bottom of the page (in 1.3.1) in the Frontend Properties section there is a drop-down box labelled “Used for sorting in product listing” with Yes/No options. Select Yes then go to the “Manage Label/Options” tab and add the name you wan the users to see in the correct views.
Finally go to System>Configuration and find the Catalog tab, in the Frontend section there is a drop-down box called “Product listing sort by” where you can select the default setting for the catalog listings.
To change the default direction I hacked (a local copy of) the Toolbar.php file by changing ‘asc’ to ‘desc’ in line 97
The solutions provided by Guy and rtgr above look to be rather better in the long term.
If you prefer to not mess with core code (even a local copy of) then you can hack your local template version of Toolbar.phtml with something like this (about line 95)
<!-- set desc for Special Price and New --> <?php if($_key == 'news_from_date'): ?> <option value="<?php echo $this->getOrderUrl($_key, 'desc') ?>"<?php if($this->isOrderCurrent($_key)): ?> selected="selected"<?php endif; ?>> <?php else: ?> <option value="<?php echo $this->getOrderUrl($_key, 'asc') ?>"<?php if($this->isOrderCurrent($_key)): ?> selected="selected"<?php endif; ?>> <?php endif; ?>
@moki
Sorry I can’t see why your option is greyed out.
@Boa1969
My method above sorts by news_from_date with version 1.3.1 (I had too many problems with 1.3.0). Unfortunately at the moment there is no easy way to sort by two properties.
@OverloadWeb
Since the introduction of this improved method in version 1.3 there is not an easy way to sort by other attributes than the standard produce attributes, unless yo wan to expand on the above methods by Guy and rtgr. You would have to look at the available properties for Product ID and try to persuade Magento to use it.
A pragmatic workaround (assuming you don’t already have thousands of existing products) would be to make another product attribute and copy the Product ID into that. Crude but may be a way out for now.
Thanks for the ideas a simple extension may be the way, if only I could find the time to write one.
hey Mike!
Thanks for that!!! I did end up taking the easy way out - my client was happy for me to change the SKU number so i did that instead. But i appreciate your response!
Cheers
Nic
moki - The “Used for sorting in product listing” property is grayed out for me as well and states “depends on design theme” after the drop box. Were you able to find out how to enable this function? Thank you!
I prefer to use date (created_at) as default, tried lots of stuff including messing around with catalog.xml but ended up with this (temporary) solution. Also hard coded sort options in the array. It’s not perfect but anyway…