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:

  1. Add a BYOB-custom-liquid.liquid file in the code editor
  2. 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 %}
    	
  3. Change the double-meat-mayem to your product URL handle
  4. Change 225 to your minimum spending amount
  5. Hit save to save the file
  6. Add the new section (BYOB Custom Liquid) to the theme editor. Put it before the BYOB Bundle Info section
  7. Test the bundle to see if the warning message can be shown

Still need help? Contact Us Contact Us