How to have 'Continue Shopping' link return to previous page or collection?

Solved

How to have 'Continue Shopping' link return to previous page or collection?

Smeelah
Navigator
336 1 92

I've seen this question asked several times but I haven't seen an answer. 

 

Currently the continue shopping button directs the customer to a list of all the collections, which interrupts the shopping experience imho, causing the customer to have to navigate back to where they were. 

 

Is it possible to change the link to at least send the customer to the previous page?

 

(I'm on Dawn 6.0.2)

 

Thanks for any help!

Accepted Solution (1)

made4Uo
Shopify Partner
3839 716 1177

This is an accepted solution.

Hi @Smeelah 

 

To change to a back button instead of going to the all collections for the "Continue shopping", please follow the instructions below.

 

1. From your Admin Page, click Online Store > Themes >Actions > Edit code
2. In the Section folder, open the main-cart-items.liquid
3. Find and replace all codes {{ routes.all_products_collection_url }}, Ctrl + F to find

 

javascript:history.back()

 

 4. Place the {{ routes.all_products_collection_url }},  and the javascript:history.back()  in the second box, then click replace all

 

Please check the image below

made4Uo_0-1662134879053.png

 

If this fixed your issue Likes and Accept as Solution is highly appreciated. Coffee tips fuels my dedication.
Get EXPERIENCED Shopify developers at affordable rates—visit Made4Uo.com for quick quote!
Do not lost your Shopify store! Get FREE trial with ✔️ Rewind Backup: Automatic, reliable, stress-free

View solution in original post

Replies 3 (3)

made4Uo
Shopify Partner
3839 716 1177

This is an accepted solution.

Hi @Smeelah 

 

To change to a back button instead of going to the all collections for the "Continue shopping", please follow the instructions below.

 

1. From your Admin Page, click Online Store > Themes >Actions > Edit code
2. In the Section folder, open the main-cart-items.liquid
3. Find and replace all codes {{ routes.all_products_collection_url }}, Ctrl + F to find

 

javascript:history.back()

 

 4. Place the {{ routes.all_products_collection_url }},  and the javascript:history.back()  in the second box, then click replace all

 

Please check the image below

made4Uo_0-1662134879053.png

 

If this fixed your issue Likes and Accept as Solution is highly appreciated. Coffee tips fuels my dedication.
Get EXPERIENCED Shopify developers at affordable rates—visit Made4Uo.com for quick quote!
Do not lost your Shopify store! Get FREE trial with ✔️ Rewind Backup: Automatic, reliable, stress-free
Smeelah
Navigator
336 1 92

Hi @made4Uo 

 

That is awesome. Thank you. Works perfectly for my 2.0 theme. 

 

Also, I'll post a link to a Shopify tutorial that works for older themes. 

DesignGal
Visitor
2 0 0

Hey there @made4Uo – I also tried this code replacement but it didn't work for me? Am using Broadcast theme on Shopify 2.0. Any idea why it wouldn't have worked? When I replaced the code snippet as per your instructions and tested the CONTINUE SHOPPING button it took me to a blank error page (not back to the previous page).