Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+
I have a problem with the stock errors on the shopping cart. If a product with an attribute is in the cart is either out of stock or over my stock count, the product is marked with *** correctly. However an item without any attributes doesn't generate an error. I think there is a problem with the code below:
Code:
// 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);
$flagStockCheck = NULL;
if (zen_not_null($stock_check))
{
$flagAnyOutOfStock = true;
$flagStockCheck = $stock_check;
$stockAvailable = zen_get_products_stock($products[$i]['id'], $attributes);
}
}
// end stock by attributes
} //end foreach [attributes]
/*
if (STOCK_CHECK == 'true') {
$flagStockCheck = zen_check_stock($products[$i]['id'], $products[$i]['quantity']);
if ($flagStockCheck == true) {
$flagAnyOutOfStock = true;
}
}
*/
If I un-comment out the original code, the error problem flips. It will mark the product without the attribute, but in return the product with the attribute is not longer marked. Is there a problem that any can see with the code?
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+
what version should we use for 1.3.9h, this one or the version bei creinold?
thanks a lot,
p1lot
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+
We're using Zen Cart 1.3.8. I believe I've install Stock by Attributes correctly but we're having 3 problems:
1. Some products work fine yet other show out of stock even though they are in stock. In other words, a blue large t-shirt checks out fine, when the red large t-shirt shows out of stock even though it isn't.
2. Available quantity shows 0 in the shopping even though there are some left. In other words, if someone orders 5 blue large t-shirts and there are 4 in stock, instead available quantity showing 4 it shows 0.
3. If the first product shows out of stock in the cart, subsequently added products also show out of stock even though they are in stock.
Does this sound like in installation problem, or maybe a configuration problem.
Thanks for your help.
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+
Quote:
Originally Posted by
p1lot
what version should we use for 1.3.9h, this one or the version bei creinold?
thanks a lot,
p1lot
the beta 5.0 is what I'm using on 1.3.9h (the one by creinold)
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+
Hi,
I'm using version 1.4.11 and zen v1.3.9d. I've got a strange situation where if someone adds more of one attribute than is in stock, it gets added to the shopping basket but no message appears to say that there isn't enough stock available. If the user then clicks on the checkout button they are returned to the shopping cart still with no error message.
If someone orders more than the total number of an item (with all attributes stock added together) the correct red message appears in the shopping bart page.
I've done lots of file comparisons but can't figure out what the problem is.
Any ideas?
Many thanks,
Richard
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+
Quote:
Originally Posted by
rpain
Hi,
I'm using version 1.4.11 and zen v1.3.9d. I've got a strange situation where if someone adds more of one attribute than is in stock, it gets added to the shopping basket but no message appears to say that there isn't enough stock available. If the user then clicks on the checkout button they are returned to the shopping cart still with no error message.
If someone orders more than the total number of an item (with all attributes stock added together) the correct red message appears in the shopping bart page.
I've done lots of file comparisons but can't figure out what the problem is.
Any ideas?
Many thanks,
Richard
THAT is my EXACT problem! Nothing I have listed with attributes tells how many of each item is available! I hope to find the answer too!
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+
Quote:
Originally Posted by
balticccreations
THAT is my EXACT problem! Nothing I have listed with attributes tells how many of each item is available! I hope to find the answer too!
OK same exact thing here. The products page shows the correct QTY in stock (sum of all attribute levels) but on cart it gives out of stick message and shows qty of 0 - please help!
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+
Quote:
Originally Posted by
bobcnj
OK same exact thing here. The products page shows the correct QTY in stock (sum of all attribute levels) but on cart it gives out of stick message and shows qty of 0 - please help!
Mine doesn't even do that. It just won't let them check out. It will show how many they added to their cart but not how many are actually available. But on the product page it gives the total number of products available just not how many of each attribute.
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+
Quote:
Originally Posted by
balticccreations
Mine doesn't even do that. It just won't let them check out. It will show how many they added to their cart but not how many are actually available. But on the product page it gives the total number of products available just not how many of each attribute.
I have been messing with this for some time and the problem I am having, besides my previous post is that if I have 2 or more items in my cart and the last product is over the limit or out it marks it correctly, but where it gets tricky is:
Cart (3 items for this example):
Item A
Item B
Item C
If Item A is over the limit, B & C are marked at out of stock. If you go over on item B, it marks B & C out of stock. But if just C is out of stock, then only C is marked. Basically from the item that is actually over or out, anything under it gets marked (even though they may not be).
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+
Quote:
Originally Posted by
ChrisD24
I have been messing with this for some time and the problem I am having, besides my previous post is that if I have 2 or more items in my cart and the last product is over the limit or out it marks it correctly, but where it gets tricky is:
Cart (3 items for this example):
Item A
Item B
Item C
If Item A is over the limit, B & C are marked at out of stock. If you go over on item B, it marks B & C out of stock. But if just C is out of stock, then only C is marked. Basically from the item that is actually over or out, anything under it gets marked (even though they may not be).
Fixed: http://www.zen-cart.com/forum/showpo...postcount=1001
I put the $flagStockCheck = NULL; after instead of before. :frusty: