Auto adding products

Hi guys

I’ve created a new type of discount where merchant can customize the requirements to give customer free items

This works fine, however what I would like is to have a configuration for auto cart adding and function in one place. Right now I need to seperately setup auto adding in cart section.

I was thinking about having an app metaobject where I would save mostly the same information that is already in the discount. One thing that stops me from doing that is in my company I can’t really get any server env to subscribe to a webhook. So I can’t have my metaobject synced with the discount, I think that would do the job.

Any ideas on how I can approach this?

A few approaches you could consider when trying to “bundle” your custom discount logic and the automatic cart-adding behavior. Each comes with pros and cons:

  1. Store all config in the discount (or in a custom discount function)
  2. Manually sync between the discount and a metaobject in the admin
  3. Use a lightweight hosted endpoint (serverless) for webhooks