How to redirect the "Continue Shopping" button on cart page to last collection viewed on Spotlight?

How to redirect the "Continue Shopping" button on cart page to last collection viewed on Spotlight?

marianaclothing
Visitor
3 0 0

Hi all,

 

I am currently using the Spotlight theme on Shopify.

 

I am fairly new to Shopify, let alone code all together. I am trying to figure out how to change the page that the "Continue Shopping button takes the viewer to the previous collection viewed or the shop all page? I have browsed everything pertaining to this issue, and yet, I cannot seem to get it to work myself. I know it is the line 29 in "main-cart-items.liquid" that I must change, but how should I write the code to change the link to what I want? Any help is greatly appreciated.

 

Link it takes customer:https://marianaclothing.com/collections/all 

 

Link I wish for it to change to: Last collection viewed OR Shop All page: https://marianaclothing.com/pages/shop-all 

 

I need help on how to write the code to replace the destination as I do not know how to implement the url correctly into the code.

 

Many thanks.

Replies 7 (7)

saim007
Shopify Partner
609 74 104

@marianaclothing Where you want to change the link of continue shopping?

Saim | Shopify Partner Expert

Was I helpful?

Buy me a Coffee

🙂
Hire me   to unlock the full potential of your e-commerce store 🙂
marianaclothing
Visitor
3 0 0

I would like to change the link to either the last collection viewed or the shop all page. If I cannot do the last collection viewed, then the shop all page is best for me. The link for the shop all page is here: https://marianaclothing.com/pages/shop-all

 

I do not know how to write the code so the continue shopping button directs the customer to this page.

saim007
Shopify Partner
609 74 104

No, you don't understand, the continue shopping button only shows on Cart drawer and cart page so from these where you want to change the link? See below screenshot so we both are on right track -

sandyparihar07_0-1682398490921.pngsandyparihar07_1-1682398503378.png

 

Saim | Shopify Partner Expert

Was I helpful?

Buy me a Coffee

🙂
Hire me   to unlock the full potential of your e-commerce store 🙂
marianaclothing
Visitor
3 0 0

I managed to figure it out myself. Thanks for your help.

Timothy13
Visitor
3 0 0

Hi, how did you figure it out, my continue shopping button takes me to a random list of products. Thanks.

 

Tim.

vera_p
Excursionist
13 0 2

Hi!

I found this question! I figured out how to change the link for the continue shopping button here https://www.youtube.com/watch?v=oe9sPkUkQog

It's a quick YT video.

How to on Dawn theme:
- Theme > "..." > Edit Code
- Open "sections/main-cart-items.liquid"
- Search for "continue" and find the "" next to "href".
- Substitute the path that was on before with the path you want the customer to take - in my case it was "/collections/todas-as-pecas"
AAAAAND that's it!!

(please if you know how to redirect to the last page seen by the user let me know 'cause I'm trying to figure that out! thanks!)

vera_p_0-1732214585504.png

 

 

vera_p
Excursionist
13 0 2

Hi!

If it helps, I was able to find a solution that redirects the "continue shopping" button to the last non-product page searched by the user preserving the page nr and filters.

That way:

- if user goes to a specific product page > adds to cart > goes to cart > clicks "continue shopping" > goes back to the last collection page navigated
- if user goes to a specific collection page > navigates through multiple pages > goes to cart > clicks "continue shopping" > goes back to the last page
- if user goes to any page / blog within the website > goes to cart > clicks "continue shopping" > redirect to a specific page of my choosing
** in my case I used the "/collections/todas-as-pecas" fallout, so you'd need to change that for you! 
Hope this helps!

I wrote it down in this discussion: https://community.shopify.com/c/shopify-design/how-to-have-continue-shopping-link-return-to-previous...