How to Add a Discount Code Field to Your Shopify Cart
Let shoppers enter a Shopify discount code in the cart. Set up the field in Dool Cart and check eligible products, totals, and checkout before launch.
You can let shoppers enter a Shopify discount code before checkout by adding a code field to your cart drawer. In Dool Cart, open Settings, find Checkout options, turn on Show discount code field, and save. Customers can then enter a code while reviewing their items.
The field gives customers a place to use an offer you have already created. Shopify still decides whether that offer applies to the order. Before turning it on, test a valid code and a few cases that should fail, then compare the cart with checkout.
Decide whether a cart code field helps your customers
A shopper arriving from an email with a discount code may want to enter it as soon as they add a product. A field in the drawer lets them do that without leaving the page they were browsing.
Think about how you run promotions. If your customers regularly arrive with a code, the field has a clear purpose. If you only use automatic offers, you may prefer to leave it hidden. Adding an empty box does not create a promotion or make an automatic discount more generous.
Check the space on a phone, too. Customers still need to see their products, change quantities, and reach checkout. Keep the label short and avoid adding a long promotional message beside the field.
Create and check your discount in Shopify
Open Discounts in Shopify admin and create a code, or review one you already use. Check its active dates, minimum purchase, eligible products, customer restrictions, and usage limits. Decide whether it should combine with other offers before you advertise it.
For a simple test, imagine a code called CART10 that gives 10% off eligible products. This is an example, not a working Dool Cart promotion. If an eligible basket is $80 with no other discounts, the expected reduction is $8 and the product total is $72 before shipping and taxes.
Write down the expected amount before opening the storefront. It is much easier to spot a problem when you know what the result should be. Use the same products and customer eligibility that the code requires.
Turn on the discount-code field in Dool Cart
The discount-code field is available on all Dool Cart plans. First, make sure the drawer is enabled on the theme you want to test. Then open Dool Cart from Shopify admin.
- Go to Settings and find Checkout options.
- Turn on Show discount code field.
- Click Save in the save bar and wait for the settings to finish saving.
- Open your storefront or theme preview, add a product, and open the Dool Cart drawer.
- Enter your test code in Discount code and click Apply.
Check the amount after clicking Apply
Dool Cart submits the entered code to Shopify and refreshes the drawer with the returned cart. Check the amount, then continue to checkout and review the discount there. For the hypothetical $80 basket with CART10, look for the expected $8 reduction.
A submission confirmation alone is not proof that an order qualifies. The current drawer does not provide a separate eligibility explanation for every rejected code. If the price stays the same, inspect the discount rules and the message at checkout before assuming the offer worked.
For a shipping discount, check the shipping charge after entering an eligible delivery address. A code that affects shipping should not be judged only by whether the product subtotal changes.
Test the cases customers will encounter
Use a fresh cart or private browser session when you need to isolate a test from an earlier promotion. Repeat the checks on mobile. You can inspect the checkout totals before placing an order.
| Test | What to verify |
|---|---|
| Active code with an eligible basket | The reduction matches your calculation in cart and checkout. |
| Expired or mistyped code | The order does not receive the discount; check the explanation at checkout. |
| Cart below the code's minimum spend | No discount is granted until the actual conditions are met. |
| A product outside the offer | The excluded product keeps its expected price. |
| Code alongside an automatic offer | The final discounts follow the combination rules you configured. |
| Change quantity after entering the code | The total and eligibility remain correct as the basket changes. |
Check codes alongside free gifts and shipping goals
Shopify requires compatible combination settings on the discounts involved. If two offers cannot combine, checkout can select the best eligible discount instead of adding both together. Test the exact promotions you intend to run; a code field cannot override those rules.
For a Dool Cart gift offer, check that the correct gift remains free at checkout. For a free-shipping goal, compare the drawer message with the shipping option available after the discount. An order near either threshold deserves a separate test.
Keep your promotion copy consistent with the result. If shoppers can use a code or an automatic offer but cannot receive both, say so wherever you advertise the deal.
If the field is missing or a code does not work
If the cart field is missing, confirm that Show discount code field is saved, the drawer is enabled, and the cart contains a product. Check that you are viewing the same theme where you enabled Dool Cart. The app's setting controls its own drawer, not every cart page your theme provides.
If the field is visible but the discount does not apply, check the code's spelling and active dates first. Then review minimum spend, eligible items, customer restrictions, and combinations. Try the same basket at checkout to narrow down whether the issue is the promotion or its submission from the drawer.
If the code works at checkout but not through the drawer, contact Dool Cart support with the steps you followed and the affected theme. Describe the expected price and the amount you saw so the issue can be reproduced.
Review redemptions after launch
Use Shopify's Sales by discount report to review code use. Compare the discounts with completed orders and the profit left after the offer. Dool Cart records discount attempts, which can include unsuccessful submissions; that activity is not a count of redeemed codes or completed purchases.
Recheck the field when you change your theme or launch a promotion with different rules. Keep one working test basket for your main offer so you can quickly confirm that customers receive the price you advertised.