Can I set a minimum spend for a bundle?
Minimum spend cannot be supported in the BYOB app. But you can use an event handler beforeBYOBAddtoCart to achieve this. Steps:
- Add a BYOB-custom-liquid.liquid file in the code editor
- Copy and paste the file content
<script> function beforeBYOBAddtoCart(vm) { if (window.location.pathname.endsWith('double-meat-mayhem')) { if (vm.totalPrice < 225) { alert('You have to spend $225 before building a bundle!') return 'return' } } } </script> {% schema %} { "name": "BYOB Custom Liquid", "settings": [], "presets": [ { "name": "BYOB Custom Liquid", "category": "BYOB Bundles APP" } ] } {% endschema %}
- Change the double-meat-mayem to your product URL handle
- Change 225 to your minimum spending amount
- Hit save to save the file
- Add the new section (BYOB Custom Liquid) to the theme editor. Put it before the BYOB Bundle Info section
- Test the bundle to see if the warning message can be shown