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

Results 2,221 to 2,240 of 3,609
11 Jun 2015, 12:15 AM
#2221
tronage avatar

tronage

New Zenner

Join Date:
May 2015
Posts:
32
Plugin Contributions:
0

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

mc12345678:

I'm going to try to take a look at what it takes to accomodate that option...
Well remember I was only using single line because sba sequenced was giving me that popup issue, so I switched to what "worked"... ideally I'd like the sequenced dropdowns you suggest. I'm going to install your update tonight. To be sure, I should download the 1.5.4-master version you linked, upload that to my site, and then run the script you posted within zen cart to accomplish the upgrade correct? If it does tame the pop-up then I'll be back on the sba sequenced dropdowns.

11 Jun 2015, 1:28 AM
#2222
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

tronage:

Well remember I was only using single line because sba sequenced was giving me that popup issue, so I switched to what "worked"... ideally I'd like the sequenced dropdowns you suggest. I'm going to install your update tonight. To be sure, I should download the 1.5.4-master version you linked, upload that to my site, and then run the script you posted within zen cart to accomplish the upgrade correct? If it does tame the pop-up then I'll be back on the sba sequenced dropdowns.

This time, I believe every condition was tested to a minimum that seemed more than sufficient, though I'm sure there are/could be some weird variation of quantities not tested... Anyways, used zero stock and modified the various switch settings to each combination. Actually may have something that will support Read Only attributes soon, but have a few other things to work out on this and other items.

Anyways yes, since this version of SBA has already been installed, the only database modification is the addition of the new Dynamic Dropdowns switch. Otherwise, there were a few files updated to address the new/corrected feature.

11 Jun 2015, 3:52 AM
#2223
tronage avatar

tronage

New Zenner

Join Date:
May 2015
Posts:
32
Plugin Contributions:
0

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

Wow,
ok it is sooooooo close I can taste it....
Everything now is almost working great, switched to the SBA sequenced dropdown, and suppressed the js popup (love having that menu option there now!).

On my multiple attribute items, the first drop down works fine. But the 2nd in the series only shows 1 option (the first value as per the sort order for that attribute). For example:
And item has Color: Black / White and Size: Small (with a sort order 10 in the option values manager) / Large (with a sort order of 20 in the option values manager).
When you view the item, The first drop gives both choices black or white. no matter which color I pick, the 2nd drop will only say small. (and I have all set to zero inventory, and show out of stock attributes to true, and all of the option types are set to SBA Select List (Dropdown) Basic). This happens for all my multiple attribute items.

As a sidenote, aside from only listing the 1st value of the 2nd attribute in the sequence, when I add to cart, it does now show the correct SBA ID, etc. so I'm very supper excited for that!!!

Any ideas? If it aids in tracking it down, when I turn off dynamic dropdowns, all works perfect on the multiple attribute items: the 2nd drop has all the options, it adds to cart, and it puts the sba id there, etc.

And I'm sure I've not said it enough, but I am TOTALY grateful for your patients helping me to get this up and running!

11 Jun 2015, 4:32 AM
#2224
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

I have found that to happen if there are formatting issues with the page, like an extra { or } or </td><tr> or other html tags that end up affecting the layout of the output.

Suggest using html validation to review the page and see what it may find. :)

11 Jun 2015, 4:44 AM
#2225
tronage avatar

tronage

New Zenner

Join Date:
May 2015
Posts:
32
Plugin Contributions:
0

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

Sent you a pm with a link, let me know if any of that is useful...

11 Jun 2015, 12:30 PM
#2226
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

tronage:

Sent you a pm with a link, let me know if any of that is useful...

It was and yes there are validation errors that are affecting the display of the dropdowns, primarily unbalanced </div> tags. Haven't had an opportunity to dig into the specific page code, but one thing that seemed to jump out (and reltively easy to fix) was the sequence of tags that follow display of a few of the images where the </a> tag is applied "too early".

While not caused by this plugin, the following would be a process that could be used to sort this out.

  1. Have the page validated by an html validator.
  2. Based on the line number and column number, view the source of the web page being validated and locate the content.
  3. From there identify the area of the code that produces the content displayed to correct the identified issue.
  4. Recommend reperforming the above steps until the error(s) are resolved. Warnings would be good to address as well, but are less significant issues.

Ideally before applying plugins that include javascript or for that matter change the display of information the pge should be validated so that such issues can be identified, corrected, and the cause of not displaying can be determined.

11 Jun 2015, 4:45 PM
#2227
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

is there any way to disable or hide the 'Qty: ' which appears in attribute drop downs when the latest version of stock by attributes is installed (zencart 1.5.3)?

11 Jun 2015, 4:49 PM
#2228
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

mattys:

is there any way to disable or hide the 'Qty: ' which appears in attribute drop downs when the latest version of stock by attributes is installed (zencart 1.5.3)?

See the settings in the stock section of the configuration menu.

12 Jun 2015, 1:02 AM
#2229
tronage avatar

tronage

New Zenner

Join Date:
May 2015
Posts:
32
Plugin Contributions:
0

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

mc12345678:

It was and yes there are validation errors that are affecting the display of the dropdowns, primarily unbalanced </div> tags. Haven't had an opportunity to dig into the specific page code, but one thing that seemed to jump out (and reltively easy to fix) was the sequence of tags that follow display of a few of the images where the </a> tag is applied "too early".

While not caused by this plugin, the following would be a process that could be used to sort this out.

  1. Have the page validated by an html validator.
  2. Based on the line number and column number, view the source of the web page being validated and locate the content.
  3. From there identify the area of the code that produces the content displayed to correct the identified issue.
  4. Recommend reperforming the above steps until the error(s) are resolved. Warnings would be good to address as well, but are less significant issues.

Ideally before applying plugins that include javascript or for that matter change the display of information the pge should be validated so that such issues can be identified, corrected, and the cause of not displaying can be determined.

I appreciate all your help getting everything to the state it is in. Unfortunately the method you describe (while I understand the process) would be beyond the scope of my knowledge. A "faster" way was I knew the handful of addons I have installed couldn't be to blame (UPS, USPS, PayPal, CKeditor, and SBA). So I figured it must be the template. Changed to the "Classic Contemporary Green" and the drops worked.

I know nothing about php or css or js... So making my own fix for this unique situation (SBA+Winchester_black) to get the two to play nice is beyond me, nor do I expect the template author to figure out my problem since it is quite a specialized situation (probably unique to me). So for now I'll just turn the dynamic off, while maybe I seek out a different responsive template that has that all black "glam" feel to it. Or maybe there will be a new version of Winchester_black that she releases that may fix the issue in the future.

Again thanks for all your help and I'm very pleased to have this addon, and can't imagine trying to run zen-cart without it... I have no idea how other shop owners actually manage stock, and such when you have anything with attributes in your store, this makes things so much easier once setup. And if you ever do figure anything semi-specific that I could relay to the template author that would make both play nice, let me know. That would be awesome.
You got a donate setup anywhere? I'd like to at least buy ya a beer/coffee :cheers:! You have been most helpful!

12 Jun 2015, 2:23 AM
#2230
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

If you provide Anne with enough information about the situation, I'm sure she would be happy to help identify where the issue is. Even if not her, someone onthat forum probably has already resolved it. One thing to sort of close the loop is to see if the same errors appear with the DD off as when it is on. Afterall, just wanting the template to validate. :)

Glad to know though that otherwise it works and without the input about the issue, wouldn't have fixed it otherwise. Thank you for finding that.

Oh, and as a side note, signatures below one's post tend to contain related website information. :)

14 Jun 2015, 11:34 AM
#2231
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

FWIW, I've updated the code to support the single dropdown option being used across single and multiple attribute options including keeping the customid. I may have found on SBA 1.5.3 for ZC 1.5.1 that in the sba_sequenced_dropdowns that there might have been an extra displayed } in the javascript. I've removed it from the uploaded file so it may resolve an issues seen previously, it may cause it. :) Let me know if this caused an issue. May need to run through the install again on a clean system to see any negative effects.

Also, almost have a general use of READONLY attributes incorporated for say sequenced dropdowns so that their info will still be displayed and in the sequence desired, just not interfering with the remaining operation. :) I say almost, though there is still a bit of work to do and some general testing.

16 Jun 2015, 5:52 PM
#2232
tronage avatar

tronage

New Zenner

Join Date:
May 2015
Posts:
32
Plugin Contributions:
0

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

Quick Question:
I'm still trying to resolve the issue with the Winchester_Black template and the 2nd attribute only showing one value. In an effort to fix it, I'm comparing a fresh download of the template with my server files. And I've found two files:
Includes/templates/winchester_black/templates/
tpl_modules_main_product_image.php
tpl_shopping_cart_default.php

That are VERY different (not so much different as more each has parts the other doesn't). Since I've uploaded SBA after winchester_black, if there was an overwrite it would be the SBA file.

So my question is the above files right now I'm using the SBA versions? And maybe I need to be using the Winchester_black? or merge the two? Let me know your thoughts.

16 Jun 2015, 6:13 PM
#2233
picaflor_azul avatar

picaflor_azul

Totally Zenned

Join Date:
Jul 2009
Location:
picaflor-azul.com
Posts:
6,940
Plugin Contributions:
28

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

tronage:

Quick Question:
I'm still trying to resolve the issue with the Winchester_Black template and the 2nd attribute only showing one value. In an effort to fix it, I'm comparing a fresh download of the template with my server files. And I've found two files:
Includes/templates/winchester_black/templates/
tpl_modules_main_product_image.php
tpl_shopping_cart_default.php

That are VERY different (not so much different as more each has parts the other doesn't). Since I've uploaded SBA after winchester_black, if there was an overwrite it would be the SBA file.

So my question is the above files right now I'm using the SBA versions? And maybe I need to be using the Winchester_black? or merge the two? Let me know your thoughts.

If the files in the plugin and the template are the same then you need to merge them.

Thanks,

Anne

16 Jun 2015, 6:17 PM
#2234
tronage avatar

tronage

New Zenner

Join Date:
May 2015
Posts:
32
Plugin Contributions:
0

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

UPDATE:

Anne has been a huge help, however her most recent post points back to SBA being issue with my 2nd attribute only showing one value:
https://www.zen-cart.com/showthread.php?216242-Winchester-Black-Responsive-Template&p=1284771#post1284771

If you go back one page in her thread, she posted a link to a "working" version (and I tested and verified it worked) But when she changed her settings to how I have mine, and set the stock to zero it broke it. And when using the default template (as the link currently shows here: http://weblyweb.com/sba/index.php?main_page=product_info&cPath=1_17&products_id=180) it is broke in identically the same way as I'm experiencing. And she said this was a fresh install of everything.

As a "test" I did not change what options I had set for dynamic dropdowns. I picked an item with two attributes, and added stock to all the combinations. sync'ed the quantities, and reloaded the live site. Issue still remained. So I'm guessing it has to be something with the options that I've got set under dynamic dropdowns? Currently set as:```
Enable Dynamic Dropdowns 1
Product Info Single Attribute Display Plugin multiple_dropdowns
Show Out of Stock Attributes True
Product Info Multiple Attribute Display Plugin sba_sequenced_dropdowns
Mark Out of Stock Attributes None
Display Out of Stock Message Line False
Display Javascript Popup for Out-of-Stock Selection False
Prevent Adding Out of Stock to Cart False
SBA Number of Records to Displayed 25


I'm still using the previous "fix" version... I've not installed the "latest update" you mention above regarding the single dropdown, readonly, etc. 

Any ideas?
16 Jun 2015, 6:19 PM
#2235
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

picaflor-azul:

If the files in the plugin and the template are the same then you need to merge them.

Thanks,

Anne

They are each modified from a vanilla install and therefore the changes made by/for each should be evident. Usually such changes/differences are easily integrated and do not fight with each other so should be rather straight forward.

16 Jun 2015, 6:24 PM
#2236
tronage avatar

tronage

New Zenner

Join Date:
May 2015
Posts:
32
Plugin Contributions:
0

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

picaflor-azul:

If the files in the plugin and the template are the same then you need to merge them.

Thanks,

AnneAH you rock Anne! And I'm sure when I flipped to the default template it did not break... I didn't "install" it into the default template. I just turned on the default under tools-template selection... so it was a "false positive". So when properly installed it always breaks with my settings. maybe somewhere in these files the issue lays?

16 Jun 2015, 6:25 PM
#2237
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

tronage:

UPDATE:

Anne has been a huge help, however her most recent post points back to SBA being issue with my 2nd attribute only showing one value:
https://www.zen-cart.com/showthread.php?216242-Winchester-Black-Responsive-Template&p=1284771#post1284771

If you go back one page in her thread, she posted a link to a "working" version (and I tested and verified it worked) But when she changed her settings to how I have mine, and set the stock to zero it broke it. And when using the default template (as the link currently shows here: http://weblyweb.com/sba/index.php?main_page=product_info&cPath=1_17&products_id=180) it is broke in identically the same way as I'm experiencing. And she said this was a fresh install of everything.

As a "test" I did not change what options I had set for dynamic dropdowns. I picked an item with two attributes, and added stock to all the combinations. sync'ed the quantities, and reloaded the live site. Issue still remained. So I'm guessing it has to be something with the options that I've got set under dynamic dropdowns? Currently set as:```
Enable Dynamic Dropdowns 1
Product Info Single Attribute Display Plugin multiple_dropdowns
Show Out of Stock Attributes True
Product Info Multiple Attribute Display Plugin sba_sequenced_dropdowns
Mark Out of Stock Attributes None
Display Out of Stock Message Line False
Display Javascript Popup for Out-of-Stock Selection False
Prevent Adding Out of Stock to Cart False
SBA Number of Records to Displayed 25

> 
> I'm still using the previous "fix" version... I've not installed the "latest update" you mention above regarding the single dropdown, readonly, etc. 
> 
> Any ideas?

I think the version previously loaded has an extra curly bracket in the javascript display of the sba_sequenced_dropdown.php class file. That extra curly bracket was supposed to be commented out in the earlier version (not an issue in SBA 1.5.4) but in comparing the two versions did not get corrected before.

Short of it, fixed in the above download link. This is also why requested to test the various conditions to identify the "cause" it was the DD file for sba_sequenced_dropdowns that I loaded for SBA 1.5.3 to support ZC 1.5.1.
16 Jun 2015, 7:02 PM
#2238
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

Found it.

In the condition provided, the function stkmsg is removed from the page; however, calls to that function were not removed... Updated a new copy of the includes/classes/pad_sba_sequenced_dropdowns.php file.

At line: 247 add:

if ($this->out_of_stock_msgline == 'True') {

Then at new line 249 add:

}

Then at new line 262 add:

if ($this->out_of_stock_msgline == 'True') {

and again now at new line 264 add:

}

This will remove the error that is caused by trying to call a non-existent function that is between each pair of new code.

so 247 through 249 will look something like:

if ($this->out_of_stock_msgline == 'True') {
  $out.=" stkmsg(frm);\n";
}
17 Jun 2015, 12:43 AM
#2239
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

As usual, Anne certainly has gone above and beyond to provide support.

While the above code changes will solve the immediate issue, on the surface I don't consider it an ideal solution. My basis for that statement is the extra PHP necessary to prevent the javascript error that appeared and the need to "remember" that anywhere the stkmsg call is made instead of one time within the javascript section itself. That is further to consider that the less javascript presented to a guest, the shorter the load and operation time. So, it may actually be a faster/better solution, but seems like a near mess on the code side.

Basically have code that is writing code is a way to think about it. (PHP writing javascript.) Would be nice to keep it simple enough to allow others to update/modify/etc., but complex enough to give the necessary/desired result(s).

Just expressing some thoughts and thankful for the testing/reporting.

17 Jun 2015, 1:55 AM
#2240
tronage avatar

tronage

New Zenner

Join Date:
May 2015
Posts:
32
Plugin Contributions:
0

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

Salvation at last!
All seems to be working now. Just need to turn on some side boxes that Anne had me turn off, but I don't see them interfering. Your changers worked, at least for now if/when a better solution is created as you mention. Thanks so much!!!!!

Also a quick question: the drop downs for the sequenced drops are appearing in a box with a white background, and the template is primarily a black background. Could you point me in the right direction to which file or area I should be looking at to change this background to black and the text to white?
Thanks!