Skip to content

Instantly share code, notes, and snippets.

View peterbrunton's full-sized avatar

Peter peterbrunton

  • Kerry, Ireland
  • 20:57 (UTC +01:00)
View GitHub Profile
@peterbrunton
peterbrunton / product-injection-based-on-cart-conditions.txt
Last active July 26, 2023 17:24
Product injection based on cart conditions. GWP offers
This gist creates a gift with purchase function that injects a product or multiple products into the cart when conditions are met.
**It is important to mention this function does not perform any discount that works separately current implementation is performed by the Shopify Scripts App
*This function is not considered good UX practice.
The conditions are cart threshold amount met or/and cart threshold amount met and conditional product applied to the cart.
When the conditions are no longer met the products are removed from the cart.
Create a new section, sections/gwp-injection.liquid