Debut theme:- Move 'back to objects button' above 'you may like this'

Solved
ibarry3393
Excursionist
16 0 5

Hi there,

I want to move the below back button above 'you may also like this'. Can someone help me with this?

Store theme:- Debut

URL:-https://gallery-333.myshopify.com/admin/themes/124321857692/editor?previewPath=%2Fproducts%2Ftranqui...

 

Screen Shot 2021-10-15 at 2.41.14 PM.png

Accepted Solution (1)
diego_ezfy
Shopify Partner
2880 549 826

This is an accepted solution.

@ibarry3393,

1. In your Shopify Admin go to online store > themes > actions > edit code
2. In your theme.liquid file, find the </body> (press CTRL + F or command + F on Mac)
3. paste this code right above the </body> tag:

<script>
function moveButton(){

try{
var $child = document.querySelector(`#backToCollection`);
var $parent = document.querySelector(`#shopify-section-product-recommendations`);

if (!$child || !$parent){
    return;
}

var moveDOMElement = (parent,child) => parent.appendChild(child)
moveDOMElement($child, $parent);
}catch(err){}
}


moveButton();
</script>



Kind regards,
Diego

View solution in original post

Replies 5 (5)
suyash1
Shopify Partner
8304 1027 1358

@ibarry3393- if the button is part of this section then it can be moved, also can you please provide me the preview link of the page? current link asking or login

You are welcome to contact me - suyash.patankar@gmail.com, My timezone is GMT+5:30,to build shopify pages use pagefly

Support me 🙂
diego_ezfy
Shopify Partner
2880 549 826

This is an accepted solution.

@ibarry3393,

1. In your Shopify Admin go to online store > themes > actions > edit code
2. In your theme.liquid file, find the </body> (press CTRL + F or command + F on Mac)
3. paste this code right above the </body> tag:

<script>
function moveButton(){

try{
var $child = document.querySelector(`#backToCollection`);
var $parent = document.querySelector(`#shopify-section-product-recommendations`);

if (!$child || !$parent){
    return;
}

var moveDOMElement = (parent,child) => parent.appendChild(child)
moveDOMElement($child, $parent);
}catch(err){}
}


moveButton();
</script>



Kind regards,
Diego

ibarry3393
Excursionist
16 0 5

Thanks so much @diego_ezfy !

Zworthkey
Shopify Partner
5581 642 1552

Hii, @ibarry3393 
Kindly share your store password so,
I can solve it perfectly.
Thank You.

ibarry3393
Excursionist
16 0 5

Done thanks guys!