Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

How to not show products when item goes out of stock?

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 04-03-2003, 11:00 AM
 
phatweb phatweb is offline
 

Advanced Member
  
Join Date: Mar 2003
Location: Atlanta, GA
Posts: 35
 

Default 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?
Reply With Quote
  #2  
Old 04-04-2003, 02:45 AM
  shan's Avatar 
shan shan is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Birmingham, UK
Posts: 6,163
 

Default

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
__________________
Looking for a reliable X-cart host ?
You wont go wrong with either of these.

EWD Hosting
Hands On Hosting
Reply With Quote
  #3  
Old 04-04-2003, 10:59 PM
 
John7 John7 is offline
 

Senior Member
  
Join Date: Jan 2003
Posts: 136
 

Default 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
Reply With Quote
  #4  
Old 04-05-2003, 12:57 AM
 
funkydunk funkydunk is offline
 

X-Man
  
Join Date: Oct 2002
Location: Cambridge, UK
Posts: 2,210
 

Default

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
__________________
ex x-cart guru
Reply With Quote
  #5  
Old 04-05-2003, 09:26 AM
 
John7 John7 is offline
 

Senior Member
  
Join Date: Jan 2003
Posts: 136
 

Default Thank you

Thanks

I'll try this out soon.

This is a cool feature.

Awesome!!!

John7
Reply With Quote
  #6  
Old 04-06-2003, 02:06 PM
 
phatweb phatweb is offline
 

Advanced Member
  
Join Date: Mar 2003
Location: Atlanta, GA
Posts: 35
 

Default

Someone let me know if that works... I'd definately be interested....
Sounds like a very cool mod....
Reply With Quote
  #7  
Old 04-09-2003, 07:41 AM
 
chargalley.com chargalley.com is offline
 

Member
  
Join Date: Feb 2003
Posts: 19
 

Default

Has anyone done this and had it work???? I am leery to try new things... if it ain't broke, etc...
Reply With Quote
  #8  
Old 04-09-2003, 07:47 AM
 
funkydunk funkydunk is offline
 

X-Man
  
Join Date: Oct 2002
Location: Cambridge, UK
Posts: 2,210
 

Default

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.
__________________
ex x-cart guru
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 07:25 AM.

   

 
X-Cart forums © 2001-2020