Details
-
Type: Bug
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 5.5.0-b1
-
Component/s: None
-
Labels:None
Description
To reproduce:
- Create a config option group "Logic"
- Create 3 config options and assign them to the option group
- Edit option logic and the option group and set rules on at least two of the options
- Assign the option group to a package
- Assign the package to an order form
- Proceed to the order form
- Open the browser inspector to monitor ajax requests
- Add the package to cart
- See that 3+ ajax calls are made to fetch the order summary
The option logic js triggers the change event for every config option on page load so that logic rules are evaluated. One option to resolve the issue is to change app/views/client/bootstrap/partial_packageoption_js.pdt line 14 from:
// Trigger option evaluations
$('input,textarea,select', container_selector).change();
To
var tempFetchSummary = null; if (typeof fetchSummary === "function") { tempFetchSummary = fetchSummary; fetchSummary = function(){}; } // Trigger option evaluations $('input,textarea,select', container_selector).change(); if (typeof tempFetchSummary === "function") { fetchSummary = tempFetchSummary; fetchSummary(); }