Site maintenance: Sun 15 Nov, from 12:00 UTC, about 4–6 hours. Details

This cutover relies on some testing that is still incomplete so may be cancelled at short notice

Forums / Bug Reports / [Done v1.3.9] out stock products can be seen issue bug and fix

[Done v1.3.9] out stock products can be seen issue bug and fix

Locked

Started by samurai_jp on 14 Jan 2008, 2:34 AM · Views: 2,793

Results 1 to 4 of 4
This thread is locked. New replies are disabled.
14 Jan 2008, 2:34 AM
#1
samurai_jp avatar

samurai_jp

New Zenner

Join Date:
Jan 2008
Posts:
2
Plugin Contributions:
0

[Done v1.3.9] out stock products can be seen issue bug and fix

I f customers turn a product to 'out stock' status. his product is supposed to can not be seen anywhere if the status of '$include_deactivated' is false which is false in default. But there is a bug. I can see the products that i set to out stock. I researched the source code. And finally i found the reason.

in YOUR_STORE_DOMAIN/includes/functions/functions_categories.php.
go to function 'zen_get_categories_products_list'.

Change the following line

$sql = "select p.products_id
from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c
where p.products_id = p2c.products_id
and p2c.categories_id = '" . (int)$childCatID . "'" .
($include_deactivated ? " and p.products_status = 1" : "") .
$display_limit;

to:

$sql = "select p.products_id
from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c
where p.products_id = p2c.products_id
and p2c.categories_id = '" . (int)$childCatID . "'" .
($include_deactivated ? "" : " and p.products_status = 1") .
$display_limit;

It might be a tiny logic mistake.

14 Jan 2008, 2:51 AM
#2
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: [Done v1.3.9] out stock products can be seen issue bug and fix

What Version?

Zen-Venom Get Bitten

14 Jan 2008, 10:02 AM
#3
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,511
Plugin Contributions:
176

Re: [Done v1.3.9] out stock products can be seen issue bug and fix

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

14 Jan 2008, 2:18 PM
#4
samurai_jp avatar

samurai_jp

New Zenner

Join Date:
Jan 2008
Posts:
2
Plugin Contributions:
0

Re: [Done v1.3.9] out stock products can be seen issue bug and fix

The latest version. V1.3.8.:yes: