Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+
I have installed this contribution and it works very well,
i have 2 questions.
i have a slight problem, on my test site i have a product which has around 10 attributes, some are in stock and some are out of stock,
when i go to the product on the cart as a customer, if i select one which is in stock on the drop down and click add to cart all is fine,
if i select one which is not in stock and then hit add to cart it goes to the cart and says out of stock which i guess i also fine,
however is it possible to update the page when each attribute is selected by the customer to display the add to cart or to display out of stock,
another way would be to have (In Stock) or (Out Of Stock) after the attribute name in the drop down.
are the above possible?
2nd question.
Is it possible to update more than one stock level at once, currently you have to select each product to update the stock level, is it possible to list the products to update all at once?
Thanks in advance
Rob
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+
Quote:
Originally Posted by
flobster
I have installed this contribution and it works very well,
i have 2 questions.
Both of your questions have been asked and answered repeatedly in the thread above. The answers can be boiled to "it depends" and "no". There's much more detail and explanation in the earlier posts.
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+
Ok i will have a good look through, sorry about that.
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+
Quote:
Originally Posted by
flobster
Ok i will have a good look through, sorry about that.
No problem. Tips - use the search this thread facility for localised searches. For the first question, search on "Grayson" or look in the Wiki, where I think there may be a link to the specific post from which to start. Also, for historic reasons, this mod has two support threads, so some of what you want may be covered in the other one too.
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+
Thanks Kuroi, I think I get the basic ideas now:
1. first we need to get the attribute id by using the products_id, option name and value (we dont want to use option id here for a specific reason) from the orders_products_attributes table
2. then we need to check if the TABLE_PRODUCTS_WITH_ATTRIBUTES_STOCK exists (in case users are not using this mod), if it is we check if the stock info for that attribute is there. If not, we then assuming it is using the product stock instead.
3. the problem is with product associated with multiple attributes tho. Since my test site is not using any product with more than 1 attribute, I dont know how it is stored in TABLE_PRODUCTS_WITH_ATTRIBUTES_STOCK and orders_products_attributes tables.
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+
Kuroi,
There is a problem with searching for the "string" as you suggested here:
"So, your first step would be to work backwards from the products_options_values to get the relevant products_options_values_ids in the products_options_values table, then concatenate them as a common-separated string and search for that string in the stock_attributes field of the products_with_attributes_stock table."
How would we get the exact order of the ids in the string? 19,29,30 and 29,19,30 contains the same ids but the string are different.
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+
Quote:
Originally Posted by
yellow1912
How would we get the exact order of the ids in the string?
I don't recall having ever seen them in any order other than sorted by numerical value from low to high.
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+
Quote:
Originally Posted by
vivaraquel
Thanks Kuroi, that did it. I had left the original order.php file ther just renamed it order1.php. Sounds absurd but hey, such are these things sometimes.
Ok, I had this fixed. But as I was checking on other stuff I went to my cart and hit the checkout button and got this error message again;
Fatal error: Cannot redeclare class order in /home/cheechab/public_html/includes/classes/order.php on line 20
However, I don't have any backed up order.php files in that folder now, just the one. I uploaded it fresh but it still does it.
Also, does the fix on post 46 work on ZC v.1.3.7.1 with this mod v.4.7? I need to figure out why when I try to add an attribute with 0 stock to the cart, no message comes up to say it's out of stock and if i go to checkout, the shopping cart page simply reloads.
The site I'm working on is http://www.cheechababy.com.au
Thank you.
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+
Quote:
Originally Posted by
vivaraquel
I don't have any backed up order.php files in that folder now, just the one. I uploaded it fresh but it still does it.
If a class is instantiated twice that either means that there are two instances of it, or the code that instantiates it is being called twice. So where else might you have left backup files ......
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+
hehe Thanks Kuroi, I had a couple more blasted things. Now the out of stock is working as well.
Have a good night,
Raquel.