I created a bundle product and placed two input fields on the page for the user to input length and width. I would like to calculate a value and let set options of the bundled product depending on the input:

if calculation = 2 --> Choose option 1
if calculation = 3 --> Choose option 2

Two questions:
a. Where to find the Javascript that calculates the bundle?
b. Is this the best way or is there an other solution besides Javascript?

1 Answer 1


I found a solution for a.:

Open (or copy) this file: app/design/frontend/Custom/YOUR_THEME/Magento_Bundle/Layout/catalog_product_view_type_bundle.xml

Write the following in the HEAD-section:

<link src="js/konfigurator.js"/>

The konfigurator.js should be placed in: app/design/frontend/Custom/YOUR_THEME/web/js

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.