Solved

How To Make Product Title On Cart Page Unclickable?

YnkSch
Excursionist
33 0 14

How can I make the product title on the cart page unclickable so that the customer can't go to the product page?

 

I'm using dawn theme.

Accepted Solution (1)

Ninthony
Shopify Partner
2332 350 1031

This is an accepted solution.

You can go into your theme code, open the sections folder, and look for "main-cart-items.liquid". Open that file, and ctrl + f for "cart-item__name". You'll see something that looks like this:

<a href="{{ item.url }}" class="cart-item__name break">{{ item.product.title | escape }}</a>

 

Since that's an anchor tag with an href attribute, it'll take you to the product page. You could just change it to a span tag and remove the href attribute:

<span class="cart-item__name break">{{ item.product.title | escape }}</span>

 

If my solution helped you, please like it and accept it as the solution!
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 😄

View solution in original post

Replies 6 (6)

Ninthony
Shopify Partner
2332 350 1031

This is an accepted solution.

You can go into your theme code, open the sections folder, and look for "main-cart-items.liquid". Open that file, and ctrl + f for "cart-item__name". You'll see something that looks like this:

<a href="{{ item.url }}" class="cart-item__name break">{{ item.product.title | escape }}</a>

 

Since that's an anchor tag with an href attribute, it'll take you to the product page. You could just change it to a span tag and remove the href attribute:

<span class="cart-item__name break">{{ item.product.title | escape }}</span>

 

If my solution helped you, please like it and accept it as the solution!
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 😄
YnkSch
Excursionist
33 0 14

Thank you very much:)

Yuyazdnf01
Shopify Partner
10 0 4

@Ninthony  Hi there,

 

I am with this website, https://luxstoneworks.com/  and i am using Ella theme from themeforest.

I have a question about how to make the images or links unclickable, could you please help me?

 

Almost everything on this theme is clickable, and i need most of the images or links or titles to be unclickable, which really is bothering me. 

 

For example, the "why us" section on homepage, you can see from the below screenshot, I left the “button” and "link" empty, I thought if I just not enter any URL, then it will become unclickable. However, it is still clickable, it will redirect to homepage if I click the picture. So, what should i do to make it unclickable?

 

Yuyazdnf01_0-1664441725068.png

 

Could you please help me to fix this? Thanks very much in advance!

StudioFounded
Shopify Partner
4 0 1

Hi @Ninthony,

 

I added this code, but it doesn't seem to remove the clickthrough on my checkout page: https://metiertype.myshopify.com/checkouts/cn/Z2NwLXVzLWVhc3QxOjAxSFczQVNNM1gzMko4REZDMUdKR1lDSlNI?c...

 

Can you help?

 

- Hannah

Ninthony
Shopify Partner
2332 350 1031

@StudioFounded the solution posted was for Dawn theme on the cart page. You can no longer edit the checkout directly as Shopify has moved everything to Checkout Extensibility. It can currently only be edited by an app extension.

If my solution helped you, please like it and accept it as the solution!
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 😄
StudioFounded
Shopify Partner
4 0 1

@Ninthony Thank you for letting me know! What app extension do you recommend?