Post by pim » Sat Mar 15, 2008 9:58 pm

it seem to be the admin-> settings-> stock-> Check Stock value not checking truly in the code:

Code: Select all

pim@router:/www/webshop/public$ grep -nR "config->get('config_stock_check')" `pwd`
/www/webshop/public/catalog/controller/cart.php:62: 
$view->set('error', ((!$cart->hasStock()) && ($config->get('config_stock_check')) ? $language->get('error_stock') : NULL));
it's only template var set.

solution:
this condition

Code: Select all

if ((!$cart->hasProducts()) || ((!$cart->hasStock()) && (!$config->get('config_stock_checkout')))) {
	$response->redirect($url->ssl('cart'));
}
change to

Code: Select all

if ((!$config->get('config_stock_checkout')) || (!$cart->hasProducts())
 || ((!$cart->hasStock()) && $config->get('config_stock_check'))) {
	$response->redirect($url->ssl('cart'));
}
in three file:
catalog/controller/checkout_confirm.php
catalog/controller/checkout_payment.php
catalog/controller/checkout_shipping.php

i tested in 0.7.7

pim
Newbie

Posts

Joined
Fri Mar 14, 2008 5:52 am

Post by bruce » Sun Mar 16, 2008 2:21 pm

Actually, you should undo this and revert to the original code.

If you look in the store administration, menu Admin->Configuration->Setting, and click on the Stock tab then you will find the three options
Check Stock:
Allow Checkout:
Subtract Stock:

If you set Check Stock to yes and Allow Checkout to no then you will have what you wanted.

Active Member

Posts

Joined
Wed Dec 12, 2007 2:26 pm

Post by pim » Tue Mar 18, 2008 3:02 am

thanks bruce, i understand now, how it work.
this values name little unfair. :)
i was think "allow checkout", apply to all product in store, and if it's has "no" value, the shop is closed,
and if the "check stock" is yes, disable checkout for out of stock products.
i undo this, and rename this two config key for something logic.
hmm ... and i write a "shop closed" config key. :)

sorry my bad english.

pim
Newbie

Posts

Joined
Fri Mar 14, 2008 5:52 am
Who is online

Users browsing this forum: No registered users and 3 guests