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

Results 2,621 to 2,640 of 3,609
22 Aug 2016, 4:55 PM
#2621
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

stellarweb:

Your recommended changes did the trick!!! WHOO HOO!! Thank you so much!! :hug:

Glad that helped... I've applied yet another updated version which added a few and statements to ensure that Read Only and Grid related attributes are not effected by this change as they are treated in other and different ways elsewhere generally speaking.

23 Aug 2016, 2:31 AM
#2622
soxophoneplayer avatar

soxophoneplayer

Totally Zenned

Join Date:
Feb 2008
Posts:
534
Plugin Contributions:
0

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

I'm updating SbyA with the most recent github files (downloaded today, Aug 22 2016) and I threw in the change in the autoinstall from a few posts back.

I am currently using zc 1.5.5a and ResponsiveSheffiledBlue adapted to 1.5.5a with changes suggested by rbarbour, drB and others.

There are two files: admin/incl/init_incl/initzc154compatability and admin/autoinstallers/config154compatability.

Do I/should I keep those two files, or remove - ie are they applicable only to 1.5.4 or "1.5.4 and later"

23 Aug 2016, 3:02 AM
#2623
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

soxophoneplayer:

I'm updating SbyA with the most recent github files (downloaded today, Aug 22 2016) and I threw in the change in the autoinstall from a few posts back.

I am currently using zc 1.5.5a and ResponsiveSheffiledBlue adapted to 1.5.5a with changes suggested by rbarbour, drB and others.

There are two files: admin/incl/init_incl/initzc154compatability and admin/autoinstallers/config154compatability.

Do I/should I keep those two files, or remove - ie are they applicable only to 1.5.4 or "1.5.4 and later"
Actually, neither. :) they are to provide compatibility of older ZC versions to work (at least in part) with software written for plugins to be compatible with ZC 1.5.4 and higherto less than ZC 1.5. that use functionality that was added in ZC 1.5.4 (admin database change logging). In other words, they are non-essential for plugins running on ZC 1.5.4 and above and can be safely removed from a store that includes all of the functionality of an existing ZC 1.5.4 store (or higher).

11 Sep 2016, 3:09 PM
#2624
jeking avatar

jeking

Totally Zenned

Join Date:
Oct 2005
Location:
Chicago, IL USA
Posts:
1,592
Plugin Contributions:
0

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

I've got SBA Version 1.5.4 for Zen Cart Version 1.5.4 and it's been running fine for months.

Today, I've added a downloadable product but can't add it to the shopping cart. I get 'Your shopping cart is empty'. Error log says:

PHP Warning: Missing argument 1 for queryFactoryResult::__construct(), called in /home/ACCOUNT_NAME/public_html/includes/templates/herbally/templates/tpl_modules_attributes.php on line 28 and defined in /home/ACCOUNT_NAME/public_html/includes/classes/db/mysql/query_factory.php on line 550

I've checked the product is set-up correctly for a downloadable product.
I was a little unclear if the option value needed to get set to Read Only or not, so tried both.

11 Sep 2016, 5:47 PM
#2625
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

jeking:

I've got SBA Version 1.5.4 for Zen Cart Version 1.5.4 and it's been running fine for months.

Today, I've added a downloadable product but can't add it to the shopping cart. I get 'Your shopping cart is empty'. Error log says:

PHP Warning: Missing argument 1 for queryFactoryResult::__construct(), called in /home/ACCOUNT_NAME/public_html/includes/templates/herbally/templates/tpl_modules_attributes.php on line 28 and defined in /home/ACCOUNT_NAME/public_html/includes/classes/db/mysql/query_factory.php on line 550

I've checked the product is set-up correctly for a downloadable product.
I was a little unclear if the option value needed to get set to Read Only or not, so tried both.

Suggest trying one of the updated versions of the file which can be found in the main install. The file in question is as reported: includes/templates/YOUR_TEMPLATE/templates/tpl_modules_attributes.php. That file was updated in April of this year to address that particular error. At least as things appear in the history for that file and that line number... Though not entirely sure how that error plays into the adding of the product to the cart. Further, think would need more information about how things are setup in order to advise further on a downloadable only product, especially with having an older version of the file(s).

11 Sep 2016, 6:55 PM
#2626
jeking avatar

jeking

Totally Zenned

Join Date:
Oct 2005
Location:
Chicago, IL USA
Posts:
1,592
Plugin Contributions:
0

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

I had been using the more recent version from the ZC 1.5.4 series. I tried the 1.5.5 version but same problem.

Attached are how I've got the product set-up.

My confusion is this is not an SBA attribute, so it should just ignore it. I feel like I missing something that expresses this.

Attachment 16645
Attachment 16646
Attachment 16647

11 Sep 2016, 8:23 PM
#2627
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

jeking:

I had been using the more recent version from the ZC 1.5.4 series. I tried the 1.5.5 version but same problem.

Attached are how I've got the product set-up.

My confusion is this is not an SBA attribute, so it should just ignore it. I feel like I missing something that expresses this.

Attachment 16645
Attachment 16646
Attachment 16647
Well, I would actually say that something else is installed that is interfering.

Reason is, the error shown on the previous post at line 28 of includes/templates/YOUR_TEMPLATE/templates/tpl_modules_attributes.php for the version of the file between April and about June of this year began passing the database credentials for generation of the queryfactoryresult class variable. This only became necessary in ZC 1.5.5 because of changes made to includes/classes/db/mysql/query_factory.php. In previous versions of ZC, that variable was not needed, and in fact if it was passed to the function, would be ignored by a default install because it would be an excess parameter that is/was not handled by ZC and therefore would not cause a problem. If though, that zc file were replaced by some other plugin, the additional variable may become necessary and if the template file of the current set was used, it would attempt to pass it properly and not through an error.

That said and as questioned, the line 28 code would only be run if the product for any of many different reasons was not to be displayed as a SBA tracked product, one that matters specifically to adding the product to the shopping cart is whether the products_id is listed at all in the products_with_attributes_stock table (all such entries appear in the admin control screen for SBA under the catalog dropdown).

Now, the other thing, which was an issue with ZC 1.5.4, is that there are error messages not pushed to the screen when there is a problem with adding product to the cart. Unfortunately I don't recall the specific work around that was necessary, but it may be addressed in the known issues with ZC 1.5.4. I do know that Ajeh had weighed in on the matter in one of the past/previous threads.

Beyond that, SBA doesn't evaluate any of the settings shown in the previous images in relation to non-SBA tracked product (products_id not identified in the PWAS table), so the issue would not specifically be with SBA processing, but instead something else that has been done/installed and that a file modified by SBA is showing the result of that other change.

It is something I have wanted to remove so that code like what is found on your version of the template file is no longer "necessary" as it was added at one point to make the file "easier" to follow and require less alternate/additional code. Now it just seems to complicate modification and be seen as the reason for some other mistake unrelated to SBA.

12 Sep 2016, 4:22 PM
#2628
jeking avatar

jeking

Totally Zenned

Join Date:
Oct 2005
Location:
Chicago, IL USA
Posts:
1,592
Plugin Contributions:
0

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

While I was using SBA Version 1.5.4, it was an older version of that version. It was one of the early versions from GitHub. I've updated the installed version to the current one from GitHub and problem solved. I never bothered to update it as everything was working fine. You know, "if it ain't broke, don't fix it". Hope it helps someone else.

12 Sep 2016, 6:11 PM
#2629
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

jeking:

While I was using SBA Version 1.5.4, it was an older version of that version. It was one of the early versions from GitHub. I've updated the installed version to the current one from GitHub and problem solved. I never bothered to update it as everything was working fine. You know, "if it ain't broke, don't fix it". Hope it helps someone else.

Well, glad that the updated version is functioning as intended/expected.

14 Sep 2016, 7:11 PM
#2630
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

I'm sorry if this has been asked already, but I'm getting duplication of attribute options on the frontend. Not sure why this is happening. I attached some images for you to check out. It also says GREY with any size is out of stock which is not how I have it set up. Let me know if anything is set up wrong. Running ZC 1.5.4. Thanks!

Attachment 16660
Attachment 16661
Attachment 16662

14 Sep 2016, 7:33 PM
#2631
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

That type of duplication was seen with the version that was provided for download in the plugins area, but is corrected in the version discussed over the last several pages and is to make its way to the plugins once a few other improvements are made to expand its functionality and interoperation with other "typical" software.

Anyways, suggestion is to apply the software available at https://github.com/mc12345678/Stock_By_Attributes_Combined. The files in the includes and admin directories should be applied first (merged as applicable), then to go into the sub-folder for your version of ZC and the files/changes also applied/merged with your template.

14 Sep 2016, 7:46 PM
#2632
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

mc12345678:

That type of duplication was seen with the version that was provided for download in the plugins area, but is corrected in the version discussed over the last several pages and is to make its way to the plugins once a few other improvements are made to expand its functionality and interoperation with other "typical" software.

Anyways, suggestion is to apply the software available at https://github.com/mc12345678/Stock_By_Attributes_Combined. The files in the includes and admin directories should be applied first (merged as applicable), then to go into the sub-folder for your version of ZC and the files/changes also applied/merged with your template.

Thank you so so much! I'm sorry I asked a question already addressed.

14 Sep 2016, 7:53 PM
#2633
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

Christian_Wagner:

Thank you so so much! I'm sorry I asked a question already addressed.

Well, actually it was a problem identified when trying to further it's use in more recent ZC versions and maintain operability of multiple option names such as you have setup. There are a number of other improvements made since that time as well. Not so sure that the particular issue would have been easy to find in the thread.

If anything, might have suggested reading through these last couple of pages to get an idea of the status of the software and what is going on to keep it accessible to those that wish to use it. :) the images were informative to at least identify my suspicions that it was occurring because of use of the older version(s).

Besides, if don't ask a question, may not ever find an answer. :)

16 Sep 2016, 4:38 PM
#2634
jeking avatar

jeking

Totally Zenned

Join Date:
Oct 2005
Location:
Chicago, IL USA
Posts:
1,592
Plugin Contributions:
0

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

Quick question, I've upgraded a site to the current version of this plug-in which solved some issues. Out of Stock attributes are identified as such in the drop down but are still selectable. Is having them grayed out and not selectable a setting I'm missing?

16 Sep 2016, 4:58 PM
#2635
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

jeking:

Quick question, I've upgraded a site to the current version of this plug-in which solved some issues. Out of Stock attributes are identified as such in the drop down but are still selectable. Is having them grayed out and not selectable a setting I'm missing?
Difficult to answer without more information: product attributes, one option name or more than one, dynamic dropdowns enabled only for multiple attributes? What are the first three stock settings? Is it allowed for one to checkout with product being out of stock? If you were to say that the designation of out-of-stock wasn't present, then would suggest verifying the option name type.

16 Sep 2016, 5:22 PM
#2636
jeking avatar

jeking

Totally Zenned

Join Date:
Oct 2005
Location:
Chicago, IL USA
Posts:
1,592
Plugin Contributions:
0

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

mc12345678:

Difficult to answer without more information: product attributes, one option name or more than one, dynamic dropdowns enabled only for multiple attributes? What are the first three stock settings? Is it allowed for one to checkout with product being out of stock? If you were to say that the designation of out-of-stock wasn't present, then would suggest verifying the option name type.

You can't read what I'm thinking? Probably better than way....

Product has a single attribute, size.
dynamic dropdowns enabled only for multiple attributes: yes.
Check stock level: true
Subtract stock: true
Allow Checkout: false

The option is listed at out of stock, so I can select it, but cannot add it to the cart successfully. I get an empty cart. So the issue is just the missing disabled="disabled" on the attribute option.

I see this referenced it two files:
\includes\classes\observers\class.products_with_attributes_stock.php
\includes\modules\YOUR_TEMPLATE\attributes.php

and confirmed the correct and current version is on the server.

16 Sep 2016, 6:52 PM
#2637
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

jeking:

You can't read what I'm thinking? Probably better than way....

Product has a single attribute, size.
dynamic dropdowns enabled only for multiple attributes: yes.
Check stock level: true
Subtract stock: true
Allow Checkout: false

The option is listed at out of stock, so I can select it, but cannot add it to the cart successfully. I get an empty cart. So the issue is just the missing disabled="disabled" on the attribute option.

I see this referenced it two files:
\includes\classes\observers\class.products_with_attributes_stock.php
\includes\modules\YOUR_TEMPLATE\attributes.php

and confirmed the correct and current version is on the server.
Well, those settings should result in an out-of-stock product being disabled if using the SBA select list as the option name type for that product.

In a search of the github repo the use of disabled was also found in includes/templates/YOUR_TEMPLATE/jscript/jscript.form.js, though at the moment I'm not sure of the interaction of that script with the observed issue.

Haven't had a moment (though plan to later) but is this item either at the beginning or end of the list, do things change if more than one is made to go out-of-stock (quantity of 0)?

16 Sep 2016, 7:02 PM
#2638
jeking avatar

jeking

Totally Zenned

Join Date:
Oct 2005
Location:
Chicago, IL USA
Posts:
1,592
Plugin Contributions:
0

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

mc12345678:

Well, those settings should result in an out-of-stock product being disabled if using the SBA select list as the option name type for that product.

In a search of the github repo the use of disabled was also found in includes/templates/YOUR_TEMPLATE/jscript/jscript.form.js, though at the moment I'm not sure of the interaction of that script with the observed issue.

Haven't had a moment (though plan to later) but is this item either at the beginning or end of the list, do things change if more than one is made to go out-of-stock (quantity of 0)?

And that's what I missed, changing theOption Type to SBA Select List (Dropdown) Basic. All good now, thanks!

16 Sep 2016, 7:17 PM
#2639
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

jeking:

And that's what I missed, changing theOption Type to SBA Select List (Dropdown) Basic. All good now, thanks!
Welcome. That's a whistle planned to be added to the admin stock populating side once a separate, but related aspect is addressed with making the data fields easier to programmatically identify and manipulate. Don't want to start writing in extra options that will have to be recoded and cause issues with cut/paste/replace, etc...

18 Sep 2016, 6:39 PM
#2640
lindsey80 avatar

lindsey80

New Zenner

Join Date:
Apr 2010
Location:
Essex, UK
Posts:
77
Plugin Contributions:
0

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

Hello,

I downloaded this mod and it messed up my admin I just had a blank page. I put all the folders where they should go... I replaced the files with my backup and admin is now fine, My problem is now when I view an item that has an attribute on my site I get the following error WARNING: An Error occurred, please refresh the page and try again. Does anyone know why this is happening?

Thanks