Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
Quote:
Originally Posted by
mc12345678
@madshaun1984, et al...
Ok, figured out what's going on.
There were two things, one was the additional encoding that caused £ to become $amp;pound; in the txtXXX section (should be addressed by the above change(s) though processing of the code may make that change unnecessary), the other is/was that when selecting a "parent" option, the child select options are added by pushing the content to the option list. This push (creating a new option) though populated the text of the option not the html of the option. I.e put £ directly in the output text instead of the more "inner" html. So, while this was tested for the change identified at line 1053 below it has not been tested in absence of the previously posed changes or other similar changes that I made on my test server. I do think the below changes would address the wrongful display of £ instead of £.
I'm providing line numbers here working from the "bottom" to the "top" so that as each change is made the identified line numbers will still line up with the content on github at the moment (haven't pushed an update, just realized what needed to be done and proved that at least adding the change to line 1053 worked, though had also made some other changes as well that need to be validated as unnecessary.)
Between lines 1091 and 1092 having this content:
Code:
$out.='), opt.substring(1));' . "\n";
if ((STOCK_ALLOW_CHECKOUT == 'false' && ($curattr == count($attributes) - 2)) || PRODINFO_ATTRIBUTE_NO_ADD_OUT_OF_STOCK == 'True') {
Modify it to look like the below:
Code:
$out.='), opt.substring(1));' . "\n";
$out.=' frm["id[' . $attributes[$nextattr]['oid'] . ']"].options[frm["id[' . $attributes[$nextattr]['oid'] . ']"].length - 1].innerHTML = frm["id[' . $attributes[$nextattr]['oid'] . ']"].options[frm["id[' . $attributes[$nextattr]['oid'] . ']"].length - 1].text;' . "\n";
if ((STOCK_ALLOW_CHECKOUT == 'false' && ($curattr == count($attributes) - 2)) || PRODINFO_ATTRIBUTE_NO_ADD_OUT_OF_STOCK == 'True') {
and then again between lines 1066 and 1067 having this content:
Code:
$out.='), opt.substring(1));' . "\n";
if ((STOCK_ALLOW_CHECKOUT == 'false' && ($curattr == count($attributes) - 2)) || PRODINFO_ATTRIBUTE_NO_ADD_OUT_OF_STOCK == 'True') {
Modify it to look like:
Code:
$out.='), opt.substring(1));' . "\n";
$out.=' frm["id[' . $attributes[$nextattr]['oid'] . ']"].options[frm["id[' . $attributes[$nextattr]['oid'] . ']"].length - 1].innerHTML = frm["id[' . $attributes[$nextattr]['oid'] . ']"].options[frm["id[' . $attributes[$nextattr]['oid'] . ']"].length - 1].text;' . "\n";
if ((STOCK_ALLOW_CHECKOUT == 'false' && ($curattr == count($attributes) - 2)) || PRODINFO_ATTRIBUTE_NO_ADD_OUT_OF_STOCK == 'True') {
Between Lines 1052 and 1053 having this content:
Code:
$out.=', opt.substring(1));' . "\n";
$out.=' }';
have it look like the following:
Code:
$out.=', opt.substring(1));' . "\n";
$out.=' frm["id[' . $attributes[$nextattr]['oid'] . ']"].options[frm["id[' . $attributes[$nextattr]['oid'] . ']"].length - 1].innerHTML = frm["id[' . $attributes[$nextattr]['oid'] . ']"].options[frm["id[' . $attributes[$nextattr]['oid'] . ']"].length - 1].text;' . "\n";
$out.=' }';
Apparently my initial testing with the above change(s) was with a product condition that was incorrect. The testing involved a product that had prices in the first attribute (drawn by a different process) and not with a product that had attributes with prices in the second or subsequent attributes (option names). After testing with such a product the following was identified that corrected the reported issue (basically the array key addressing the "length" of the array should have had a '- 1' (in blue) in it in all cases.) Therefore, the following is recommended (and identified as functional):
Between lines 1091 and 1092 having this content:
Code:
$out.='), opt.substring(1));' . "\n";
if ((STOCK_ALLOW_CHECKOUT == 'false' && ($curattr == count($attributes) - 2)) || PRODINFO_ATTRIBUTE_NO_ADD_OUT_OF_STOCK == 'True') {
Modify it to look like the below:
Code:
$out.='), opt.substring(1));' . "\n";
$out.=' frm["id[' . $attributes[$nextattr]['oid'] . ']"].options[frm["id[' . $attributes[$nextattr]['oid'] . ']"].length - 1].innerHTML = frm["id[' . $attributes[$nextattr]['oid'] . ']"].options[frm["id[' . $attributes[$nextattr]['oid'] . ']"].length - 1].text;' . "\n";
if ((STOCK_ALLOW_CHECKOUT == 'false' && ($curattr == count($attributes) - 2)) || PRODINFO_ATTRIBUTE_NO_ADD_OUT_OF_STOCK == 'True') {
and then again between lines 1066 and 1067 having this content:
Code:
$out.='), opt.substring(1));' . "\n";
if ((STOCK_ALLOW_CHECKOUT == 'false' && ($curattr == count($attributes) - 2)) || PRODINFO_ATTRIBUTE_NO_ADD_OUT_OF_STOCK == 'True') {
Modify it to look like:
Code:
$out.='), opt.substring(1));' . "\n";
$out.=' frm["id[' . $attributes[$nextattr]['oid'] . ']"].options[frm["id[' . $attributes[$nextattr]['oid'] . ']"].length - 1].innerHTML = frm["id[' . $attributes[$nextattr]['oid'] . ']"].options[frm["id[' . $attributes[$nextattr]['oid'] . ']"].length - 1].text;' . "\n";
if ((STOCK_ALLOW_CHECKOUT == 'false' && ($curattr == count($attributes) - 2)) || PRODINFO_ATTRIBUTE_NO_ADD_OUT_OF_STOCK == 'True') {
Between Lines 1052 and 1053 having this content:
Code:
$out.=', opt.substring(1));' . "\n";
$out.=' }';
have it look like the following:
Code:
$out.=', opt.substring(1));' . "\n";
$out.=' frm["id[' . $attributes[$nextattr]['oid'] . ']"].options[frm["id[' . $attributes[$nextattr]['oid'] . ']"].length - 1].innerHTML = frm["id[' . $attributes[$nextattr]['oid'] . ']"].options[frm["id[' . $attributes[$nextattr]['oid'] . ']"].length - 1].text;' . "\n";
$out.=' }';
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
Quote:
Originally Posted by
mc12345678
Apparently my initial testing with the above change(s) was with a product condition that was incorrect. The testing involved a product that had prices in the first attribute (drawn by a different process) and not with a product that had attributes with prices in the second or subsequent attributes (option names). After testing with such a product the following was identified that corrected the reported issue (basically the array key addressing the "length" of the array should have had a
'- 1' (in blue) in it in all cases.) Therefore, the following is recommended (and identified as functional):
Between lines 1091 and 1092 having this content:
Code:
$out.='), opt.substring(1));' . "\n";
if ((STOCK_ALLOW_CHECKOUT == 'false' && ($curattr == count($attributes) - 2)) || PRODINFO_ATTRIBUTE_NO_ADD_OUT_OF_STOCK == 'True') {
Modify it to look like the below:
Code:
$out.='), opt.substring(1));' . "\n";
$out.=' frm["id[' . $attributes[$nextattr]['oid'] . ']"].options[frm["id[' . $attributes[$nextattr]['oid'] . ']"].length - 1].innerHTML = frm["id[' . $attributes[$nextattr]['oid'] . ']"].options[frm["id[' . $attributes[$nextattr]['oid'] . ']"].length - 1].text;' . "\n";
if ((STOCK_ALLOW_CHECKOUT == 'false' && ($curattr == count($attributes) - 2)) || PRODINFO_ATTRIBUTE_NO_ADD_OUT_OF_STOCK == 'True') {
and then again between lines 1066 and 1067 having this content:
Code:
$out.='), opt.substring(1));' . "\n";
if ((STOCK_ALLOW_CHECKOUT == 'false' && ($curattr == count($attributes) - 2)) || PRODINFO_ATTRIBUTE_NO_ADD_OUT_OF_STOCK == 'True') {
Modify it to look like:
Code:
$out.='), opt.substring(1));' . "\n";
$out.=' frm["id[' . $attributes[$nextattr]['oid'] . ']"].options[frm["id[' . $attributes[$nextattr]['oid'] . ']"].length - 1].innerHTML = frm["id[' . $attributes[$nextattr]['oid'] . ']"].options[frm["id[' . $attributes[$nextattr]['oid'] . ']"].length - 1].text;' . "\n";
if ((STOCK_ALLOW_CHECKOUT == 'false' && ($curattr == count($attributes) - 2)) || PRODINFO_ATTRIBUTE_NO_ADD_OUT_OF_STOCK == 'True') {
Between Lines 1052 and 1053 having this content:
Code:
$out.=', opt.substring(1));' . "\n";
$out.=' }';
have it look like the following:
Code:
$out.=', opt.substring(1));' . "\n";
$out.=' frm["id[' . $attributes[$nextattr]['oid'] . ']"].options[frm["id[' . $attributes[$nextattr]['oid'] . ']"].length - 1].innerHTML = frm["id[' . $attributes[$nextattr]['oid'] . ']"].options[frm["id[' . $attributes[$nextattr]['oid'] . ']"].length - 1].text;' . "\n";
$out.=' }';
The lines didn't quite match up in the file on my server with those you specified, but once the lines had been found and edited, the drop down started working as expected immediately.
I haven't seen any debug logs generated since, so hopefully that will be that!
Thanks for the support on this! Much appreciated :)
1 Attachment(s)
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
Test site for 1.5.5f on Linux
I have latest SBA Combined from Github and Edit Orders installed. Stock seems to work fine unless I use Edit Orders to change a quantity of any item. The attributes disappear from the entire order in any further view of the order. The attributes disappear also from the invoice and the packing slip. I have a screen shot I will try and attach. Attachment 17726
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
What version of Edit Orders is being used?
Was product that was edited one tracked by SBA?
What of the other product were tracked by SBA?
When the feature was added such changes in quantity were tested for both SBA product as well as not and combinations including product being first in the list, middle and last, increase and decrease of product quantity.
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
Quote:
Originally Posted by
mc12345678
What version of Edit Orders is being used?
Was product that was edited one tracked by SBA?
What of the other product were tracked by SBA?
When the feature was added such changes in quantity were tested for both SBA product as well as not and combinations including product being first in the list, middle and last, increase and decrease of product quantity.
The vesion: Edit Orders v4.x for Zen Cart 1.5.x
I just went into edit an order with Edit Orders with several products, some with attributes and some without, and changed the color only of one product in the middle of the list. Pushed the update button and all attributes for all products in the order disappeared.
However: when I then, edit the same order with Edit Orders, to add an item with attributes it works and the item with attribute for that item shows up in the order and the math is corrected in the order total. If you can help me get this site up... been working on it too long now... I would employ you to do so. PM me.
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
SBA is tracking the stock. It will not let me add things that are out of stock through EditOrders. It does let me know that items were not updated because their attributes do not exist... since those attributes were eliminated in the previous test update; but it keeps the item in the order even though there is no attribute specified as required in the normal ordering process.
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
Quote:
Originally Posted by
athena
SBA is tracking the stock. It will not let me add things that are out of stock through EditOrders. It does let me know that items were not updated because their attributes do not exist... since those attributes were eliminated in the previous test update; but it keeps the item in the order even though there is no attribute specified as required in the normal ordering process.
Want to confirm. The product identified above that is shown as three different line items, that is a product tracked by SBA?
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
@athena, looks to me like there has been a change to edit orders that has caused this issue... Disabling the SBA portion of the code, a product/screen that is updated by selecting the update button has the attributes stripped from it... Still trying to work through that issue regardless.
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
Quote:
Originally Posted by
mc12345678
@athena, looks to me like there has been a change to edit orders that has caused this issue... Disabling the SBA portion of the code, a product/screen that is updated by selecting the update button has the attributes stripped from it... Still trying to work through that issue regardless.
Forgot to mention how to "disable the SBA portion". Renaming the file admin/includes/auto_loaders/config.eo_sba.php to have an extension other than .php ie: config.eo_sba.php.txt will prevent it from loading, without it loading, then the code related to SBA does not run when using edit orders. At least on the configuration I was running I had the same issue as described above where attributes of an existing product were stripped when selecting the update button from the edit orders screen. I didn't try modifying one of the attributes even or the quantity, just simply pressing the update button was enough to cause the issue.
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
The above issue has been confirmed as being a result of a minor bug in Edit Orders version 4.3.1 and is to be corrected in the next release. The fix is posted here in the edit orders thread.