![]() |
How to not show products when item goes out of stock?
If an item's available number reaches 0... is there a way to have it not show up on the store?
|
If you check in your admin general settings then you should see ...
Show quantity in stock: this will give the message .. Quantity Out of stock when a customer views an item that is either out of stock or the last item left is currently in someone elses basket. When you add your products or by choosing modify products you can change the Quantity in stock (items) Low limit in stock amounts |
Hmmm
Now wouldn't it be interesting if...
Wouldn't it be interesting if when an item was out of stock that it not only registers as being out of stock but the actual product would become unavailable and not even apear on the site until you put more of that item back in stock. Therefore if an item is out of stock the item doesnt even show up on the website. What do you think? Would this be a cool mod? I bet I could find a client that would like this feature. John7 |
Quite an easy one this..
first, in include/categories.php there is a line that says: Code:
$current_category["product_count"] = array_pop(func_query_first("SELECT COUNT(*) FROM $sql_tbl[products] WHERE (categoryid=$category_data[categoryid] OR categoryid1=$category_data[categoryid] OR categoryid2=$category_data[categoryid] OR categoryid3=$category_data[categoryid]) and $sql_tbl[products].forsale='Y'")); Code:
$current_category["product_count"] = array_pop(func_query_first("SELECT COUNT(*) FROM $sql_tbl[products] WHERE (categoryid=$category_data[categoryid] OR categoryid1=$category_data[categoryid] OR categoryid2=$category_data[categoryid] OR categoryid3=$category_data[categoryid]) and $sql_tbl[products].forsale='Y' and $sql_tbl[products].avail>0")); then in customer/products.php change: Code:
$search_query = "($sql_tbl[products].categoryid='$cat' or $sql_tbl[products].categoryid1='$cat' or $sql_tbl[products].categoryid2='$cat' or $sql_tbl[products].categoryid3='$cat') and $sql_tbl[products].forsale='Y'"; to Code:
$search_query = "($sql_tbl[products].categoryid='$cat' or $sql_tbl[products].categoryid1='$cat' or $sql_tbl[products].categoryid2='$cat' or $sql_tbl[products].categoryid3='$cat') and $sql_tbl[products].forsale='Y' and $sql_tbl[products].avail>0"; That should stop the products being added to the products array if there are none available. btw this is based on 3.3.x code |
Thank you
Thanks
I'll try this out soon. This is a cool feature. Awesome!!! John7 |
Someone let me know if that works... I'd definately be interested....
Sounds like a very cool mod.... :) |
Has anyone done this and had it work???? I am leery to try new things... if it ain't broke, etc...
|
3.3.5 has this already built in as a switcheable thing in admin. Better off doing the upgrade to 3.3.5 if you want the function there.
|
All times are GMT -8. The time now is 12:19 PM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.