How do I make Shopify function that does product discount only?

How do I make a Shopify function discount app that appears as only Product where in the attached image is says “Product and order discount”?

Hi @Abe

This could be a good usecase to use the dev assistant to help you create the function you’re looking for. We’ve recently updated the assistant to be able to create functions. Can you try using this and let us know if it works for you?

This is a limitation in the discount settings ui extensions. I believe it works as follows:

  • If you target the ‘cart_run’, it has the product and order discount classes by default.
  • If you target both the ‘cart_run’ and ‘delivery_run’, it has the product, order and shipping discount classes.
  • Because the discount is ‘managed’ by Shopify, you can’t edit the discount after it’s saved to remove/change the discount classes.
  • There are no hooks/helper functions provided to change these values.

If you want full control over the discountClasses, you’ll need to create your own ui for creating/editing the discount.

Hope that helps!

1 Like