Open bobbingwide opened 2 years ago
There are two similar files that attempt to implement the logic in JavaScript.
addon-scripts.js
is the file in current use
_addon-scripts.js
is the alternative
Their logic is different in a number of places.
In addAddonToCart()
, _addon-scripts.js calls dealWithRequiredAddons()
when either the addon-select-required
class is set ( Required addon is checked ) OR the addon-select-radio
is class is set ( Allow only ONE choice is checked ).
The active file uses an AND ( &&
) expression.
With the AND ( &&
) expression it's not possible to Allow only ONE choice unless the Required Addon is checked.
With the OR ( ||
) expression it's not possible to select more than one option when Required Addon is checked.
It would appear that a change was made prior to my starting work on this project, but since I don't know the requirements, I can't just switch the expression back from AND to OR until I know what was actually wanted.
While testing the logic for Installation options, where the price needed be displayed when it's PRICE ON ENQUIRY, I noted that the Allow only ONE choice option only works when the Required Addon checkbox was also ticked.
This doesn't seem to be logical.
I'd have expected...
I created examples of each combination for https://gvg.co.uk/store/deponti-bosco-veranda-4060x3000mm/#options_area