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

Results 1,181 to 1,200 of 3,609
08 Jun 2011, 17:19
#1181
athena avatar

athena

Totally Zenned

Join Date:
Jan 2006
Location:
NM
Posts:
740
Plugin Contributions:
0

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

One tell is to put several items in your cart that have attributes and one that does not and see how they behave when you change the quantities...do they add up?

As I said, my experience was the item without an attribute, when in the cart under an item with attributes that registered "0" automatically calculated "0" for the non attribute item even though they were in stock.

08 Jun 2011, 18:51
#1182
ccqccq avatar

ccqccq

New Zenner

Join Date:
Jun 2011
Posts:
4
Plugin Contributions:
0

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

Ok, I decided to do a bare bones reinstall of ZenCart 1.3.9h and SBA 1.4.13. It went quickly and smoothly, and from what I can tell, everything works out of the box.

I tested a bunch of different carts, quantities, and scenarios, and they seemed to work totally as advertised. :smile:

Now for the bad news: Athena, I also specifically tested your scenario:
--Added quantity 1 of item A, size small (attrib)
--Added quantity 2 of item A, size med (attrib)
--Added quantity 4 of item B, no attrib
--Adjusted quantity of item A up high to some number which was not in stock

At that point, anything below the sold out item (item A in this case), whether or not it had an attribute, showed as sold out. So, it's a bug where the sold out cascades down the cart. I do believe it is independent of attributes. So, I concur with you that there's a bug in the current distro of SBA and I will go and try your fix.

HTH,
---Chris

athena:

One tell is to put several items in your cart that have attributes and one that does not and see how they behave when you change the quantities...do they add up?

As I said, my experience was the item without an attribute, when in the cart under an item with attributes that registered "0" automatically calculated "0" for the non attribute item even though they were in stock.

08 Jun 2011, 19:04
#1183
ccqccq avatar

ccqccq

New Zenner

Join Date:
Jun 2011
Posts:
4
Plugin Contributions:
0

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

And I just installed Athena's fix (using the older /includes/modules/pages/shopping_cart/header_php.php) and that seem to fix the scenario I tested above without any bad effects.

Cheers,
--Chris

08 Jun 2011, 19:12
#1184
athena avatar

athena

Totally Zenned

Join Date:
Jan 2006
Location:
NM
Posts:
740
Plugin Contributions:
0

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

Yeah! I'm not c-r-a-z-y!

But still would like it to work....now that you have that fix in....does everything work? I've noticed a problem with searching for a product to edit in the SBA window.

12 Jun 2011, 01:06
#1185
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 am getting a similar problem to athena I think.

If I add a product to the cart with attributes it is out of stock regardless of the stock qty. (this is using zen 1.3.9h and version 1.4.13 of SBA)
I have tried an older version as athena described of the the includes/modules/pages/shopping_cart/header_php.php file. in this case the following occurs
If I have one product in the cart which is either in or out of stock all is fine the product is flag correctly in the cart . if I add a product in stock and the original product in the cart is in stock then all is well. But add an out of stock product to the cart and all products go out of stock in the cart.

Has this issue been solved for the latest version (apologies if I missed it but I could not see a fix in the thread)

Athena, what version did you go back to to get yours to work?

Thanks

Mikeyg

12 Jun 2011, 02:14
#1186
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

athena,

I found your code and have tried it. But this still does not work for me.

As soon as there is a product that goes in the cart which is out of stock all items are flag as out of stock even if they had been in the cart and flag as in stock correctly.

Some one must have this working correctly this seems such a fundimental requirement.

13 Jun 2011, 07:30
#1187
tombooth01 avatar

tombooth01

New Zenner

Join Date:
Feb 2011
Posts:
3
Plugin Contributions:
0

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

I have an issue where out of stock attributes do not show as out of stock until the checkout stage rather than appearing as OUT OF STOCK in the dropdown list on the product page.

I`ve spent most of last week going through the code to see where the issue was and whether it was actually coded to perform that way - the functionality (to add OUT OF STOCK to the attribute's drop down) appears to be there but just not working for me.

The product in question is 'Frill Scarf' and the attribute is 'Test Colour' (http://www.jessamy-designs.co.uk/shop/index.php?main_page=product_info&cPath=2&products_id=3). Whilst the Product Quantity is set to '99' the Quantity In Stock (as set by the Catalog -> Products With Attribute Stock page) for the attribute is 0 so I would expect that OUT OF STOCK would be appended in the dropdown for that attribute?

Any help would be much appreciated...

I`m running ZC v1.3.9h with SBA v1.4.13 and my site is http://www.jessamy-designs.co.uk. My Configuration -> Stock settings are as follows: Check Stock Levels: True | Subtract Stock: False | Allow Checkout: False | Mark Product Out Of Stock: ***

13 Jun 2011, 13:21
#1188
athena avatar

athena

Totally Zenned

Join Date:
Jan 2006
Location:
NM
Posts:
740
Plugin Contributions:
0

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

MikeyG:

athena,

I found your code and have tried it. But this still does not work for me.

As soon as there is a product that goes in the cart which is out of stock all items are flag as out of stock even if they had been in the cart and flag as in stock correctly.

Some one must have this working correctly this seems such a fundimental requirement.

It may be that you need to actually delete the original file off the server and then reload the new code. On our server I notice that there is a lag time. They explained that there are two connections to our site (in our case, but may also be with yours) and it takes time to propagate, much like DNS info does.

Substituting the version in my previous post with the file from .13 has worked for many here. Wish I knew why.

Thanks for posting. I'm hoping someone will take this on. I PM the person who uploaded the latest version and was scolded in a weird way. Won't go that route again.

13 Jun 2011, 13:25
#1189
athena avatar

athena

Totally Zenned

Join Date:
Jan 2006
Location:
NM
Posts:
740
Plugin Contributions:
0

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

tombooth01:

I have an issue where out of stock attributes do not show as out of stock until the checkout stage rather than appearing as OUT OF STOCK in the dropdown list on the product page.

I`ve spent most of last week going through the code to see where the issue was and whether it was actually coded to perform that way - the functionality (to add OUT OF STOCK to the attribute's drop down) appears to be there but just not working for me.

The product in question is 'Frill Scarf' and the attribute is 'Test Colour' (http://www.jessamy-designs.co.uk/shop/index.php?main_page=product_info&cPath=2&products_id=3). Whilst the Product Quantity is set to '99' the Quantity In Stock (as set by the Catalog -> Products With Attribute Stock page) for the attribute is 0 so I would expect that OUT OF STOCK would be appended in the dropdown for that attribute?

Any help would be much appreciated...

I`m running ZC v1.3.9h with SBA v1.4.13 and my site is http://www.jessamy-designs.co.uk. My Configuration -> Stock settings are as follows: Check Stock Levels: True | Subtract Stock: False | Allow Checkout: False | Mark Product Out Of Stock: ***

I don't think it was designed to eliminate the choices of out of stock items. Someone here played with a fix that worked for them but I haven't tried it.

You need to at least replace the file mentioned above for stock levels to calculate properly.

The original newest edition of the mod is faulty without it.

The only problem I have now is in the admin. It is temperamental when doing a search to update a product quantity.

13 Jun 2011, 22:37
#1190
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

athena,

thank you for your reply. I am testing locally at the moment so I don't the issue was time lag, but I went back through to your previous post - either in this thread or another and copied the code again. It seems to be working for me now. I must admit I was going to post the link for others again but in coming back to it seem to have lost the exact thread/post. I will post it for others if I find it again.

I must admit I compared the files and can't work out why it does or does not work.

Just to pick up on your post quoting tombooth01 - I have been looking for the code to get it to show out of stock in the drop down(does not have to delete the option just flag it as out of stock) but I could not see that functionality.

Is it really there or do you no what has been suggested to make it work?

I have come up with a solution using the grid attribute mod but rather than have boxes I have replaced them with ticks and crosses. You still need the drop downs to select product to get it in the cart. I have seen a site that has this with boxes and you can select the tick and it puts it in the cart. - If anyone has that it would be good. or if anyone can show the stock in the drop down that would be good too.

Thanks again for you help.

14 Jun 2011, 08:27
#1191
tombooth01 avatar

tombooth01

New Zenner

Join Date:
Feb 2011
Posts:
3
Plugin Contributions:
0

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

MikeyG:

Just to pick up on your post quoting tombooth01 - I have been looking for the code to get it to show out of stock in the drop down(does not have to delete the option just flag it as out of stock) but I could not see that functionality.

Is it really there or do you no what has been suggested to make it work?

Yes, the functionality appears to be there.

In trying to get this to work I spent some time going through the code and the functionality to specifically append the phrase 'OUT OF STOCK' to option names seems to exist in the _build_attributes_combinations() function within /shop/includes/classes/pad_base.php:

          if (!$is_out_of_stock | ($showoos == true)) {
            switch ($markoos) {
              case 'Left':   $newtext=($is_out_of_stock ? TEXT_OUT_OF_STOCK.' - ' : '').substr($newtext,2);
                             break;
              case 'Right':  $newtext=substr($newtext,2).($is_out_of_stock ? ' - '.TEXT_OUT_OF_STOCK : '');
                             break;
              default:       $newtext=substr($newtext,2);
                             break;
            }

After a week I gave up and decided to see if anyone on here had managed to get it to work.

It did appear to nearly work (i.e it appended OOS to the correct options in the $combinations array but it appears the actual dropdown is populated by the $attributes array) but I became stuck as I`m new to Zencart.

14 Jun 2011, 14:08
#1192
athena avatar

athena

Totally Zenned

Join Date:
Jan 2006
Location:
NM
Posts:
740
Plugin Contributions:
0

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

Here is a link to a post in a thread called only: "Stock By Attributes" rather than this thread called: "Stock by Attribute v4.0 for Zen Cart 1.3.5+"

I think some of us have gotten lost in there but this post is significant - I just haven't had time to try it yet:

location: Post by limelites

limelites:

Ahaaaaaaa, figured this one out guys!!

For anyone else having a problem with this issue, just look at re-installing the files that shipped with the stock_by_attributes mod.

I've just cured my problems by overwriting /includes/classes/order.php with the order.php from "stock_by_attributes_4-7MULTIADD mod"

Somehow some other mod had corrupted the data that updates the "Quantity in Stock" in ADMIN>CATALOG>PRODUCTS WITH ATTRIBUTES".

It is now updating the Quantity in Stock Column with each sale. All working perfectly now.

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:

$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
$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;
14 Jun 2011, 18:04
#1193
tombooth01 avatar

tombooth01

New Zenner

Join Date:
Feb 2011
Posts:
3
Plugin Contributions:
0

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

athena:

Here is a link to a post in a thread called only: "Stock By Attributes" rather than this thread called: "Stock by Attribute v4.0 for Zen Cart 1.3.5+"

I think some of us have gotten lost in there but this post is significant - I just haven't had time to try it yet:

location: Post by limelites

I had come across that previously in my investigations but when I tried to implement it made no difference. I`ve just tried it again and nothing changes.

Has no-one else had this issue (out of stock options appearing in the dropdown) with this addon (stock by attributes)?

14 Jun 2011, 23:11
#1194
divaboutiques avatar

divaboutiques

Zen Follower

Join Date:
Feb 2007
Location:
Worldwide Web
Posts:
191
Plugin Contributions:
0

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

I installed the stock by attribute mod, but for some reason it's not showing the attribute for people to pick there size Example:

I have a dress with the sizes: Small, Medium & Large, but on the product page I'm not able to pick the sizes.

How can I correct this issue?

17 Jun 2011, 11:23
#1195
staycu avatar

staycu

New Zenner

Join Date:
Jun 2011
Posts:
31
Plugin Contributions:
0

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

divaboutiques:

I installed the stock by attribute mod, but for some reason it's not showing the attribute for people to pick there size Example:

I have a dress with the sizes: Small, Medium & Large, but on the product page I'm not able to pick the sizes.

How can I correct this issue?

Same problem here.
I installed stock_by_attributes_1.4.13
I want to know please how to put an table on each product page for my customers to choose the width, color, height ?

To know what i`m talking about, here I put an picture with the table that I want to add : http://s3.postimage.org/62uwm416x/image.jpg

Many thanks fot thoose who helping me!

17 Jun 2011, 12:33
#1196
delia avatar

delia

Totally Zenned

Join Date:
May 2006
Location:
Gardiner, Maine
Posts:
2,383
Plugin Contributions:
7

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

Installed 1.4.13 and resynced quantities and it took the stock quantities of the main product to zero throughout the entire cart. If you have used this version and not had any problems with the quantity sync please let me know! If this is typical of this version, it has a major problem!

I checked the entire install to make sure the files are the correct ones and the database is okay.

One other oddity is that there is a save button on the page - that has no function and wasn't there in the last version I used.

The only improvement I see is that the shopping cart now shows the quantity numbers next to the product. That was my only problem with this mod before and I think the last version I used was 1.4.10.

Right now I'm just trying to get a working version of this installed for a client on their sites. Which version?

17 Jun 2011, 14:51
#1197
ferid avatar

ferid

New Zenner

Join Date:
Jun 2005
Posts:
65
Plugin Contributions:
0

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

Just updated from 4.7 to 4.13.
But now I get the following error when I try to access SBA:

1054 Unknown column 'sort' in 'order clause'
in:
[select * from products_with_attributes_stock where products_id="530" order by sort ASC;]
If you were entering information, press the BACK button in your browser and re-check the information you had entered to be sure you left no blank fields.

In the webshop the attributes still show.
Running ZC 1.3.8a

17 Jun 2011, 14:59
#1198
ferid avatar

ferid

New Zenner

Join Date:
Jun 2005
Posts:
65
Plugin Contributions:
0

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

ferid:

Just updated from 4.7 to 4.13.
But now I get the following error when I try to access SBA:

1054 Unknown column 'sort' in 'order clause'
in:
[select * from products_with_attributes_stock where products_id="530" order by sort ASC;]
If you were entering information, press the BACK button in your browser and re-check the information you had entered to be sure you left no blank fields.

In the webshop the attributes still show.
Running ZC 1.3.8a

When I click sort, I get the error:

1054 Unknown column 'sort' in 'field list'
in:
[UPDATE products_with_attributes_stock set sort = '0' WHERE stock_id = '152' LIMIT 1;]
If you were entering information, press the BACK button in your browser and re-check the information you had entered to be sure you left no blank fields.

I havn't made any changes to the database. Only copied the files.

17 Jun 2011, 15:11
#1199
delia avatar

delia

Totally Zenned

Join Date:
May 2006
Location:
Gardiner, Maine
Posts:
2,383
Plugin Contributions:
7

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

There are 2 separate sql updates if you are coming from that old a version. One is included in the package and the other is to add the sort feature to the attributes table. That update is in version 4.1.11 which I haven't downloaded.

17 Jun 2011, 16:40
#1200
ferid avatar

ferid

New Zenner

Join Date:
Jun 2005
Posts:
65
Plugin Contributions:
0

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

delia:

There are 2 separate sql updates if you are coming from that old a version. One is included in the package and the other is to add the sort feature to the attributes table. That update is in version 4.1.11 which I haven't downloaded.

Thank you for your reply.
Bot the 4.1.11 and .13 contain the same sql update: update_1_4_10.sql. I need to run this sql? Because I understood from the readme I only had to replace the files and no sql update. But maybe I didn't read it correctly..