Ability to hide discount field

We’re coming up on BFCM and it’s been over a year since this Github issue was opened.

Maybe this new community is a better place to get eyes on, but it would be fantastic to be able to temporarily or at-will disable the discount field at checkout.

During BFCM in particular, merchants want the ability to just do something as simple as run an automatic discount and not have customers worry about testing out various discount codes to determine whether or not they are getting the “best” deal.

The current UX is they will manually enter a discount and it will update to using that instead of the best automatic discount. Once they see it is not the best, they have to remove. It would be 100x better to just be able to disable this at random.

The “solution” or solve for this is to just remove/deactivate ALL discounts in the shop through this promotional period, but that’s a terrible suggestion considering there are many apps often creating discounts that will cause this to be problematic and have to recreate and/or reassign which ones need to be re-activated after the promotional period.

Would be fantastic to get some sort of toggle, or ability via extension that we can conditionally hide the discount field - even if we could do this for specific customers or not logged in customers - AMAZING, but the ask here is much more simply let us manually shut this off/on to hide or remove the discount field at checkout.

Any sort of movement or controls on this would be HUGE since a lot of folks were doing this with checkout.liquid and cannot now.

1 Like

One thing to call out here is that the field is used to apply gift cards to orders too right? Disabling it would effectively block gift cards from being used too.

I believe with the Script Editor app we could have blocked discount code usage but I am unsure if anything newer can be used the same.

1 Like

Yeah that’s a great thought, but that’s not even the main ask considering a lot of these shops don’t use gift cards even that want to disable the discount field. So that’s as simple as a check if you try to disable and it says, “whoah hey you have gift cards you sure”

Just trying to hide the thing if not even disable for things to function as needed. Gift cards is definitely a good thought, but that’s not a concern for a lot of these shops I work with that want to hide the field for the auto-discount.

Yeah, I get it. Even having a way to disable one but not the other would be a nice-to-have.

If I recall correctly there is different theme content related to the text available for the field so such a setting could be linked to that so that it uses one over the other or a default if both are enabled.

I remember back to working with the Script Editor app heavily and many conditions were necessary to ensure only the right things were discounted at the right times.

Just being able to disable the field’s use for discounting when you want to offer a temporary automatic discount for all orders would be nice. Heck, being able to schedule the disabling/enabling similar to scheduling when discount codes expire would be nice.

1 Like

I appreciate the use cases/feedback/discussion, both previously on the github issue and in this thread. There is a wide variety of use cases that include [hiding the field but allowing discounts to be applied, dynamically disabling all discounts codes based on cart context/already applied discounts, entirely replacing the native field with your own app-based field], not to mention the fact that the native field is actually a combination field that also covers gift cards (mentioned above).

We are actively discussing solution options for the above use cases, but no timeline to share at the moment.

3 Likes

Thanks for sharing! Yeah, it’s a tough one to crack because the merchants need to be on board alongside their team in making sure it is not hidden/disabled for longer than necessary which could negatively affect their sales/marketing campaigns etc.

Having something would be nice but again all parties need to be aware, like maybe a multi-approval process to hide/disable (maybe scheduled) and maybe offer scheduling so that it automatically re-enable at a certain date and time…

Appreciate you chiming in, but this is really disappointing to hear moving away from “We are planning to make this possible early 2024, planning is in progress…” to we’re just talking about it.

Lots of use-cases and details provided as far as this being something folks are asking about - regularly. And it becomes a much more frequently requested thing around BFCM.

I understand y’all probably have a whole lot of things to prioritize and this may not be high up on the list. It is just disappointing that this is something we were previously able to accomplish with checkout.liquid and cannot now in any way without gutting existing discounts.

There has been a bit of an update on this - unstable API (at the time of this writing) in that the gift card field (aka discount field) will be able to be disabled (hidden?).

Dev changelog: Conditionally disable gift cards in checkout using custom logic with the Payment Customization API — Shopify developer changelog

2 Likes

I just tested it, and at least as of now, this is not sufficient.

It only disables gift cards, not discounts. So the field will still show. Even if you delete all discounts.

Following screenshot uses HideOperation to hide Gift card (as per the docs and link you shared to the unstable API). This shop has no discount codes, but it has two gift cards.

It’s unstable, so they might change this. Hopefully. Or add Discount to the object just as they added Gift card

     {
       "paymentMethods": [
         {
           "id":
     "gid://shopify/PaymentCustomizationPaymentMethod/0",
           "name": "(for testing) Bogus Gateway"
         },
         {
           "id":
     "gid://shopify/PaymentCustomizationPaymentMethod/1",
           "name": "Deferred"
         },
         {
           "id":
     "gid://shopify/PaymentCustomizationPaymentMethod/2",
           "name": "Bank Deposit"
         },
         {
           "id":
     "gid://shopify/PaymentCustomizationPaymentMethod/3",
           "name": "Gift card"
         }
       ]
     }
export function run(input) {
  const NO_CHANGES = { operations: [] };

  const hideGiftCardMethod = input.paymentMethods
    .find(method => method.name.includes("Gift card"));

  if (!hideGiftCardMethod) {
    return NO_CHANGES;
  }

  return {
    operations: [{
      hide: {
        paymentMethodId: hideGiftCardMethod.id
      }
    }]
  };
}