0

I have set up a bundle product and its working but can I disable the javascript that forces me to click on calculate every time I use it?

I want it to open in "calculate mode". I dont know what Im doing wrong. is it bundle.js or slide.js?

1

actually it's found in Magento Bundle summary.phtml

/vendor/magento/module-bundle/view/frontend/templates/catalog/product/view/summary.phtml
<script type="text/x-magento-init">
{
    ".product-add-form": {
        "slide": {
            "slideSpeed": 1500,
            "slideSelector": "#bundle-slide",
            "slideBackSelector": ".action.customization.back",
            "bundleProductSelector": "#bundleProduct",
            "bundleOptionsContainer": ".product-add-form"
            <?php if ($block->isStartCustomization()): ?>
            ,"autostart": true
            <?php endif;?>
        }
    }
}

and you need to override it and remove the if condition in

Vendor/Theme/Magento_Bundle/templates/catalog/product/view/summary.phtml
<script type="text/x-magento-init">
    {
        ".product-add-form": {
            "slide": {
                "slideSpeed": 1500,
                "slideSelector": "#bundle-slide",
                "slideBackSelector": ".action.customization.back",
                "bundleProductSelector": "#bundleProduct",
                "bundleOptionsContainer": ".product-add-form"
                ,"autostart": true
            }
        }
    }
</script>
  • Try it now! Be right BACK :-) – Kaki Sami Feb 2 '19 at 19:44
  • Its strange. It loads only the attributes, not the main bundle container.. Any ideas? – Kaki Sami Feb 2 '19 at 20:09
  • Its working! Now I just need to figure out howto make it disappear for good! – Kaki Sami Feb 3 '19 at 5:49

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.