A user seeks help implementing an automatic freebie feature where adding product X to cart triggers product Y to be added automatically. They provided a screenshot example showing a second product appearing in the cart drawer when a customer adds a crystal hair product.
Current Status:
User attempted implementation using product ID through a const form but suspects incorrect implementation
No working solution achieved yet
Suggested Solution:
Another participant recommended:
Writing custom code to monitor cart data
Triggering a script when specific criteria are met
Using Shopify’s AJAX Cart API for adding the freebie item
Referenced official Shopify documentation for implementation guidance
The discussion remains open with no confirmed resolution or working code provided.
Summarized with AI on November 1.
AI used: claude-sonnet-4-5-20250929.
To automatically add a free product to the cart, you can set up a Buy X Get Y offer in the BOGOS App. With this feature, when a customer clicks “Add to cart” for the main product, the free gift will be instantly added to the cart drawer without any manual action from the customer.
What you’re seeing in the example (where product Y is automatically added when product X is added to the cart) is typically done using a buy X get Y (BOGO) or bundle logic, not just a simple product ID inside the form.
The best and safest way to achieve this, especially with cart drawers and AJAX carts, is by using a dedicated bundle/BOGO app like Wizio Bundle – Buy X Get Y. Automatically add Product Y when Product X is added to the cart.
Suppose your goal is to add product Y automatically when product X is added to the cart and show it in the cart drawer. Use a Buy X Get Y / bundle solution instead of custom product-ID logic.