Re: Need to hide Discount Code field using Checkout Extensibility

Need to hide Discount Code field using Checkout Extensibility

asadnmalik
Shopify Partner
2 0 2

Hi I'm trying to build a custom app using the new Checkout Extensions.

One of the requirement is to remove the Discount Code field completely but still be able to use discounts codes through APIs.

I've created a new field where users can add a discount code and they can add products to the cart on the Checkout level using Checkout UI Extensions. Everything is fine and working, the last piece of the puzzle is just hiding the default Discount Code field so that customers wont get confused where to put the Discount Code.
Is there a way to visually hide it or remove it using the Checkout Extensibility tools?

It used to be simple with checkout.liquid because you just need to write a small CSS to hide Discount Field but we longer will be able to edit the checkout.liquid file in Checkout Extensibility.

Thankyou

Replies 3 (3)

Liam
Community Manager
3108 341 879

Hi Asadnmalik,

 

For the new discount field that you've created - will these be using discount codes generated by the native Shopify discounts feature? One option you could explore would be to create your own input field that stashes on a cart attribute (which could be checked with a function).

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

asadnmalik
Shopify Partner
2 0 2

Yes it will use native Shopify Discounts

adil-naqvi-cd
Shopify Partner
1 0 0

@asadnmalik Did you manage to find a solution? I have the same issue.