BigCommerce - Hosted Ecommerce Software by Interspire

Interspire Forum

 
Go Back   Interspire Forum > Interspire Shopping Cart Community Forum > Customization and Integration > Layout and Store Design Customization

Reply
 
Thread Tools Display Modes
  #1  
Old 08-06-2009, 07:05 PM
heinzmty + heinzmty is offline
Interspire Customer
 
Join Date: Feb 2009
Posts: 106
Default if stock is 0, dissapear product

Hi,

I have only 300 items, and seems that more of 90 are right now in "0" stock level

is possible to disappear items? if is 0 ?

thanks !

urgent !

Heinz
Reply With Quote
  #2  
Old 08-06-2009, 09:45 PM
novista + novista is offline
Interspire Customer
 
Join Date: Nov 2008
Posts: 248
Default

Heinz,

Open /includes/display/class.category.php and find
PHP Code:
$query "
    SELECT
        COUNT(DISTINCT ca.productid) AS numproducts
    FROM
        [|PREFIX|]categoryassociations ca
        INNER JOIN [|PREFIX|]products p USE INDEX (PRIMARY) ON p.productid = ca.productid
    WHERE
        p.prodvisible = 1 AND
        ca.categoryid IN (" 
$this->GetProductCategoryIds() . ")
        "

Change p.prodvisible = 1 AND to read p.prodvisible = 1 AND p.prodcurrentinv > 0 AND
PHP Code:
$query "
    SELECT
        COUNT(DISTINCT ca.productid) AS numproducts
    FROM
        [|PREFIX|]categoryassociations ca
        INNER JOIN [|PREFIX|]products p USE INDEX (PRIMARY) ON p.productid = ca.productid
    WHERE
        p.prodvisible = 1 AND p.prodcurrentinv > 0 AND
        ca.categoryid IN (" 
$this->GetProductCategoryIds() . ")
        "



This is how you change it for the Category page. If you use Featured Products, New Products etc, you'll need to modify each of these PHP files as well. You'll find these in /includes/display. If you want to change Featured Products, open HomeFeaturedProducts.php. Look for WHERE p.prodvisible='1' AND (imageisthumb=1 OR ISNULL(imageisthumb)) and replace it with AND p.prodcurrentinv > 0

What you are doing is limited the product query to exclude all products where the inventory level is greater than zero.
Let me know if you have any problems getting this to work.
__________________
Michael Kopel
NovistaWeb.com
Reply With Quote
  #3  
Old 08-06-2009, 11:09 PM
heinzmty + heinzmty is offline
Interspire Customer
 
Join Date: Feb 2009
Posts: 106
Default

thanks !

I will try


..
Reply With Quote
  #4  
Old 08-06-2009, 11:31 PM
heinzmty + heinzmty is offline
Interspire Customer
 
Join Date: Feb 2009
Posts: 106
Default

perfect!

seems to work perfect

just for the record, the path is :
includes/classes/class.category.php

thanks a lot!

Heinz
Reply With Quote
  #5  
Old 11-04-2009, 12:43 PM
Szukacz Szukacz is offline
Junior Member
 
Join Date: Jun 2009
Posts: 2
Default

Hi
Is it possible to adapt this solution to dissapear product variations with stock=0?
How it should be done?

Greetings
Peter
Reply With Quote
Reply

Thread Tools
Display Modes

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump