1

I cerated 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.
F.e.:
if calculation = 2 --> Choose option 1
if calculation = 3 --> Choose option 2

Two questions:
a. Where is the javascript placed that calculates the bundle?
b. It is probably possible to trigger a click with javascript. But maybe there is a smarter way.

0

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, privacy policy and cookie policy

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