Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+
Dear ChrisD24,
I am having the same problem and after making the change as yo mentioned i still have the problem can you please post the code here so i can see if i am doing everything correct:
PHP Code:
// stock by attributes
if ( STOCK_CHECK == 'true' ) {
// Added to allow individual stock of different attributes
unset($attributes);
if(is_array($products[$i]['attributes'])){
$attributes = $products[$i]['attributes'];
} else {
$attributes = '';
}
$stock_check = zen_check_stock($products[$i]['id'], $products[$i]['quantity'],$attributes);
if (zen_not_null($stock_check))
$flagStockCheck = NULL;
{
$flagAnyOutOfStock = true;
$flagStockCheck = $stock_check;
$stockAvailable = zen_get_products_stock($products[$i]['id'], $attributes);
}
}
// end stock by attributes
this is wat i have and mine still shows out of stock error for item B if Item A is out of stock.
Thank you
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+
Quote:
Originally Posted by
harmeetsandhu
Dear ChrisD24,
I am having the same problem and after making the change as yo mentioned i still have the problem can you please post the code here so i can see if i am doing everything correct:
PHP Code:
// stock by attributes
if ( STOCK_CHECK == 'true' ) {
// Added to allow individual stock of different attributes
unset($attributes);
if(is_array($products[$i]['attributes'])){
$attributes = $products[$i]['attributes'];
} else {
$attributes = '';
}
$stock_check = zen_check_stock($products[$i]['id'], $products[$i]['quantity'],$attributes);
if (zen_not_null($stock_check))
$flagStockCheck = NULL;
{
$flagAnyOutOfStock = true;
$flagStockCheck = $stock_check;
$stockAvailable = zen_get_products_stock($products[$i]['id'], $attributes);
}
}
// end stock by attributes
this is wat i have and mine still shows out of stock error for item B if Item A is out of stock.
Thank you
I have $flagStockCheck = NULL; above if (zen_not_null($stock_check))
PHP Code:
$stock_check = zen_check_stock($products[$i]['id'], $products[$i]['quantity'],$attributes);
$flagStockCheck = NULL;
if (zen_not_null($stock_check))
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+
I changed mine to exactly as yours but i still get this again:
item A out of stock but Item B is in stock but get the out of stock message and the stock avilable is same as ITEM A.
pulling my hair out now. You got any idea.
Thanks
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+
Forgot to mention that ITEM B has no attribute attached to it though but if i add any other item so lets say item C with attributes.
It works as expected.
Not getting anywhere with this.
Regards
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+
Quote:
Originally Posted by
harmeetsandhu
Forgot to mention that ITEM B has no attribute attached to it though but if i add any other item so lets say item C with attributes.
It works as expected.
Not getting anywhere with this.
Regards
Exactly, I am still waiting on an answer for products without attributes. :frusty:
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+
I read before that you tried uncommenting the
PHP Code:
/*
if (STOCK_CHECK == 'true') {
$flagStockCheck = zen_check_stock($products[$i]['id'], $products[$i]['quantity']);
if ($flagStockCheck == true) {
$flagAnyOutOfStock = true;
}
}
*/
did that make any difference to you.
Regards
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+
Quote:
Originally Posted by
harmeetsandhu
I read before that you tried uncommenting the
PHP Code:
/*
if (STOCK_CHECK == 'true') {
$flagStockCheck = zen_check_stock($products[$i]['id'], $products[$i]['quantity']);
if ($flagStockCheck == true) {
$flagAnyOutOfStock = true;
}
}
*/
did that make any difference to you.
Regards
Only if I want to have the attributes stock break. Hopefully someone out there can figure this bug out - glad I am not the only one!
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+
Removing the post as the change i mentioned doesnt work.
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+
Actually wrote to soon:
It doesnt work as the item i choose to test had an attribute. the one without attributes still have this problem :frusty:
will try and sort this out will let u know if i can find the bug.
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+
Quote:
Originally Posted by
harmeetsandhu
Actually wrote to soon:
It doesnt work as the item i choose to test had an attribute. the one without attributes still have this problem :frusty:
will try and sort this out will let u know if i can find the bug.
Nope - I don't think it changed anything. It doesn't show the out of stock/low stock warning nor mark the product with ***. But I think it did that before I tried that code.