Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+
I've installed the 4.7 version on Zen-cart 1.3.9h and it's not working - no stock is being substracted according to my client and also in the stock by attributes page in admin the two lines (overall and variant) do not tally.
The site is set to subtract stock - obvious first question...
I'm not sure how to sort this out - any help or experiences would be appreciated. I've used an earlier version which worked fine..
Andy
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+
Quote:
Originally Posted by
limelites
Additionally, if you want the attribute in the drop down menu to automatically disable when the attribute quantity = zero, then you have to open /includes/modules/attributes.php and replace this:
PHP Code:
$sql = "select pov.products_options_values_id,
pov.products_options_values_name,
pa.*
from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov
where pa.products_id = '" . (int)$_GET['products_id'] . "'
and pa.options_id = '" . (int)$products_options_names->fields['products_options_id'] . "'
and pa.options_values_id = pov.products_options_values_id
and pov.language_id = '" . (int)$_SESSION['languages_id'] . "' " .
$order_by;
with this:
PHP Code:
$sql= "SELECT pov.products_options_values_id,
pov.products_options_values_name,
pa.*,
pwas.*
FROM " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov, " . TABLE_PRODUCTS_ATTRIBUTES . " pa LEFT JOIN " . TABLE_PRODUCTS_WITH_ATTRIBUTES_STOCK . " pwas ON pwas.stock_attributes = pa.products_attributes_id
WHERE pa.products_id = '" . (int)$_GET['products_id'] . "'
and pa.options_id = '" . (int)$products_options_names->fields['products_options_id'] . "'
and (pwas.quantity > 0 or pwas.quantity IS NULL)
and pa.options_values_id = pov.products_options_values_id
and pov.language_id = '" . (int)$_SESSION['languages_id'] . "' " .
$order_by;
I've got a similar requirement on my site - if an attribute is out of stock it should be removed from the radio button list (radio buttons as opposed to dropdowns per the client's request).
This is somewhat complicated by the fact that each product has 2 attributes, so the attribute would only be removed if it's out of stock in ALL combinations.
A good example is this product:
http://www.vkoonyc.com/accessories-c...oop-scarf-p-20
There's only one size, which makes it easy to test. It's out of stock in Mocha and Lt Grey, and I would like both of those attributes to be removed from the radio button list.
I tried limelite's code in attributes.php but it had no effect.
Using Zen Cart 1.3.9h w/ SBA 4.12.
Thanks in advance!
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+
Solved my own problem! In the end the magic code was this:
Code:
$sql="SELECT DISTINCT pov.products_options_values_id, pov.products_options_values_name, pa. *
FROM " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov, " . TABLE_PRODUCTS_ATTRIBUTES . " pa
LEFT JOIN products_with_attributes_stock pwas ON pwas.stock_attributes REGEXP pa.products_attributes_id
WHERE pa.products_id = '" . (int)$_GET['products_id'] . "'
AND pa.options_id = '" . (int)$products_options_names->fields['products_options_id'] . "'
AND (
pwas.quantity >0
OR pwas.quantity IS NULL
)
AND pa.options_values_id = pov.products_options_values_id
AND pov.language_id = '" . (int)$_SESSION['languages_id'] . "'" .
$order_by;
Hope that helps someone else!
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+
ChrisD24
I had the same problem with items not in stock. It wouldn't let you check out if an item wasn't in stock, but wouldn't tell you why. After banging my head a while I tried your solution. It works!
Thanks so much!
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+
There are mixed reviews about whether or not this works.
Does this module work as intended for ZC v1.3.9h.
I am currently using CReinold's v5.0b (w/ AJAX) which isn't working for me as it is allowing customers to add more than that stock quantity remaining into their basket and checkout. (See post: HERE for full description)
Does this version work properly to this aspect?
Thanks for your help.
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+
The disable option when 0 fix has worked for me, thanks very much.
Chris I want to try your fix but I am failing at the first hurdle as I can't find the correct file to edit, can you confirm the file name and location.
Site is - www.mightcontainnuts.com
Zen Cart - 1.3.9h
Thanks for your help.
Barry.
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+
OK, another question....is this an accepted limitation of this addon or should it support error messages? It clearly knows the items are not in stock at the required level because it prevents checkout, but does not present an error message for me.
If this is a problem with my configuation then I can look at possible options, if it is a known issue then I may need someone to code a fix, this is a real issue for us and is costing sales.
Any thoughts?
Thanks,
Barry.
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+
Hi There,
I am receiving the following error. could any one help me to find out the problem ..
0
in:
[select pov.products_options_values_id, pov.products_options_values_name, pa.* from products_attributes pa, products_options_values pov where pa.products_id = '22548' and pa.options_id = '2' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '1' order by LPAD(pa.products_options_sort_order,11,"0"), pov.products_options_values_name]
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+
I am using a text field for a product which is letters printed to the customers wish. Stock by attributes creates a stock record in the stock by attributes table, but stock is zero and always puts the out of stock message in the cart.
Is there a work around so that stock for a product with a text field like this does not show out of stock. This issue is also true if you have a mix of drop downs eg a name printed on a t-shirt. Customer chooses size of T-shirt and then enters name in a text field. Want to track the stock of the t-shirt by size but not worry about the text for the name.
Does any one else have a similar issue and is there a work around.
Another variation for my situation is products shipped direct.....never has stock but could have a choice of attributes. Again the out of stock message shows in the cart.
Thanks in advance.
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+
I have another question. If I add quantity for all variants how do I stop it adding variants for display only fields. If I ask it to add qty for all variants and that vaiant exists I think there is a bug as it adds the variant again so I then have the same variant twice.
I have looked through the whole of this thread. Sorry if I have missed the answer to these. I could not see it having been answered.
Thanks
MikeyG