![]() |
Listing newest added product first
Add the ability to sort by add_date field along with listing default by this field. Edit include/search.php and locate the following code:
Code:
$sort_fields = array( Change to: Code:
$sort_fields = array( Next locate: Code:
# After this above code add: Code:
if(empty($sort)) $sort = "add_date"; Next locate: Code:
case "productcode": Above this line add: Code:
case "add_date": Thats it! Now all of your product listings by default will show newest products first. As well as Date field has been added to the sort options list under "Date". :!: Keep in mind, X-Cart admin->General Settings->Apperance: "Select the order in which products should be displayed within a category:" will be ignored with this mod in place. |
Thats a nice touch Boomer, thanks :)
|
thanks! bookmarked for review later! I have a few other mods to add on that I purchased but this looks great ;)
|
This is what I have been looking for. It puts the newest products first in the listings! Thanks! :D
|
This is nice little useful mode...thanks boomer :D
|
Thanks for the free mod B00MER,
Can this mod be editted so products can be sorted by Manufacturers? |
Quote:
|
one thing we have seen that has been a bit of a nuisance.... when products are updated via CVS and imported they noted as "new" when they really are not new.
|
Hmmmm - could I have some help - tried this tonight and works great "almost"!
My date doesn't change from ASC to DESC http://scrapbookbytes.com/store/manufacturers.php?manufacturerid=22 |
What changes should be made if you dont want it sorted by default using newest date but you just want it as an option so if they click it it will sort and put newest first. Another wards i want to keep the default to sort alphabetical.
|
Quote:
same here: http://www.fractalspin.com/x/home.php?cat=7 any thoughts? |
sort by pirce desc
any idea to get it to sort be price from high to low price
Thanks |
try change
DESC for $direction |
It's still not working--yes, when you click it once you can get it to sort with the newest first, but it doesn't sort like the other ones do. I think there is a problem with the code. It doesn't sort ASC or DESC.
|
sort by price
thanks shan
I tried it but did not work. How about takaing out the mod and having to show products sorted first by price form highest to lowest price. Any advise will be appreciated. thanks |
Works Perfectly in 4.1.2
Thanks for the mod I did have to change one line to get the sort by working correctly.
As noted by Shan in an earlier post I changed the following line: Code:
case "add_date": to this Code:
case "add_date": Works great! Thanks again Update: Mod did not by default change to dispay by date. I found that I had to update the products_order feild in the Config table within the datebase. Use the following SQL command to get the new Date module as an option in the admin section. Code:
UPDATE `xcart_config` SET `variants` = 'productcode:lbl_sku title:lbl_product orderby:lbl_default price:lbl_price add_date:lbl_date ' WHERE `name` = 'products_order' LIMIT 1 ; |
Quote:
When I made that change I got this DB Error: Code:
INVALID SQL: 1064 : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '1 xcart_featured_products, xcart_products_categories, xcart_categories LEFT JOI' at line 1 weird, right?[/quote] |
Great and easy mod...I'm all about easy! Works like a charm! Thank you !!!
|
Incorrect Answer... Deleted.
|
fractalspin,
Your problem is right here... Code:
xcart_pricing 1 xcart_featured_products, This means while the $direction is working its not being translated... Might try something like this.. Code:
case "add_date": |
Re: Listing newest added product first
It's not working on 4.0.17.
What should be the value for $sort_string ? I'm getting this: "xcart_products_categories.orderby ASC" I think it's not valid. I followed all steps. Thx. |
Re: Listing newest added product first
Finally It's working on 4.0.17. That's what I had to do: - It wasn't working with the first indications, and I could not change in the database what lachild said, because my version hasn't a field 'variants' in xcart_config. So, in /admin/configuration.php: Around line 143: Code:
$products_orderby = array( Before "productcode", add Code:
"add_date" => func_get_langvar_by_name("lbl_date"), And it's working very well, and I can change the order from the admin/General Settings/Appearance/ Select the order... Hope this help! |
Re: Listing newest added product first
Thanks for this great mod!
Newest products are indeed shown first, but unfortunately the ASC or DESC sort doesn't work for me either... Any body got this fixed for version 4.x? Thanks! |
Re: Listing newest added product first
I want to be able to sort my products by quantity in stock, so my customer views the most products in stock first.
Now at the moment in the admin section we have in X-Cart admin->General Settings->Apperance: "Select the order in which products should be displayed within a category:" SKU PRODUCT PRICE DEFAULT I want to add to this QUANTITY so all my low quantity items and out of stock items will be displayed last when a customer is viewing the products. Anyone got any ideas ? |
Re: Listing newest added product first
Worx fine !!!! Thx guys !!!!
I couldnt not set sort by date as default. everytime i klick on category, it's sort by name. how can i set this is the 'default' sort? |
Re: Listing newest added product first
Is there a way to make this mod do the following:
1. AUTO show newest added products 2. But ALSO be able to use the Manual ORDER to move specific products around? X-Cart Gold 4.0.19 |
Re: Listing newest added product first
Quote:
Thats what I'm looking for, sort by add_date = newest by default in x-cart 4.1.6. It works fine as is for x-cart 4.0.19. |
Re: Listing newest added product first
Just wondering what I'm doing wrong. I've made all the changes Boomer outlined (thanks Boomer), and the date option appears, but it doesn't default to date. In other words, if I choose SKUchoose as the default in general settings--> appearance, it still sets SKU to be the default. There is no way to set date as the default. A customer can choose to order by date, but I want date to be automatically chosen so they see newest items first by default.
Any help? |
Re: Listing newest added product first
You are not doing anything wrong. This modification does not work correctly in 4.1.x.
|
Re: Listing newest added product first
Any update on this to work with the current version of xcart (4.1.8)?
|
Re: Listing newest added product first
I would love to get this working in 4.1.8 as well.
|
Re: Listing newest added product first
Hello
Just want to see if anyone has any update on displaying the newest products first? I am managing x-cart version 4.1.10. Thanks in advance |
All times are GMT -8. The time now is 07:07 PM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.