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

Results 2,161 to 2,180 of 3,609
30 Apr 2015, 12:33 PM
#2161
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

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

jeking:

That file is often modified by plugins. Merge it correctly and you'll be fine.

I would agree. This plugin modifies two lines of code in the file. The first collects information not collected in the base code after generation of the order's attribute_id, the second to pass that information on to an observer.

5 May 2015, 2:06 PM
#2162
simon1066 avatar

simon1066

Totally Zenned

Join Date:
Feb 2009
Location:
UK
Posts:
1,326
Plugin Contributions:
0

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

I think I need a bit of a sanity check with the install of this mod - I'm not even sure I'm posting in the right support thread.

Using SBA 1.5.3
Zen v1.5.1

I have a product with two attribute dropdowns

I select 'Giclée Print' from the first and 'Frame' from the second and add to cart

go back to the same product

and select 'Giclée Print' from the first and 'No Frame' from the second and add to cart

all works swimmingly - two items added to cart.

But, if I do the above in the opposite order i.e. 'No Frame' followed by 'Frame' I get an Out of Stock error on the 'Frame' item in the cart.

All my stock levels in SBA look ok. Does anything obvious stand out here?

6 May 2015, 7:16 AM
#2163
pompidompie avatar

pompidompie

Zen Follower

Join Date:
Mar 2015
Posts:
105
Plugin Contributions:
0

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

I have this little (big) problem.
When adding something to the shoppingcart, loggin and click the checkout button, it loops. It keeps refreshing the shoppingcart page, but won't go forward. I don't know what the problem is, but I have this small voice saying it could be something to do with this addon.

This is what chrome elements gives as an error:

Uncaught Reference 
Error: $ is not definedzcJS.ajax @ index.php?main_page=shopping_cart:38(anonymous function) @ index.php?main_page=shopping_cart:147 
jquery-1.11.1.min.js:4 Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check http://xhr.spec.whatwg.org/.  

And than the 3th line is line 38:

zcJS.ajax = function (options) {
  options.url = options.url.replace("&", unescape("&"));
      var deferred = $.Deferred(function (d) {
      var securityToken = 'b3a44e98ef6d02b0d4e901a53a237517';
      var defaults = {
          cache: false,
          type: 'POST',
          traditional: true,
          dataType: 'json',
          timeout: 5000,
          data: $.extend(true,{
            securityToken: securityToken
        }, options.data)
      },
      settings = $.extend(true, {}, defaults, options);

And the 1sth line is line 147:

zcJS.ajax({
    url: "ajax.php?act=ajaxPayment&method=setNoscriptCookie",
    data: {test: '1'},
    async: false
  }).done(function( response ) {

I don't know what this means :blush:

6 May 2015, 9:06 AM
#2164
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

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

Pompidompie:

I have this little (big) problem.
When adding something to the shoppingcart, loggin and click the checkout button, it loops. It keeps refreshing the shoppingcart page, but won't go forward. I don't know what the problem is, but I have this small voice saying it could be something to do with this addon.

This is what chrome elements gives as an error:

Uncaught Reference
Error: $ is not definedzcJS.ajax @ index.php?main_page=shopping_cart:38(anonymous function) @ index.php?main_page=shopping_cart:147
jquery-1.11.1.min.js:4 Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check http://xhr.spec.whatwg.org/.

> 
> And than the 3th line is line 38:
> ```php
zcJS.ajax = function (options) {
  options.url = options.url.replace("&", unescape("&"));
      var deferred = $.Deferred(function (d) {
      var securityToken = 'b3a44e98ef6d02b0d4e901a53a237517';
      var defaults = {
          cache: false,
          type: 'POST',
          traditional: true,
          dataType: 'json',
          timeout: 5000,
          data: $.extend(true,{
            securityToken: securityToken
        }, options.data)
      },
      settings = $.extend(true, {}, defaults, options);

And the 1sth line is line 147:

zcJS.ajax({
url: "ajax.php?act=ajaxPayment&method=setNoscriptCookie",
data: {test: '1'},
async: false
}).done(function( response ) {

> 
> I don't know what this means :blush:

There are several factors not yet explored.

1) Please try a different browser.
2) Does this happen with product not tracked by SBA?
3) Does this happen when temporarily using the default/classic template?
4) Does the item that is in the cart have stock?
5) Is this a test site and are you able to login with or without stock in the cart while using your current template? Does this change when temporarily using the ZC classic template?
6 May 2015, 9:06 AM
#2165
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

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

Pompidompie:

I have this little (big) problem.
When adding something to the shoppingcart, loggin and click the checkout button, it loops. It keeps refreshing the shoppingcart page, but won't go forward. I don't know what the problem is, but I have this small voice saying it could be something to do with this addon.

This is what chrome elements gives as an error:

Uncaught Reference
Error: $ is not definedzcJS.ajax @ index.php?main_page=shopping_cart:38(anonymous function) @ index.php?main_page=shopping_cart:147
jquery-1.11.1.min.js:4 Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check http://xhr.spec.whatwg.org/.

> 
> And than the 3th line is line 38:
> ```php
zcJS.ajax = function (options) {
  options.url = options.url.replace("&", unescape("&"));
      var deferred = $.Deferred(function (d) {
      var securityToken = 'b3a44e98ef6d02b0d4e901a53a237517';
      var defaults = {
          cache: false,
          type: 'POST',
          traditional: true,
          dataType: 'json',
          timeout: 5000,
          data: $.extend(true,{
            securityToken: securityToken
        }, options.data)
      },
      settings = $.extend(true, {}, defaults, options);

And the 1sth line is line 147:

zcJS.ajax({
url: "ajax.php?act=ajaxPayment&method=setNoscriptCookie",
data: {test: '1'},
async: false
}).done(function( response ) {

> 
> I don't know what this means :blush:

There are several factors not yet explored.

1) Please try a different browser.
2) Does this happen with product not tracked by SBA?
3) Does this happen when temporarily using the default/classic template?
4) Does the item that is in the cart have stock?
5) Is this a test site and are you able to login with or without stock in the cart while using your current template? Does this change when temporarily using the ZC classic template?
7 May 2015, 10:02 AM
#2166
oldtoot avatar

oldtoot

New Zenner

Join Date:
Oct 2011
Posts:
8
Plugin Contributions:
0

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

Zen Cart v.1.5.4
SBA v 1.5.3

Hello - I have not been able to find the answer in the thread so far, so I thought I'd ask here so (hopefully) at least someone can confirm the answer is in here somewhere?

SBA appears to be installed correctly, but when you order ZC is using the total stock to see if the item is in stock.

For example - Widget#1 comes as either Red or Blue.

If the stock is set to Red = 5, Blue = 1

It will not say out of stock if you order 6 Red (because there are 6 widgets - but obviously not 6 red ones, hence the issue)
Similarly, if you order 2 Blue and 5 Red it will say they are both out of stock (because you've ordered 7 in total, and there are only 6 in stock, although the order for Red is in stock)

If someone could point me in the right direction that would be great. Thank you.

7 May 2015, 10:48 AM
#2167
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

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

OldToot:

Zen Cart v.1.5.4
SBA v 1.5.3

Hello - I have not been able to find the answer in the thread so far, so I thought I'd ask here so (hopefully) at least someone can confirm the answer is in here somewhere?

SBA appears to be installed correctly, but when you order ZC is using the total stock to see if the item is in stock.

For example - Widget#1 comes as either Red or Blue.

If the stock is set to Red = 5, Blue = 1

It will not say out of stock if you order 6 Red (because there are 6 widgets - but obviously not 6 red ones, hence the issue)
Similarly, if you order 2 Blue and 5 Red it will say they are both out of stock (because you've ordered 7 in total, and there are only 6 in stock, although the order for Red is in stock)

If someone could point me in the right direction that would be great. Thank you.

Congratulations on merging SBA 1.5.3. With ZC 1.5.4;however, that version was written for ZC 1.5.1. There is version 1.5.4 thatiscompatible with ZC 1.5.3and ZC 1.5.4 available at https://github.com/potteryhouse/stock_by_attribute_1.5.4/tree/mc12345678_ZC154

That version should resolve your issue.

10 May 2015, 12:45 PM
#2168
buildingblocks avatar

buildingblocks

Totally Zenned

Join Date:
Jun 2008
Posts:
629
Plugin Contributions:
0

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

Hi

Is Stock by Attributes - Version: 1.5.3 also compatible with zen cart version 1.5.0?

thanks

10 May 2015, 1:36 PM
#2169
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

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

buildingblocks:

Hi

Is Stock by Attributes - Version: 1.5.3 also compatible with zen cart version 1.5.0?

thanks

Generally, the best way to confirm "compatibility" is to compare the code changes as well as to test. I haven't tested against ZC 1.5.0 and I do not know if potteryhouse, jeking or others have so at this point I can only speak from having done upgrades and worked with both versions of ZC. It seems to me that it should work as well on 1.5.0 as it does on 1.5.1.

16 May 2015, 4:27 PM
#2170
olga avatar

olga

New Zenner

Join Date:
May 2013
Posts:
8
Plugin Contributions:
0

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

Hello,
I am using zencart 1.5.1, and have encountered several issues and would really appreciate any help.
My clothes store has Tshirts with S,M,L sizes. If all sizes are in stock everything works fine.
However, if only 1 size is available, and I hit "Sync Quantities", all sizes show up with the same number. Here 1 only have small size:
https://www.clothes4mom.ca/index.php?main_page=product_info&cPath=1&products_id=4

For another one there are 2 sizes (S,M) with L=0; however it shows as a sum on the page: (L should be zero, but instead it is S+M)
https://www.clothes4mom.ca/index.php?main_page=product_info&cPath=1&products_id=5

16 May 2015, 5:18 PM
#2171
olga avatar

olga

New Zenner

Join Date:
May 2013
Posts:
8
Plugin Contributions:
0

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

ok, I just figured that one needs to initialize the attributes with non zero values, and then change them to 0.

16 May 2015, 5:23 PM
#2172
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

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

Olga:

Hello,
I am using zencart 1.5.1, and have encountered several issues and would really appreciate any help.
My clothes store has Tshirts with S,M,L sizes. If all sizes are in stock everything works fine.
However, if only 1 size is available, and I hit "Sync Quantities", all sizes show up with the same number. Here 1 only have small size:
https://www.clothes4mom.ca/index.php?main_page=product_info&cPath=1&products_id=4

For another one there are 2 sizes (S,M) with L=0; however it shows as a sum on the page: (L should be zero, but instead it is S+M)
https://www.clothes4mom.ca/index.php?main_page=product_info&cPath=1&products_id=5

Is the value also entered for the large as zero, or has large been removed from the table?

16 May 2015, 5:24 PM
#2173
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

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

Olga:

ok, I just figured that one needs to initialize the attributes with non zero values, and then change them to 0.

True still for ZC 1.5.1, but it has been repaired when using ZC1.5.3 and above.

17 May 2015, 12:48 AM
#2174
buildingblocks avatar

buildingblocks

Totally Zenned

Join Date:
Jun 2008
Posts:
629
Plugin Contributions:
0

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

mc12345678:

Generally, the best way to confirm "compatibility" is to compare the code changes as well as to test. I haven't tested against ZC 1.5.0 and I do not know if potteryhouse, jeking or others have so at this point I can only speak from having done upgrades and worked with both versions of ZC. It seems to me that it should work as well on 1.5.0 as it does on 1.5.1.

I set up a test 1.5.0 cart and merged the SBA v1.5.3 code into the stock 1.5.0 files. I set up a couple of products using the picture frame product example in the SBA instructions. The product displayed the individual attribute quantities on the store front product page as expected. With the testing I've done so far the module seems to be working fine except for this next thing I want to ask about. I thought I had come across someone asking about the quantity not displaying correctly. I searched around and can't find the post.

On the module download page it says

" For example, if you offered cotton or polyester shirts in green, red or blue and small medium or large sizes, this add-on would allow you to enter and maintain a separate stock level for each of the 18 possible combinations"

I set up a product using this scenario

material
cotton
polyester

color
green
blue
red

size
small
medium
large

In catalog > products with attributes stock, I set up the Quantity For Product Variant using 'all - attributes - combo' for the size, color and material and added a quantity. Then I adjusted the quantities for each variant and clicked the save button. Next I clicked the sync link. The total in stock synced to 119.

In the storefront on the product page each variant shows a quantity of 119 instead of the quantity showing in admin for each variant.

Is there a way to make it show the correct quantity for each variant or is that not going to happen because there are more options making it more complex?

18 May 2015, 8:38 PM
#2175
batracy avatar

batracy

New Zenner

Join Date:
Jun 2012
Posts:
57
Plugin Contributions:
1

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

buildingblocks:

I set up a test 1.5.0 cart and merged the SBA v1.5.3 code into the stock 1.5.0 files. I set up a couple of products using the picture frame product example in the SBA instructions. The product displayed the individual attribute quantities on the store front product page as expected. With the testing I've done so far the module seems to be working fine except for this next thing I want to ask about. I thought I had come across someone asking about the quantity not displaying correctly. I searched around and can't find the post.

On the module download page it says

" For example, if you offered cotton or polyester shirts in green, red or blue and small medium or large sizes, this add-on would allow you to enter and maintain a separate stock level for each of the 18 possible combinations"

I set up a product using this scenario

material
cotton
polyester

color
green
blue
red

size
small
medium
large

In catalog > products with attributes stock, I set up the Quantity For Product Variant using 'all - attributes - combo' for the size, color and material and added a quantity. Then I adjusted the quantities for each variant and clicked the save button. Next I clicked the sync link. The total in stock synced to 119.

In the storefront on the product page each variant shows a quantity of 119 instead of the quantity showing in admin for each variant.

Is there a way to make it show the correct quantity for each variant or is that not going to happen because there are more options making it more complex?

When you sync the variants quantities to the product quantity, what shows is the sum of all variants as the quantity available at the product level. Since all variants are part of the same product, there is really no way to show a specific variant quantity in the storefront without doing some recoding is my understanding. However, when placing a variant into the cart (and if you have check stock turned on), the quantity of the variant is used to determine the stock available. So you will not over sell what you don't have.

Hope that helps.

19 May 2015, 3:23 AM
#2176
buildingblocks avatar

buildingblocks

Totally Zenned

Join Date:
Jun 2008
Posts:
629
Plugin Contributions:
0

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

thanks batracy

19 May 2015, 10:28 AM
#2177
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

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

buildingblocks:

I set up a test 1.5.0 cart and merged the SBA v1.5.3 code into the stock 1.5.0 files. I set up a couple of products using the picture frame product example in the SBA instructions. The product displayed the individual attribute quantities on the store front product page as expected. With the testing I've done so far the module seems to be working fine except for this next thing I want to ask about. I thought I had come across someone asking about the quantity not displaying correctly. I searched around and can't find the post.

On the module download page it says

" For example, if you offered cotton or polyester shirts in green, red or blue and small medium or large sizes, this add-on would allow you to enter and maintain a separate stock level for each of the 18 possible combinations"

I set up a product using this scenario

material
cotton
polyester

color
green
blue
red

size
small
medium
large

In catalog > products with attributes stock, I set up the Quantity For Product Variant using 'all - attributes - combo' for the size, color and material and added a quantity. Then I adjusted the quantities for each variant and clicked the save button. Next I clicked the sync link. The total in stock synced to 119.

In the storefront on the product page each variant shows a quantity of 119 instead of the quantity showing in admin for each variant.

Is there a way to make it show the correct quantity for each variant or is that not going to happen because there are more options making it more complex?

Boy, do I feel dense. It took a long time to realize/understand the scenario described.

The deeper reason for the quantity remaining display issue here using: SBA 1.5.3 which is designed for ZC 1.5.1 and appears to work with ZC 1.5.0, is that once 2 or more attributes are presented, determining what constitutes a combination at which to display the available quantity? This eventually is addressed in one option of Dynamic Dropdowns which apparently was developed several years ago specifically for SBA.

The solution that has become accepted by most is a next option sequenced by previous option dropdown style. First selection is made, then the available second selection is presented. Second to third, etc... That plugin is incorporated into SBA 1.5.4 and is expected to be. incorporated into SBA 1.5.3 soon.

At any rate, the functionality of the modifications made to Dynmic Dropdowns in support of this version of SBA includes identifying possible variants that are out-of-stock, quantity remaining of variants identified at the last option in the list or the first option that has a child with no available quantity, whichever comes first.

There are a few other benefits incorporated, one of which is that in times past when using DD, without recoding, the entire store had to have SBA tracked quantities if anything had an attribute. While possibly convenient and necessary for some stores, not every store needs to track the amount of product that has say an option to download or email an attachment.

There are additional improvements in store as well including image changes based on selection of sub-attributes leading to full product selection.

19 May 2015, 10:01 PM
#2178
jagall avatar

jagall

Zen Follower

Join Date:
Mar 2011
Location:
Ireland
Posts:
286
Plugin Contributions:
0

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

hi guys

I downloaded the versionf rom github for zc1.5.4 but and I am ftping files slowly, but once i transfer the two files in admin/auto loaders, the admin site crashes any ideas?

thanks

19 May 2015, 10:27 PM
#2179
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

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

jagall:

hi guys

I downloaded the versionf rom github for zc1.5.4 but and I am ftping files slowly, but once i transfer the two files in admin/auto loaders, the admin site crashes any ideas?

thanks

Would have better ideas if the generated error messages were provided. (Sorry, forgot to include the where: check the logs folder of your site.). Also if it were explained at what point of transferring files to the site were those files transferred. Are those the only two files transferred, or for some reson the last two files?

20 May 2015, 10:20 AM
#2180
mattys avatar

mattys

Zen Follower

Join Date:
Sep 2006
Location:
North Devon, England, UK
Posts:
289
Plugin Contributions:
0

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

not sure if this the same/similar issue to jagall's, but i have merged/uploaded files for stock_by_attribute_1.5.4-mc12345678_ZC154, using zen cart 1.5.3, and i cant access admin, i am getting below error:

[20-May-2015 10:14:30 UTC] PHP Fatal error: Class 'products_with_attributes_stock_admin' not found in /var/www/vhosts/jarbon.com/httpdocs/dev/includes/autoload_func.php on line 79