Addin admin ui extension in the discount page

Hi, I’m trying to build an UI extension on the BxGy discount page, where Y gets automatically added to the cart (instead of the user manually adding Y for the discount to apply). For example, if a user adds two phones to the cart (X), a free / discounted cover phone is automatically added to the cart (Y).

I have followed this official tutorial on how to Build a discounts UI with Admin UI extensions (Build a discounts UI with Admin UI extensions) from the Shopify dev docs but I’m unable to add an UI extension to the discount page, so that I can add the function logic of adding Y automatically in the cart.

Is there another way to do it? Must I replicate the Buy X Get Y discount from Shopify just to add this functionality?

Thanks for the assistance :pray:

Hi! As the tutorial in your screenshot says, that feature is to make it easier for you to create the merchant experience for configuring your discount function metafield values when creating an app discount type. It is not for adding/customizing functionality on other discount types.

The way other free gift with purchase apps tend to do what you’re describing is by coupling a BXGY or app discount type with a theme extension and/or Checkout UI extension.

1 Like