Move back to (collection); at top left of page? (Debut Theme)

Solved
Ninthony
Shopify Partner
2188 324 871

I also do not see a button, you may be previewing a different theme where you have added this button?

Ninthony_0-1623877371132.png

 

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 :D
0 Likes
GetOrchard
Excursionist
33 2 5

I changed product.liquid.

I moved 

<div id="backToCollection"></div>

on top of

 {% section 'product-template' %}
{% section 'product-recommendations' %}

 

and changed the div class to text-left:

if(showCollection) {
var backToCollectionHTML = '<div class="text-left return-link-wrapper page-width"><a href="' + theme.backToCollection.collection.link + '" class="btn btn--secondary btn--has-icon-before">{% include 'icon-arrow-left' %}{{ 'products.product.back_to_collection' | t }} ' + theme.backToCollection.collection.title + '</a></div>';
var backToCollectionContainer = document.getElementById('backToCollection');
backToCollectionContainer.insertAdjacentHTML('afterbegin', backToCollectionHTML);
}

 

 

 

0 Likes
GetOrchard
Excursionist
33 2 5

The button was already there I just moved it up in the product.liquid when you view an item

0 Likes
hash777
Shopify Partner
164 9 23

@GetOrchard  send the full screenshot of your laptop while you are trying to move button up, as you said. That might help.

THANKS

0 Likes
GetOrchard
Excursionist
33 2 5

I don't understand what you mean by this. What do you mean by trying to move it up? I'm editing the code to move it up. Do you want me to send a picture of the code ?

0 Likes
GetOrchard
Excursionist
33 2 5

In order for the button to pop up you have to go into a collection, click a product in there and when you are viewing the product the button will come up. 

So for example, I go into LG > G8 > Select any product > Product Page.

This is where the back button is displayed.

0 Likes
hash777
Shopify Partner
164 9 23

@GetOrchard  Yes pls send me screenshot of code where you are editing the code.

0 Likes
GetOrchard
Excursionist
33 2 5

f.png

0 Likes
hash777
Shopify Partner
164 9 23

@GetOrchard  ok you want button like this . RIGHT ?

8.PNG

0 Likes
GetOrchard
Excursionist
33 2 5

Yes exactly!!!

0 Likes