Add text to cart page on Venture theme

Solved
Highlighted
Excursionist
36 0 1

Hiya, 

 

I recently had a customer complain that it wasn't clear enough on mobile where to put the discount code (and i have to agree!).

 

I know i cant change the process, but i would like to at least add some text to the cart page to say "Discount codes can be applied at checkout" or some words to that effect. 

 

Does anybody know how to do this please? 

 

Aneesha

(www.devti.co.uk)

0 Likes
Astronaut
1003 130 236

Go into your cart.liquid and see if there's a bunch of code in there. Then look for this:

 

<p class="cart__taxes rte">
  Tax included. <a href="/policies/shipping-policy">Shipping</a> calculated at checkout.
</p>

and add a break and add your text:

 

<p class="cart__taxes rte">
  Tax included. <a href="/policies/shipping-policy">Shipping</a> calculated at checkout.<br>
  Discount codes can be applied at checkout
</p>

If you don't see the code in cart.liquid and instead see something like:

 

{% section 'cart-template' %}

You're going to want to open cart-template.liquid in your sections folder and do as described above.

If you'd like to make any edits to your store, please send me a personal message and we can discuss what you'd like to accomplish :D
0 Likes

Success.

Shopify Expert
51 12 7

Hi @Aneesha1,

 

You actually can add a discount field to your cart page, and when submitted it will pass the code along to the checkout page.

 

To do this, you'll need to edit your theme's "cart-template.liquid" file and add these lines:

<label for="discount-field">Discount Code</label> 
<input id="discount-field" type="text" name="discount">

If you'd like to add it right before the update/checkout buttons, find the "button" elements and paste above like this:

<label for="discount-field">Discount Code</label> 
<input id="discount-field" type="text" name="discount">
// ^Paste Here^
<button type="submit" name="update" class="btn--secondary update-cart">{{ 'cart.general.update' | t }}</button>
<button type="submit" name="checkout" class="btn">{{ 'cart.general.checkout' | t }}</button>

 

Let me know if you need more help.

1 Like
Excursionist
36 0 1

Thank you so much! worked PERFECTLY! and Shopify told me I couldnt do this yesterday!

0 Likes
Excursionist
36 0 1

Thank you!

0 Likes
Shopify Expert
51 12 7

Great to hear, happy to help!

0 Likes
Astronaut
1003 130 236

@Spinturnix where did you find this out? Is there any documentation about it anywhere? Cause yeah I did it on a practice site and it works for me as well, so I'd just like to understand what I'm copying and pasting.

If you'd like to make any edits to your store, please send me a personal message and we can discuss what you'd like to accomplish :D
0 Likes
Shopify Expert
51 12 7

Hey @Ninthony,

 

I discovered the feature a while back, working on a client's site. Basically, submitting an input with the name="discount" attribute will pass its value through the URL, like '?discount=discount_code' which the checkout page can then accept.

 

I forget the exact research path taken, but I don't believe there was much info in the Shopify docs for this specific feature.

1 Like
Astronaut
1003 130 236

Beautiful, nice to know. Thanks for the information.

If you'd like to make any edits to your store, please send me a personal message and we can discuss what you'd like to accomplish :D
0 Likes