![]() |
New "Quantity" sorting rule
Here is a custom modification for xcart 4.1.3 to add a Quantity sorting so that your products out of stock or low quantity can be shown last or 1st, which ever you want.
2 files to change and a sql patch products.php include/search.php With the include/search.php find: Code:
And replace with: Code:
With the products.php find: Code:
Replace with: Code:
Apply the SQL changes (Open the Patch/Upgrade page in admin area and select the patch.sql from the archive for the "Apply SQL patch" section). Code:
Thats it. |
Re: New "Quantity" sorting rule
This is a great mod and works perfectly for the search function. How could I get the same sort functionality for a regular product list page?
|
Re: New "Quantity" sorting rule
I'm having this problem with a 4.0.19 site. Is there an equivalent mod for this version?
Cheers |
Re: New "Quantity" sorting rule
Here is a custom modification for xcart 4.1.9 to add a Quantity sorting so that your products out of stock or low quantity can be shown last.
2 files to change and a sql patch products.php include/search.php With the include/search.php find: Code:
$sort_fields = array( And replace all the code with: Code:
$sort_fields = array( With the products.php find: Code:
$search_data["products"] = array(); And replace the full code with: Code:
$search_data["products"] = array(); Apply the SQL changes (Open the Patch/Upgrade page in admin area and select the patch.sql from the archive for the "Apply SQL patch" section). Code:
UPDATE xcart_config SET value='quantity', variants='productcode:lbl_sku\r\ntitle:lbl_product\r\norderby:lbl_default\r\nprice:lbl_price\r\nquantity:lbl_quantity' WHERE name='products_order'; You can see this working at http://www.shishapipe.net/shopcart/home.php?cat=280 - You will see the products i have a lot of stock shows first then at the end are the out of stock products. |
Re: New "Quantity" sorting rule
This is a great mod, thanks!
Only problem I have is when the product has variants, it will go to the back as well Any ideas to solve this? Would it be possible in some way to move JUST the "out of stock" to the back to the list, and keep the original ranking system of the products? Thanks again :) |
Re: New "Quantity" sorting rule
UPDATE xcart_modules SET active='N' WHERE moduleid='87';
i dont have any module with ID = 87 ! what is tha module name ? |
Re: New "Quantity" sorting rule
For 4.3 versions???
|
Re: New "Quantity" sorting rule
Is any method for latest 4.5x branch? This is a great idea. The customer will see the product which has most quantity first. And put the low or out of stock last.
|
Re: New "Quantity" sorting rule
can you please help me
i have 4.5.5 version and i need to sort the list of variant and show the out of stock at end of the row . what i mean is when one color is out of stock then that color will be shown as last option in variant list . do you have a code for this |
Re: New "Quantity" sorting rule
Quote:
Did you ever come up with a solution for this in 4.5 or 4.6? We are running 4.6.1 and would love to be able to sort by qty so that sold out items appear last in the list. |
All times are GMT -8. The time now is 09:27 PM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.