Unlock Free Gifts & Custom Questions on Your Shopify Cart Page (No Checkout Code Needed!)

Hey everyone! As a Shopify migration expert and someone who spends a lot of time digging through the community forums, I often see recurring questions that really highlight common pain points for store owners. One topic that pops up time and again, especially for those migrating from other platforms like Wix, is the challenge of adding "free gifts" or custom questions directly to the checkout page.

Recently, a fantastic thread kicked off by CLD_Fab titled “Free gift in Checkout possible?” really got the community talking. CLD_Fab was migrating from Wix, where adding these elements was “super easy,” and was understandably surprised by Shopify’s “lack of customization in the checkout.” They were also keen to avoid piling on monthly app costs, which is a sentiment I think many of us can relate to.

Why Shopify’s Checkout is So “Restrictive”

First things first, let’s address CLD_Fab’s observation about the checkout being “super restrictive.” They hit the nail on the head! As mastroke chimed in, “In Shopify checkout page is heavily restricted. Whatever changes you want you have to do in cart page itself.”

Shopify intentionally keeps the checkout process streamlined and tightly controlled. This isn't to frustrate you, but to optimize for conversions and ensure security. Any direct customization of the checkout page itself requires a Shopify Plus plan, which unlocks the checkout.liquid file. For Basic, Shopify, and Advanced plans, you’re generally limited to what you can configure through the theme editor or Shopify’s built-in settings.

So, the community consensus is clear: if you want to add free gift selection or custom input fields without a Plus plan, you need to do it on the cart page (or cart drawer).

Solution 1: Simple “Where did you hear about us?” Questions (Native!)

CLD_Fab also asked about adding a “Where did you hear about us?” question. This is a common and very useful piece of data to collect! The good news here, as Trii pointed out, is that this specific type of question is often “built into Shopify natively.”

You can usually enable “order notes” in your theme settings, and it will appear on the cart page for free. It’s worth checking your theme’s customization options first before diving into code. This is usually found under Online Store > Themes > Customize > Cart page settings.

Solution 2: Adding a Free Gift Selector to Your Cart Page (Code Method)

Now, for the main event: adding that free gift selector. The community, especially Wsp, provided a fantastic, detailed walkthrough that CLD_Fab eventually used to get things working. This method leverages “cart attributes,” which are extra pieces of information you can attach to an order from the cart page. These attributes then show up in your Shopify Admin when you view the order.

Step-by-Step: Implementing a Free Gift Selector

  1. Access Your Theme Code:
    • From your Shopify Admin, go to Online Store > Themes.
    • Find your current theme (like “Ecomus” in CLD_Fab’s case) and click “Actions” > “Edit Code.”
  2. Find Your Cart File(s):

    This is crucial. Depending on your theme, your cart UI might be controlled by one of these files:

    • cart-drawer.liquid (for themes with a slide-out cart)
    • main-cart.liquid (a common file for the main cart page)
    • cart.liquid (another common file for the main cart page)

    You may need to check which one your theme uses. If your theme has both a cart drawer and a dedicated cart page, you’ll likely need to add the code to both relevant files to ensure a consistent experience.

  3. Locate the Checkout Button or Cart Summary Section:

    Scroll through the chosen file(s) until you find the section where your checkout button is, or the general “cart summary” area. You want to place your gift selection *before* the checkout button, but still within the main cart form.

  4. Insert the Code:

    Here’s the HTML code provided by Wsp. You can adapt the gift options to fit your offerings:

    Choose your free gift

    Where did you hear about us?

    Pro-Tip: If you’re using the native “order notes” for your referral source (as mentioned earlier), you can omit the

    Where did you hear about us?

    and parts from this code snippet.

  5. Ensure it’s Inside the Cart Form:

    This is critical! The code you just pasted must be inside your theme’s cart form. Look for something like

    . If your new code is outside of this form, it won’t save the attribute data. Make sure it’s nested correctly.

  6. Save Changes:

    Click the “Save” button in the top right of the code editor.

  7. Test on Your Store:

    Go to your live website, add a product to your cart, open the cart drawer or go to the cart page, select a free gift (and fill the referral field if you included it), and then proceed to checkout.

  8. Check Order Data:

    After placing a test order (or abandoning it and checking the draft order), go to your Shopify Admin > Orders > Open the order. You should see “Free Gift” and “Referral Source” (or whatever you named your attributes) listed under the order details!

Handling Cart Drawer vs. Main Cart Duplication

A great question CLD_Fab raised was, “If I put the code in Cart-Drawer it doesn’t show in the main cart. Do I add the code to both? Will it double up the notes on my order or should they merge?”

Wsp provided a clear answer: “Yes this is expected behavior in Shopify themes like Shopify Ecomus theme where the cart drawer and main cart are handled separately. You should add the code in both places... Because both are different templates and do not automatically share content.”

And don’t worry about duplication! Wsp confirmed, “It will Not duplicate anything in the order. Shopify stores this data as cart attributes and they are: merged automatically, saved once per field, displayed once in the final order.” So, you’re safe to add the code to both cart-drawer.liquid and main-cart.liquid (or cart.liquid) if your theme uses both.

When to Consider a Free Gift App

While the code method is fantastic for avoiding monthly costs, it’s not always the perfect fit, especially if your free gift strategy is more complex. CLD_Fab, after initially “vibe coding” their way to a solution, later mentioned, “ended up ditching the free gift for a free gift app that pops up (I have like 15-20 variants and a pop down for that many seemed annoying, although so is the pop-up…may change it).”

:sweat_smile:

This is a super important real-world insight! If you have a large number of gift variants (like 15-20) or need more sophisticated logic (e.g., conditional gifts based on cart value, specific products, or tiered offers), a dedicated free gift app might actually save you a lot of headache in the long run. While CLD_Fab initially wanted to avoid apps, the practicalities of managing many variants pushed them towards one. Apps often provide a much better UI/UX for selecting gifts and handle complex rules more robustly than custom code can, without requiring you to be a coding wizard.

So, there you have it! Shopify’s checkout might be a walled garden, but with a little understanding of its structure and some clever use of cart attributes, you absolutely can add free gift selections and custom questions to your store. Whether you go the DIY code route or opt for a specialized app, the key is to make that cart page work harder for you before your customers hit that final checkout button. Happy selling!

Share:

Start with the tools

Explore migration tools

See options, compare methods, and pick the path that fits your store.

Explore migration tools