buging
March 19, 2016, 12:00am
#1
Hi,
We want to disable 'Show out of stock products' in general settings to automatically hide products that have zero qty. However, we'd like those products with 'Sign up for notification' enabled for 'O ut of stock actions' to still be visible in the storefront. I know this will require some coding but I'm guessing it should be just a few lines probably.
Can anyone help with this? I'm using Multivendor 4.3.2
Thanks
try the following:
- open the app/functions/fn.catalog.php file
- replace
$condition .= db_quote(
' AND (CASE products.tracking' .
' WHEN ?s THEN inventory.amount > 0' .
' WHEN ?s THEN products.amount > 0' .
' ELSE 1' .
' END)',
ProductTracking::TRACK_WITH_OPTIONS,
ProductTracking::TRACK_WITHOUT_OPTIONS
);
with
$condition .= db_quote(
' AND (CASE products.tracking' .
' WHEN ?s THEN ((inventory.amount > 0 AND products.out_of_stock_actions != "S") OR products.out_of_stock_actions = "S")' .
' WHEN ?s THEN ((products.amount > 0 AND products.out_of_stock_actions != "S") OR products.out_of_stock_actions = "S")' .
' ELSE 1' .
' END)',
ProductTracking::TRACK_WITH_OPTIONS,
ProductTracking::TRACK_WITHOUT_OPTIONS
);
- clear cache (&cc&ctpl)
- check the result
buging
March 25, 2016, 12:00am
#3
try the following:
- open the app/functions/fn.catalog.php file
- replace
$condition .= db_quote(
' AND (CASE products.tracking' .
' WHEN ?s THEN inventory.amount > 0' .
' WHEN ?s THEN products.amount > 0' .
' ELSE 1' .
' END)',
ProductTracking::TRACK_WITH_OPTIONS,
ProductTracking::TRACK_WITHOUT_OPTIONS
);
with
$condition .= db_quote(
' AND (CASE products.tracking' .
' WHEN ?s THEN ((inventory.amount > 0 AND products.out_of_stock_actions != "S") OR products.out_of_stock_actions = "S")' .
' WHEN ?s THEN ((products.amount > 0 AND products.out_of_stock_actions != "S") OR products.out_of_stock_actions = "S")' .
' ELSE 1' .
' END)',
ProductTracking::TRACK_WITH_OPTIONS,
ProductTracking::TRACK_WITHOUT_OPTIONS
);
- clear cache (&cc&ctpl)
- check the result
This worked! thanks eComlabs!
victorb
December 13, 2022, 12:11pm
#5
Hello ecomlabs,
Can work also for Cs-cart 4.15.x ?
thanks
Unfortunately, no. The inventory alias is not used anymore