Events on Bundle Pages

Bundly emits a set of custom JavaScript events on bundle pages. These let you hook into key interactions (like toggling modals, changing options, or adding bundles to the cart) and run your own custom logic.


All before:     events are cancelable. To cancel the event:

document.addEventListener('bundly:beforeToggleProductDialog', (e) => {
  e.preventDefault(); // prevents modal from opening
});

Bundle Load Event

Event Notes
bundly:beforeLoadBundle      Can be cancelled
bundly:afterLoadBundle      Fires after bundle is fully loaded

Block Update Events

Event Notes
bundly:beforeUpdateBlock      Can be canceled
bundly:afterUpdateBlock      Fires after block is updated

Details (example values):

  • productId     : '8570513260706'     
  • variantId     : '45579422990498'    

Add to Cart Events

Event Notes
bundly:beforeAddBundleToCart      Can be canceled
bundly:afterAddBundleToCart      Fires after bundle is added to cart

Details (example values):

  • formData     : FormData      instance containing all form inputs
  • redirectToCart     : "true"      or "false"     
  • success     : "true"      or "false"      (after only)
  • error     : "Error message here"      (after only)
  • serverResponse     : '{"items":[...]}'      (after only)

Variant Option Events

Event Notes
bundly:beforeChangeVariantOption      Can be canceled
bundly:afterChangeVariantOption      Fires after the change is applied

Details (example values):

  • productId     : '7760014049442'     

Add/Remove Variant Events

Event Notes
bundly:beforeAddVariant      Can be canceled
bundly:afterAddVariant      Fires after variant is added
bundly:beforeRemoveVariant      Can be canceled
bundly:afterRemoveVariant      Fires after variant is removed

Details (example values):

  • componentIndex     : '0'     
  • componentVariantIndex     : '1'     
  • variantId     : '43553180418210'     
  • productId     : '7760014049442'      (add only)

Dialog Events

Event Notes
bundly:beforeToggleProductDialog      Can be canceled
bundly:afterToggleProductDialog      Fires after the dialog opens or closes

Details (example values):

  • componentIndex     : '0'     
  • componentVariantIndex     : '1'     
  • productId     : '7760014049442'     


Deprecated Events

These are no longer recommended and should be replaced:

Event Use Instead
bundlySubmit      bundly:afterAddBundleToCart     
bundlyBlocksUpdated      bundly:afterUpdateBlock     

Need More Events?

Let us know what you’re building, we’re happy to add new hooks.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us