Combine free shipping with product or order discounts

Is it possible to offer free shipping only when a product discount or order discount created in the application is applied?
I would like to add a free shipping option to my product discounts and order discounts.

I tried this problem by rewriting shopify.extension.toml as follows but it did not solve the problem.

api_version = "2024-07"

  [[extensions.targeting]]
  target = "purchase.shipping-discount.run"
  input_query = "src/run-shipping.graphql"
  export = "run-shipping"

  [[extensions.targeting]]
  target = "purchase.product-discount.run"
  input_query = "src/run.graphql"
  export = "run"

Message log:
Error while updating drafts: Targeting multiple Function APIs is not supported.

You can currently only have one target for discount functions. Your use case is not technically feasible with functions. One alternative is to automatically add a manual shipping code at checkout with an extension (our application Stackable now does this!).

2 Likes

I found an article I would like to read on this issue and share it here.

Why You Can’t Use a Single Code for Both Product and Shipping Discounts in Shopify

Thanks for sharing my article; however, it is now outdated. Now that Shopify has released a new Discount Functions API, which allows multiple discount classes on the same Function instance, it should be possible to combine product/shipping discounts into the same code.

Best,
Tobe

@tobebuilds I just encountered an issue with the new Discount Function API. It was working fine last week, but today when I tried to create a new one, it returned a product-discount instead.

When I checked the functions, I noticed that it only includes PRODUCT classes. I believe this issue started last Saturday or Sunday, because everything was still working correctly on Friday’s morning.

Could you please check this issue?

  • Image 1 shows how it looked last 10AM Friday
  • Image 2 shows the current situation

Thanks!

Hello Pemond,

I do not work for Shopify. Therefore, I can’t look into this for you.

Hopefully you find the answer you are looking for!

Oh, Thank for let me know.
Hope you have a good day.