X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   How to not show products when item goes out of stock? (https://forum.x-cart.com/showthread.php?t=2144)

phatweb 04-03-2003 11:00 AM

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?

shan 04-04-2003 02:45 AM

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

John7 04-04-2003 10:59 PM

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

funkydunk 04-05-2003 12:57 AM

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'"));
change to:
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

John7 04-05-2003 09:26 AM

Thank you
 
Thanks

I'll try this out soon.

This is a cool feature.

Awesome!!!

John7

phatweb 04-06-2003 02:06 PM

Someone let me know if that works... I'd definately be interested....
Sounds like a very cool mod.... :)

chargalley.com 04-09-2003 07:41 AM

Has anyone done this and had it work???? I am leery to try new things... if it ain't broke, etc...

funkydunk 04-09-2003 07:47 AM

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.