Solved

How can I create a 'Back to Collection' button on Dawn theme?

TwoOrangeCats
New Member
4 0 0

Hello,

 

I need help with getting a back button my product information page.  I have already had one but it takes me back from the product to an all products page.  I need a back button that just takes me back to the previous page I was on.

Accepted Solution (1)

GemPages
Shopify Partner
5589 1261 1218

This is an accepted solution.

Hello @TwoOrangeCats 

This is GemPages - A powerful Page Builder. Regarding your question, I would like to give you some recommendations to support you

Let's try adding this code to the main-product.liquid file: 

<button onclick="history.back()">Go Back</button>

GemPages_Agents_0-1668062567478.png

Hope my recommendation can work and support you!
Kind & Best regards!
GemPages

GemPages - Build any high-converting store pages for any business


- If you find my reply helpful, please hit Like and Mark as Solution
- Get connected: App Store | Blog | Community | Help Center

View solution in original post

Replies 5 (5)

GemPages
Shopify Partner
5589 1261 1218

This is an accepted solution.

Hello @TwoOrangeCats 

This is GemPages - A powerful Page Builder. Regarding your question, I would like to give you some recommendations to support you

Let's try adding this code to the main-product.liquid file: 

<button onclick="history.back()">Go Back</button>

GemPages_Agents_0-1668062567478.png

Hope my recommendation can work and support you!
Kind & Best regards!
GemPages

GemPages - Build any high-converting store pages for any business


- If you find my reply helpful, please hit Like and Mark as Solution
- Get connected: App Store | Blog | Community | Help Center
TwoOrangeCats
New Member
4 0 0

Screenshot (27).png

 

This is what happens when I do that.

TwoOrangeCats
New Member
4 0 0

Wait! Disregard that reply I just realized I had it in the wrong spot!  It works and everything.  This may be extra but do you know of how I could have an arrow instead of just a plain button?  

 

Other than that it does work!!

GemPages
Shopify Partner
5589 1261 1218

Hello @TwoOrangeCats
This is GemPages - A powerful Page Builder. Regarding your question, I would like to give you some recommendations to support you

Let's try adding this code :

<button onclick="history.back()"><i class="fa fa-arrow-left" aria-hidden="true"></i> Go Back</button>

And Go to your Online store > Themes > click 3 dots icons, Edit code > open theme.liquid and add the code below in the <head> </head> :

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">


Other than that you can find another icon here : https://fontawesome.com/v4/icons/

Hope my recommendation can works and support for you!
Kind & Best regards!
GemPages

GemPages - Build any high-converting store pages for any business


- If you find my reply helpful, please hit Like and Mark as Solution
- Get connected: App Store | Blog | Community | Help Center
NaomiNN
Pathfinder
112 1 5

Hello! Thank you for your code it worked for me. Is it possible to have a bigger button with wider font ?