Quote Originally Posted by mc12345678 View Post
@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.='                        }';