How do I hide the extra text on the donation product?

Created by Shop for Good Support, Modified on Mon, 28 Dec, 2020 at 10:47 PM by Shop for Good Support

When adding a customer adds a donation to their order, you may see a line or two of extra text on the donation product at the cart level, like here:



To remove it, you'll want to access your theme's code files.


Once you're in your theme's code files, look for the cart.liquid file, although on many themes it will be buried deeper. 


What you're looking for is a couple of lines of code -- a loop for properties -- that will look something like this:


{% for p in item.properties %}
{% unless p.last == blank %}


If you don't see this code block in your cart.liquid file, search for the term "cart" and look at your other files with "cart" in the name. 


For example, on this theme, after digging through a few cart files, we can find this block of code in the
cart-form.liquid file under Snippets:



You'll want to replace the last line of code, in this case:

{% unless p.last == blank %}


with this block of code:


 {% assign first_character_in_key = p.first | truncate: 1, '' %}
 {% unless p.last == blank or first_character_in_key == '_' %}


Remember to hit SAVE!


Then, go back to the cart page and hit refresh to see your changes:


Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article