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,352

Results 1 to 20 of 3,609
25 Sep 2006, 09:48
#1
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

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

This is the support thread for the updated Stock by Attributes add-on for Zen Cart 1.3.5. If you are using an version of Zen Cart prior to 1.3.5 then you will need to upgrade before you can use this add-on.

The add-on can be downloaded from here.

There is also a Wiki with more information about the add-on. You can find the Wiki here.

To put this add-on in context, it is a stop gap. This feature is scheduled to be added to the next major release of Zen Cart, and probably in a rather more integrated way than is appropriate for an add-on such as this. Furthermore the add-on from which this was adapted has a major flaw in its table structure, which I am sure the Zen Cart team will not replicate.

So I have no desire to add extra functionality that will probably have a very short shelf life, may not be included in the Zen Cart solution anyway and might make future conversion to the differently structured and more integrated Zen Cart version more complex. So please don't post requests for new functionality in this support thread.

However, if you are having problems installing or using the add-on or think that there are errors / bugs in it, then your posts will be welcome.

25 Sep 2006, 22:06
#2
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

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

I guess I should never have referred to v4.0, as just a few hours later, v4.1 has been released. This is a minor bug fix release that incorporates two Zen Cart 1.3.5 bug fixes, removes a diagnostic line and makes a syntactic correction to the SQL file.

26 Sep 2006, 01:25
#3
mikeyg avatar

mikeyg

Totally Zenned

Join Date:
May 2005
Posts:
515
Plugin Contributions:
0

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

-removed as I have fixed issue and was being daft -

Thanks

MG

26 Sep 2006, 02:07
#4
mikeyg avatar

mikeyg

Totally Zenned

Join Date:
May 2005
Posts:
515
Plugin Contributions:
0

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

I have been testing this further and I have issue with the maths.

If I have sizes small, medium, large and stock of 1 of each and some one buys 2 of medium the stock by attributes will tell me that I have 1 in stock in total. But I have 2 in stock (one large and one small)

So mathmatically 1+1+(-1)=1 but reality 1+1+(-1)=2

can this be fixed - do people want it to be fixed? ie top line tells you total in stock. Variant lines tell you the exact stock for each one.

Logic if I have this right would mean that if I have any positive stock add them up and tell me (ignoring any negatives). If I have all 0 or negative stock added them up and report all as a negative or as 0.

Also a bit of a wish list - is it possible to work out all variants and add them to the database so only the qty has to be added. I know some have asked for a quicker way of entering the data.

Thanks

MG

15 Oct 2006, 10:27
#5
trollboy avatar

trollboy

New Zenner

Join Date:
Oct 2006
Posts:
5
Plugin Contributions:
0

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

I just installed this mod and have the following problem.
When "Add Quantity for Product Variant" I can select the varant from the drop down menus of attributes OK, but then when the variant is listed as
Stock ID Variant Quantity in Stock etc
all the variant are just listed as ":".
Presumably this column is supposed to show the value of the attribute.

Now I have no way of telling which variant is which,

Any ideas?

15 Oct 2006, 16:11
#6
buzzville avatar

buzzville

New Zenner

Join Date:
May 2006
Posts:
87
Plugin Contributions:
0

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

I installed this mod a couple of days ago to my test site and it was working just fine, but after some wrestling with some other issues on the site it is now not working. When I try to apply the sql patch in admin, I get the following error:

1062 Duplicate entry 'STOCK_SHOW_LOW_IN_CART' for key 2
in:
[INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('Show stock when low', 'STOCK_SHOW_LOW_IN_CART', 'false', 'When customer places more items in cart than are available, show the available amount on the shopping cart page:', '9', '6', NULL, now(), NULL, "zen_cfg_select_option(array('true', 'false')," );]

I'm thinking this is probably why it's not working, but I'm just not savvy enough to know what I need to do to get it working again. Can someone help guide me?

TIA!

15 Oct 2006, 16:39
#7
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

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

MikeyG:

If I have sizes small, medium, large and stock of 1 of each and some one buys 2 of medium the stock by attributes will tell me that I have 1 in stock in total. But I have 2 in stock (one large and one small)That's a good point. This logic works in for Zen Cart's normal stock control where negative values indictate back orders but not for variants when the variant stock gets offset. Sadly this probably won't be fixed in Stock by Attributes, but will hopefully be taken into consideration when the function is absorded into Zen Cart's core code.

trollboy:

I just installed this mod and have the following problem.
When "Add Quantity for Product Variant" I can select the varant from the drop down menus of attributes OK, but then when the variant is listed as
Stock ID Variant Quantity in Stock etc
all the variant are just listed as ":".This problem is not unique to this this version. It has just surfaced in the mod from which which this one was derived. I have located the problem and am working on a fix. Watch this space.

buzzville:

I installed this mod a couple of days ago to my test site and it was working just fine, but after some wrestling with some other issues on the site it is now not working. When I try to apply the sql patch in admin, I get the following error:

1062 Duplicate entry 'STOCK_SHOW_LOW_IN_CART' for key 2
in:
[INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('Show stock when low', 'STOCK_SHOW_LOW_IN_CART', 'false', 'When customer places more items in cart than are available, show the available amount on the shopping cart page:', '9', '6', NULL, now(), NULL, "zen_cfg_select_option(array('true', 'false')," );]This error is most likely because you are trying to run the patch a second time and MySQL is kicking up a fuss because you're trying to ram data that must be unique into the database for a second time. So it's unlikely to explain why the mod's not working for you. To hazard a guess at that would require something more specific than "after some wrestling with some other issues on the site it is now not working" :wink2:

15 Oct 2006, 18:15
#8
buzzville avatar

buzzville

New Zenner

Join Date:
May 2006
Posts:
87
Plugin Contributions:
0

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

kuroi:

This error is most likely because you are trying to run the patch a second time and MySQL is kicking up a fuss because you're trying to ram data that must be unique into the database for a second time. So it's unlikely to explain why the mod's not working for you. To hazard a guess at that would require something more specific than "after some wrestling with some other issues on the site it is now not working" :wink2:

Ok, fair enough! The mod was working nicely before I imported my database into my test site (with test products). I had some issues importing my database into the install of 1.3.5 on my test site. Once it was finally imported to the test site I also had to rename all of the database tables to remove the "zen" prefix that was still present in my "live" database. Renaming all the tables got everything working again on the test site, but the mod doesn't appear to be working fully. I get the insufficient stock warning, but it doesn't show the remaining stock quantity so that customers know how to adjust the contents of their cart.

Is it something in the tpl_shopping_cart_default.php file? This is what I found in what I thought was the relevant section of the file:

<?php if ((STOCK_SHOW_LOW_IN_CART == 'true') && $product['flagStockCheck']) {
         echo '<span class="alert bold">';
         echo PWA_STOCK_AVAILABLE;
				 echo ((isset($product['stockAvailable'])) ? $product['stockAvailable']: 0);
         echo '</span>';
			}?>

Does this help at all? Thanks so much for the help!

15 Oct 2006, 18:22
#9
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

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

buzzville:

I get the insufficient stock warning, but it doesn't show the remaining stock quantity so that customers know how to adjust the contents of their cart.

Is it something in the tpl_shopping_cart_default.php file?You've found the right bit of code, but hopefully your solution will be much more straightforward. I suspect that your problem may be no more than that whilst wrestling your site back under control your Admin > Stock > "Show stock when low" flag has been reset to false (fingers crossed)

15 Oct 2006, 18:43
#10
buzzville avatar

buzzville

New Zenner

Join Date:
May 2006
Posts:
87
Plugin Contributions:
0

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

Yes! Thank you! I hadn't thought to re-check there, but that seems to be exactly what happened. Now the remaining stock is showing! Thanks so much for this much needed addition! :D

15 Oct 2006, 19:53
#11
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

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

trollboy:

I just installed this mod and have the following problem.
When "Add Quantity for Product Variant" I can select the varant from the drop down menus of attributes OK, but then when the variant is listed as
Stock ID Variant Quantity in Stock etc
all the variant are just listed as ":".
Presumably this column is supposed to show the value of the attribute.

Now I have no way of telling which variant is which,

Any ideas?There is a fix for this in a maintenance release 4.2 of this mod awaiting approval from the Zen Cart team. I'm afraid that you will need to delete out the corrupted variants and re-enter them as the details that don't appear on your screen won't be in your database either. To upgrade simply replace all the files in the old mod with those in this version. It's a one-to-one match.

18 Oct 2006, 21:33
#12
blake06 avatar

blake06

New Zenner

Join Date:
Oct 2006
Posts:
3
Plugin Contributions:
0

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

Hello,

I installed the Stock by Attribute module, but I have a question about how it works. I have a situation where I have products with a couple attributes that affect the stock, and a couple of attributes that do not affect stock. For example, color and size affect stock, but monogram style and monogram text do not.

I would like to be able to control the stock for the different combinations of color and size, ignoring the monogramming options.

Is this possible with this module?

When I click the "add a product variant" link, it makes me choose a value for each attribute. Is there a way to just choose the attributes that you want to affect stock?

Thanks!

18 Oct 2006, 23:52
#13
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

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

blake06:

I have a situation where I have products with a couple attributes that affect the stock, and a couple of attributes that do not affect stock. For example, color and size affect stock, but monogram style and monogram text do not.

I would like to be able to control the stock for the different combinations of color and size, ignoring the monogramming options.

Is this possible with this module?

When I click the "add a product variant" link, it makes me choose a value for each attribute. Is there a way to just choose the attributes that you want to affect stock?Hi Blake

Firstly you should find that the monogram text presents no problem. As it a text field you should find that the drop down menu presents only one option and so can be safely ignored. Unsightly yes, extra work, not really.

The monogram style question however, is much more significant. I now call this the gift wrapping question. It crops up in an amazing varied number of ways and situations: gift wrapping, bow color, container type, ring setting, frame type, etc. - all basically where one or more attributes are somehow independent of the main product. There is an archive thread (discussion starts from post 199) that offers a workable solution. However, there are no plans to include this in the current mod, though it will hopefully be considered for inclusion into the next major release of Zen Cart along with attribute stocks generally.

19 Oct 2006, 00:07
#14
neo314 avatar

neo314

New Zenner

Join Date:
Sep 2006
Posts:
10
Plugin Contributions:
0

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

I am just learning to use/mod zen cart, so this may be an obvious or previously discussed option, but I have not seen it in my readings.

The idea may not work for all "Gift Wrap" problems, but is it possible to create a product which does not show up in the catalog, but is offerred to the customer before check out, maybe even offered only for certain products?

I'm still figuring out how to configure the store at a basic level, but wouldn't an option like the one I describe allow you to only have stock relevant attributes, and offer gift wrapping as a separate product at $0.00.

If the offer could be tied to only certain items, it would even work for something like monograms being offered for shirts, but not other products.

Just a thought...

Steven


After posting, I looked at the downloads and I wonder if Cross Sell under the marketing add ons could server this purpose...

19 Oct 2006, 01:54
#15
blake06 avatar

blake06

New Zenner

Join Date:
Oct 2006
Posts:
3
Plugin Contributions:
0

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

kuroi,

Thanks for the link. I'll probably end up taking a similar approach to what was suggested on that thread.

19 Oct 2006, 08:27
#16
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

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

neo314:

The idea may not work for all "Gift Wrap" problems, but is it possible to create a product which does not show up in the catalog, but is offerred to the customer before check out, maybe even offered only for certain products?

I'm still figuring out how to configure the store at a basic level, but wouldn't an option like the one I describe allow you to only have stock relevant attributes, and offer gift wrapping as a separate product at $0.00.

If the offer could be tied to only certain items, it would even work for something like monograms being offered for shirts, but not other products.

... I wonder if Cross Sell under the marketing add ons could server this purposeSteven, that's an excellent suggestion, since it more accurately reflects what is happening in many of these situations. That's to say, the extra is, at time of sale, a separate product or service with its own or unlimited stock (even if like monogramming it becomes an intrinsic part of the product prior to delivery).

It wouldn't work in all cases, e.g. ring settings couldn't easily be presented separately from the gems being sold, but it would work in most.

I'm not personally familar with Cross Sell so I don't know how easily it could be adapted, but I'm sure that there are other subscribers to this thread who are and who will hopefully jump in to extend this idea.

Welcome to Zen Cart.

24 Oct 2006, 21:30
#17
trollboy avatar

trollboy

New Zenner

Join Date:
Oct 2006
Posts:
5
Plugin Contributions:
0

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

I have some products for which I was to keep track of stock by attributes,
and some for which I want to keep track of total stock regardless of attributes.
Is it possible to decide which products should appear in the stock by attributes list?
I have installed the mod and all my products with attributes appear there.
If don't put in numbers for product variants then it treats my total stock as zero.

Do I have to either keep track of the stock of all products via attrabutes or none, or can I mix and match?

27 Oct 2006, 02:19
#18
goshawk avatar

goshawk

Zen Follower

Join Date:
Aug 2006
Location:
Kihikihi, New Zealand
Posts:
220
Plugin Contributions:
2

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

I have just noticed that this module is not substracting my stock level when I have received an order. My settings in admin are:

Check stock level true
Subtract stock true
Allow Checkout false

I am not sure when this has stopped working, as before the 1.3.5 release of ZenCart it worked fine. And have upgraded to 'stock_by_attributes_4.2' when I noticed that no attributes were displayed with the older version after upgrade.

I also have noticed that I have 2 entries of 'products by attributes stock' in my manager under the catalog entry.

What can I do to fix it?

Kind regards,

Goshawk

27 Oct 2006, 16:47
#19
gerda avatar

gerda

New Zenner

Join Date:
Oct 2006
Posts:
3
Plugin Contributions:
0

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

I have installed this twice and after inserting many attributes stock, both were not working anymore. Suddenly the page can`t show and I am not able to insert no more attributes stock. Do you have any idea about that.

Gerda

28 Oct 2006, 22:30
#20
mrmarcus66 avatar

mrmarcus66

Zen Follower

Join Date:
Oct 2004
Location:
England
Posts:
109
Plugin Contributions:
0

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

I am looking for solutions for a friend of mine who wants to list property on a website for people to rent. I wondered if this stock by attribute would allow you to list a property and use availability attributes to allow people to select a set of dates.

My question made simple is does this mod allow you to setup availability of attributes?

Regards
Mark.