Hi there,
I’m trying to add a hover over image action in the studio theme, but very new to the liquid coding thing. I would like to add an add to cart/size option/color option button when mouse hover over image. What is the best way to do this?
Thank you
Hi @amarquis30 ,
Please follow the steps below:
- Step 1: Go to snippets > card-product.liquid file, in line 82 and add code:
Code:
Add to cart
- Step 2: Go to Assets > base.css and paste this at the bottom of the file:
.card .button--cart {
width: 100%;
position: absolute;
bottom: 0;
z-index: 999;
left: 0;
opacity: 0;
transition: all .5s ease;
text-decoration: none !important;
}
.card:hover .button--cart,
.card:focus .button--cart {
opacity: 1 !important;
}
Hope it helps!
Hi
Thank you for your help, this code did help a bit. It didn’t solve the whole problem thought since i’m looking for a solution where a box appears halfway when I hover over image and offers size and colour options in addition to the add to cart button.
Hi @amarquis30 ,
You want to add option choose variant and add to cart directly at product item. it will be a complicated requirement as Studio Theme doesn’t support this, you need to change more about Liquid and JS code. It will be difficult for someone to guide you through it in detail, you can only hire a professional for this.
Or you can install some app for it, refer https://apps.shopify.com/collections-add-to-cart
If it helped you solve your issue, please mark it as a solution. Thank you and good luck.