Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+
Is there an issue using this mod with multiple attributes?
For instance, I have a product with color and size attributes. I have added 100 stock for each attribute and the product display shows 2800 in stock.
But, the dropdown menus for each attribute are empty. (Yes, I did add the attributes in the attribute controller).
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+
Hi there...I have read the forum and only saw one reference to my problem and no resolution. The problem that i'm having is that when I go to the "Products with Attributes Stock" screen under "catalog" and try to "Add Quantity for Product Variat" I get the following error is I select "All" from each attribute:
Warning: Cannot modify header information - headers already sent by (output started at /var/www/dance/zen/zencart/admin/products_with_attributes_stock.php:193) in /var/www/dance/zen/zencart/admin/includes/functions/general.php on line 21
If I add them one by one by selecting the different combinations then i don't get any errors.
If i just click the back button after the error and refresh it looks like it works fine, but there seems to be a problem because it doesn't allow you to see the stock correctly (i'm using the dynamic dropdowns addon also)
I did a small test by adding one manually and then using the add all. then I had a look in the mysql table "products_with_attributes_stock". There is difference in how the attributes are added to the entry in the mysql table for the field "stock_attributes". For the one added manually with no errors and works properly with dynamic dropdowns, the attributes are in the following order: attribute 1, attribute 2, attribute 3, attribute 4. For the ones added by "all" in each attribute the order is: attribute 2, attribute 3, attribute 1, attribute 4. If i manually edit the entry in the table to put attribute 1 first then it works again. So it seems that the function that is adding the attributes for all combinations is putting them in the wrong order. Is there a fix for this?
John
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+
Quote:
Originally Posted by
kuroi
No from within Zen Cart. For a mass add you would need to structure and upload the information directly to the database.
ok kuroi - I took the plunge and started messing around with my database, but I'm a little stuck with this.
I exported the products_with_attributes_stock table from my database and took a look. I setup a test with two products with the same attribute combinations. Here was the results -
VALUES
(26, 1, '2,5,10', 100),
(27, 4, '20,24,26', 1000);
Each of the attributes are exactly the same (except stock) but there is a completely different combination of numbers to represent the combination.
Now say for product 1, if I add another set of attributes but only change one instance (say style) I would get something like '3,5,10' which makes total sense. But what I dont understand is how the numbers get their values for the other product numbers. Is there some sort of mathematical formula that correlates '2,5,10' equaling '20,24,26'?
If I try to run (through sql) say (28, 5, '2,5,10' 100) it says duplicate entry - making this mass add kinda difficult.
thx:smile:
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+
Quote:
Originally Posted by
Oakwood
ok kuroi - I took the plunge and started messing around with my database, but I'm a little stuck with this.
I exported the products_with_attributes_stock table from my database and took a look. I setup a test with two products with the same attribute combinations. Here was the results -
VALUES
(26, 1, '2,5,10', 100),
(27, 4, '20,24,26', 1000);
Each of the attributes are exactly the same (except stock) but there is a completely different combination of numbers to represent the combination.
Now say for product 1, if I add another set of attributes but only change one instance (say style) I would get something like '3,5,10' which makes total sense. But what I dont understand is how the numbers get their values for the other product numbers. Is there some sort of mathematical formula that correlates '2,5,10' equaling '20,24,26'?
If I try to run (through sql) say (28, 5, '2,5,10' 100) it says duplicate entry - making this mass add kinda difficult.
thx:smile:
I'm kinda new to zencart and this addon but i think i know the answer to your question. while the attribute might be the same when you add it to a product it gets another id. you can find these id's in the "products_attributes" table. you'll see that the attribute has an ID and it has a new ID each time it's associated with a product.
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+
Quote:
Originally Posted by
jsu1972
Hi there...I have read the forum and only saw one reference to my problem and no resolution. The problem that i'm having is that when I go to the "Products with Attributes Stock" screen under "catalog" and try to "Add Quantity for Product Variat" I get the following error is I select "All" from each attribute:
Warning: Cannot modify header information - headers already sent by (output started at /var/www/dance/zen/zencart/admin/products_with_attributes_stock.php:193) in /var/www/dance/zen/zencart/admin/includes/functions/general.php on line 21
If I add them one by one by selecting the different combinations then i don't get any errors.
If i just click the back button after the error and refresh it looks like it works fine, but there seems to be a problem because it doesn't allow you to see the stock correctly (i'm using the dynamic dropdowns addon also)
I did a small test by adding one manually and then using the add all. then I had a look in the mysql table "products_with_attributes_stock". There is difference in how the attributes are added to the entry in the mysql table for the field "stock_attributes". For the one added manually with no errors and works properly with dynamic dropdowns, the attributes are in the following order: attribute 1, attribute 2, attribute 3, attribute 4. For the ones added by "all" in each attribute the order is: attribute 2, attribute 3, attribute 1, attribute 4. If i manually edit the entry in the table to put attribute 1 first then it works again. So it seems that the function that is adding the attributes for all combinations is putting them in the wrong order. Is there a fix for this?
John
Ok so i see from another post the correction to the error I was getting. I removed the line and that works fine now. However I am still having problems with the attribute order while using the multiadd. The values are in the wrong order. I have the dynamic dropdown code also installed and when the values are in a different order the dropdowns don't work. Is there a way to make the multiadd put the attributes in the same order as a single add?
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+
Quote:
Originally Posted by
jsu1972
I'm kinda new to zencart and this addon but i think i know the answer to your question. while the attribute might be the same when you add it to a product it gets another id. you can find these id's in the "products_attributes" table. you'll see that the attribute has an ID and it has a new ID each time it's associated with a product.
Nope, that doesn't say what the new values will be on an individual product level.
I'd be really happy if I could even add, for example:
style - men's
size - small
color - green, red, blue, black, tan
like that all at once from the admin or otherwise. This mod is essential but it takes FOREVER if you have say a possible of 300 different combinations of attributes per product!
Again, in my case the actual stock is not important, just how it incorporates with dynamic drop downs to create dependent attributes is vital.
If anybody has any clues on how to speed up the process please post! I even but something in the commercial help but no luck so far. :(
Still...great mod though!
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+
Quote:
Originally Posted by
jsu1972
Ok so i see from another post the correction to the error I was getting. I removed the line and that works fine now. However I am still having problems with the attribute order while using the multiadd. The values are in the wrong order. I have the dynamic dropdown code also installed and when the values are in a different order the dropdowns don't work. Is there a way to make the multiadd put the attributes in the same order as a single add?
did you open and look at the table called "products_attributes". if you look in the table you will see the attributes for your products...in your post before the last one you asked if there is a mathmatical formula that correlates one set of attributes to another. there is no formula...there is this table. so to "predict" what the values should be, look in this table for the product_id you want...then find the option_id's for the options you want to add...and then you can lookup their product_attributes_id and put it in the stock_attributes column on the products_with_attributes_stock table.
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+
Quote:
Originally Posted by
jsu1972
did you open and look at the table called "products_attributes". if you look in the table you will see the attributes for your products...in your post before the last one you asked if there is a mathmatical formula that correlates one set of attributes to another. there is no formula...there is this table. so to "predict" what the values should be, look in this table for the product_id you want...then find the option_id's for the options you want to add...and then you can lookup their product_attributes_id and put it in the stock_attributes column on the products_with_attributes_stock table.
ok - now I see what your saying. :cool:
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+
Well let me take that back...It just doesn't seem to work for me like it should when I pick the attributes from that table. I can cleary identify them, write them in and wallah, there they are in the admin...but not on the product page. The stock_attributes numbers are different from product to product but not repesented that way on the product_attributes table. It seems when attributes are added to a different product, zen cart picks up where it left off so to speak. So if the largest value of an option was say 40 for my first product, the smallest value of an option would be 41 for my second product. Hope that made sense.
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+
So I've used this contrib before with ABSOLUTELY no issues.. However, I am working on a site that we are using the Super Orders contrib.. I haven't seen much specifically in this thread or the Super Orders support thread which talks about these two contribs together. So my question is this: can these two contribs play nice together? I am assuming they can with some edits to the orders.php and or super_orders.php files.. Some advice/information would be very much appreciated..