Zen Cart Logo
Forums / All Other Contributions/Addons / Stock by Attribute v4.0 addon for v1.3.5-1.3.9

Stock by Attribute v4.0 addon for v1.3.5-1.3.9

Views: 658,569

Results 1,841 to 1,860 of 3,609
25 Mar 2014, 1:43 AM
#1841
vibrantdesignz avatar

vibrantdesignz

New Zenner

Join Date:
Mar 2014
Posts:
8
Plugin Contributions:
0

Stock by Attribute v4.0 addon for v1.3.5-1.3.9

Hello. I am trying to figure out this SBA addon. My question is, say I have 3 pink shirts (S,M,L) and I have 1 of each size. These shirts have a monogram on them. Say I also am using these same 3 shirt for a different product that has a different monogram. Since these will be personalized I don't make them upfront.

HOW do I put the stock of these attributes when they are used on different products using the color attribute to define what is in stock.

25 Mar 2014, 7:45 AM
#1842
bn17311 avatar

bn17311

Zen Follower

Join Date:
Apr 2010
Posts:
319
Plugin Contributions:
0

Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9

vibrantdesignz:

Hello. I am trying to figure out this SBA addon. My question is, say I have 3 pink shirts (S,M,L) and I have 1 of each size. These shirts have a monogram on them. Say I also am using these same 3 shirt for a different product that has a different monogram. Since these will be personalized I don't make them upfront.

HOW do I put the stock of these attributes when they are used on different products using the color attribute to define what is in stock.

do you only have a few monograms or is this something you want to do over lots of products using the same 3 tshirts

bn

25 Mar 2014, 3:08 PM
#1843
vibrantdesignz avatar

vibrantdesignz

New Zenner

Join Date:
Mar 2014
Posts:
8
Plugin Contributions:
0

Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9

I mainly want to define the stock by the size and color. On adult shirts I have 2-3 products that use the same size/color shirts.

Product #1: Left chest monogram
Product #2: Applique/Pocket Monogram

Both listed products use the same size/color shirts.
The monogram part is just an addon for people to choose the variety of the shirt.

25 Mar 2014, 3:25 PM
#1844
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9

vibrantdesignz:

I mainly want to define the stock by the size and color. On adult shirts I have 2-3 products that use the same size/color shirts.

Product #1: Left chest monogram
Product #2: Applique/Pocket Monogram

Both listed products use the same size/color shirts.
The monogram part is just an addon for people to choose the variety of the shirt.

Is this a GENERIC stock pool to which an OPTIONAL applique/monogram can be applied?? You say that you have 2-3 products which use the same size/color combo.. Do you keep these size/color combos as unique counts separate or are they from the SAME pool of shirts..

Let try and clarify what I mean.. You have 20 large pink shirts in total. Are 10 allocated for one product and 10 allocated for another product with the ONLY difference between the two products being the applique/monogram??

Either way if I understand you correctly, are you saying that the applique/monogram is an OPTIONAL attribute and is not to be INCLUDED in the stock tracking..

25 Mar 2014, 5:05 PM
#1845
vibrantdesignz avatar

vibrantdesignz

New Zenner

Join Date:
Mar 2014
Posts:
8
Plugin Contributions:
0

Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9

The amount of shirts are the total shirts I have. I have 3 shirts in total that I want to use for both listings. Yes, the monogram/applique is an optional attribute.

25 Mar 2014, 8:13 PM
#1846
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9

vibrantdesignz:

The amount of shirts are the total shirts I have. I have 3 shirts in total that I want to use for both listings. Yes, the monogram/applique is an optional attribute.

That's what I thought you were getting at.. the short answer is you can't have TWO products sharing the SAME stock.. If you have 10 large pink t-shirts you can't SHARE them with two products..

SBA allows you to create product variants based on attribute combos. (color/size for example) you can then track stock for each variant.. So if you have two products which vary because of a logo or some other variance you will need to decide how many of your large pink t-shirts will be allocated to each product.

25 Mar 2014, 8:22 PM
#1847
vibrantdesignz avatar

vibrantdesignz

New Zenner

Join Date:
Mar 2014
Posts:
8
Plugin Contributions:
0

Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9

Okay. I thought that was probably the answer, but I wanted to double check. Thank you for you quick reply. I appreciate the help.

27 Mar 2014, 2:43 AM
#1848
coffeeowl avatar

coffeeowl

New Zenner

Join Date:
Dec 2005
Posts:
5
Plugin Contributions:
0

Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9

I took over the size that somebody else built and then disappeared. The site uses Zen Cart 1.5.0 and some old version of the Stock by Attribute addon. Its files have a date stamp of 10/16.12.

As of 3/2/14, stock numbers stopped updating when a product with an attribute is sold. The addon was working flawlessly before that. No changes were made to the site around that time, so my guess is something changed in the host environment. The host is GoDaddy, pretty unhelpful with the issue.

I want to update the addon to its latest version, but http://www.zen-cart.com/downloads.php?do=file&id=202 says the addon only works with Zen Cart 1.5.1.

Do I have to update Zen Cart in order to update the addon? I would rather not doing it right now because the previous designer left no documentation, and I am still wandering through the code figuring out what other addons were used, etc. I feel that without knowing what's under the hood I may break something else if I update Zen Cart to 1.5.1.

The stock problem can't wait until I am done, so I would rather update only Stock by Attributes right now. Is it safe? Or will I end up with a broken site?

The site in question is at http://southernwhimzy.com/.

27 Mar 2014, 3:05 AM
#1849
coffeeowl avatar

coffeeowl

New Zenner

Join Date:
Dec 2005
Posts:
5
Plugin Contributions:
0

Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9

Forgot to add: the Stock by Attributes addon currently in use has a string in its files like this one:

version $Id: products_with_attributes_stock.php 389 2008-11-14 16:02:14Z hugo13 $

I can't figure out what version it is, but maybe someone else knows.

2 Apr 2014, 8:16 PM
#1850
randolph_hoppe avatar

randolph_hoppe

Zen Follower

Join Date:
Jan 2004
Posts:
129
Plugin Contributions:
1

Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9

Attempting to install SBA 1.5.3 on my Z-C 1.5.1 install - at the end of a long upgrade from 1.3.8.a running SBA (probably) 4.7. After merging and uploading, I run the Full/Upgrade DB Install and receive an error.

Log reports:

PHP Fatal error: 1054:Unknown column 'sort' in 'products_with_attributes_stock' :: ALTER TABLE products_with_attributes_stock
ADD COLUMN customid VARCHAR(255) NULL DEFAULT NULL AFTER sort; in path/to/store/includes/classes/db/mysql/query_factory.php on line 120

Any thoughts or suggestions? I'm stumped.

2 Apr 2014, 8:38 PM
#1851
bn17311 avatar

bn17311

Zen Follower

Join Date:
Apr 2010
Posts:
319
Plugin Contributions:
0

Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9

did you look in your database to see does the sort column exist ?

looks like its wanting to add the customid after the sort column in that table

checking my database there is sort column then custom id column

bn

2 Apr 2014, 8:48 PM
#1852
bn17311 avatar

bn17311

Zen Follower

Join Date:
Apr 2010
Posts:
319
Plugin Contributions:
0

Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9

if you find sort column missing you could try the following in your admin -> install sql patches

remember backup as im no expert !!

ALTER TABLE products_with_attributes_stock ADD sort int(11) NOT NULL default 0 after quantity;

then run the stock by attributes install again

hope this helps
bn

3 Apr 2014, 1:13 PM
#1853
potteryhouse avatar

potteryhouse

Zen Follower

Join Date:
Jun 2012
Location:
Florida
Posts:
123
Plugin Contributions:
0

Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9

Randolph Hoppe:

Attempting to install SBA 1.5.3 on my Z-C 1.5.1 install - at the end of a long upgrade from 1.3.8.a running SBA (probably) 4.7. After merging and uploading, I run the Full/Upgrade DB Install and receive an error.

Log reports:

PHP Fatal error: 1054:Unknown column 'sort' in 'products_with_attributes_stock' :: ALTER TABLE products_with_attributes_stock
ADD COLUMN customid VARCHAR(255) NULL DEFAULT NULL AFTER sort; in path/to/store/includes/classes/db/mysql/query_factory.php on line 120

Any thoughts or suggestions? I'm stumped.

Looks like two lines in the installation script need to be swapped:
In the installation file on lines 416 and 417 re-order the lines:

		alterSBAtableCustomid();//Call function to Alter table products_with_attributes_stock to add customid
		alterSBAtabeSort();//Call function to Alter table products_with_attributes_stock sort field

to:

		alterSBAtabeSort();//Call function to Alter table products_with_attributes_stock sort field
		alterSBAtableCustomid();//Call function to Alter table products_with_attributes_stock to add customid
3 Apr 2014, 4:46 PM
#1854
randolph_hoppe avatar

randolph_hoppe

Zen Follower

Join Date:
Jan 2004
Posts:
129
Plugin Contributions:
1

Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9

Thanks, all. I think I'm good now!

10 Apr 2014, 5:58 AM
#1855
caborela avatar

caborela

New Zenner

Join Date:
Dec 2008
Posts:
36
Plugin Contributions:
0

Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9

Hi,

There is a field called stock_attributes in the table of products_with_attributes_stock.
There are some numbers in this field and I have no idea what they refer to.
Can someone please give me some clue?
Thanks in advance!

10 Apr 2014, 12:45 PM
#1856
potteryhouse avatar

potteryhouse

Zen Follower

Join Date:
Jun 2012
Location:
Florida
Posts:
123
Plugin Contributions:
0

Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9

caborela:

Hi,

There is a field called stock_attributes in the table of products_with_attributes_stock.
There are some numbers in this field and I have no idea what they refer to.
Can someone please give me some clue?
Thanks in advance!

Those are references to the products attributes, it is how the mod is able to trace the product ID to the applicable attribute.

The IDs are extracted (based on) a products attributes from the table "products_attributes" the IDs are from the field "products_attributes_id"
Note that if there are attribute combinations, than there will be two or more references there separated by comma.

This sample query (used only to help explain the example) may help you understand:
Here we do a SELECT query from three tables "products", "products_attributes", and Products_options".
The resultant IDs from the select query are than inserted into this mods new table "products_with_attributes_stock" into the applicable fields (products_id, stock_attributes, quantity).

INSERT INTO products_with_attributes_stock (products_id, stock_attributes, quantity)	
		SELECT p.products_id, pa.products_attributes_id, p.products_quantity
		FROM products p
			LEFT JOIN products_attributes pa ON (p.products_id = pa.products_id)
			LEFT JOIN products_options_values pv ON (pa.options_values_id = pv.products_options_values_id)
		WHERE pa.products_attributes_id is not null
			AND pa.options_values_id > 0
		ORDER BY p.products_id, pa.products_attributes_id
	
	ON DUPLICATE KEY UPDATE
		`products_id` = products_with_attributes_stock.products_id;

This is just an example query, for explanation of the new tables field data, you should never run query's you do not fully trust or understand or have not tested on a TEST system!

I hope this helped.

10 Apr 2014, 7:07 PM
#1857
caborela avatar

caborela

New Zenner

Join Date:
Dec 2008
Posts:
36
Plugin Contributions:
0

Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9

Thanks, potteryhouse! :laugh:

14 Apr 2014, 9:13 PM
#1858
christian_wagner avatar

christian_wagner

New Zenner

Join Date:
May 2013
Location:
Long Branch, NJ
Posts:
49
Plugin Contributions:
0

Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9

Hey all - running into a slight problem with SBA regarding products with multiple drop downs. Not sure how it needs to be properly set up in order to have the correct stock for each item (ie. "Black" in "Youth Large"). Right now it'll show certain items as being in stock even when they are sold out in the backend.

I set this up at the recommendation of our hosting company, GeekHost. For the record, they're absolutely amazing with what they do and even though this is not a module they made they've been super helpful with this problem. :D

For clarity, the product also has a "White" color on the product page. See pics for reference. Any help on this to optimize the backend would be greatly appreciated!

Attachment 13993
Attachment 13994

14 Apr 2014, 10:18 PM
#1859
potteryhouse avatar

potteryhouse

Zen Follower

Join Date:
Jun 2012
Location:
Florida
Posts:
123
Plugin Contributions:
0

Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9

Christian_Wagner:

Hey all - running into a slight problem with SBA regarding products with multiple drop downs. Not sure how it needs to be properly set up in order to have the correct stock for each item (ie. "Black" in "Youth Large"). Right now it'll show certain items as being in stock even when they are sold out in the backend. I set this up at the recommendation of our hosting company, GeekHost. For the record, they're absolutely amazing with what they do and even though this is not a module they made they've been super helpful with this problem. :D For clarity, the product also has a "White" color on the product page. See pics for reference. Any help on this to optimize the backend would be greatly appreciated! Attachment 13993 Attachment 13994
On just one product entry, for a test, I suggest you try removing (delete the SBA entry) for the Stock IDs 1487 to 1491, these are the single entry items, it looks to me like you need the attribute combinations, that will be left. Than set the quantities as you need and test. The mod looks at this table, first for combinations, than for single entries, to find stock available.

Just a suggestion.

14 Apr 2014, 10:23 PM
#1860
christian_wagner avatar

christian_wagner

New Zenner

Join Date:
May 2013
Location:
Long Branch, NJ
Posts:
49
Plugin Contributions:
0

Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9

potteryhouse:

On just one product entry, for a test, I suggest you try removing (delete the SBA entry) for the Stock IDs 1487 to 1491, these are the single entry items, it looks to me like you need the attribute combinations, that will be left. Than set the quantities as you need and test. The mod looks at this table, first for combinations, than for single entries, to find stock available.

Just a suggestion.

Unfortunately it tells me the product is out of stock :(. That's how we used to do it and when we upgraded to the new version it messed it up.