We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more

How to change position of buy button on products from collection page

Solved

How to change position of buy button on products from collection page

CAVinhus
Tourist
5 0 1

Hello

I am looking to change the position of the buy now button on my products. I already have a hover effect on it and wish for the button to be in the middle of the product image so when you hover over the product the buy button appears in the middle of the products image.

CAVinhus_0-1750667353429.png

The code I used for the hover effect is:

.product-card-wrapper .quick-add {
display: none; /* Hide button initially */
}
.product-card-wrapper:hover .quick-add {
display: block; /* Show button on hover */
}
.product-card {
/* Other styles */
text-align: center; /* Centers the button */
}

Accepted Solution (1)
Dan-From-Ryviu
Shopify Partner
12073 2359 2539

This is an accepted solution.

Please update this code from this 

.product-card-wrapper:hover .quick-add {
display: block; /* Show button on hover */

To this 

.product-card-wrapper:hover .quick-add {
    display: block;
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -40%);
    width: 100%;
}

- Helpful? Like & Accept solution!
- Ryviu - Product Reviews & QA app: Collect customer reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Dhgate and CSV.
- Lookfy Gallery: Lookbook Image - Gain customers with photo gallery, video & shoppable image.
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- Enjoy 1 month of Shopify for $1. Sign up now.

View solution in original post

Replies 5 (5)

Dan-From-Ryviu
Shopify Partner
12073 2359 2539

Hi @CAVinhus 

Could you share the link to your page? 

- Helpful? Like & Accept solution!
- Ryviu - Product Reviews & QA app: Collect customer reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Dhgate and CSV.
- Lookfy Gallery: Lookbook Image - Gain customers with photo gallery, video & shoppable image.
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- Enjoy 1 month of Shopify for $1. Sign up now.

CAVinhus
Tourist
5 0 1

https://cavinhus.dk/

pass: auskay

Dan-From-Ryviu
Shopify Partner
12073 2359 2539

This is an accepted solution.

Please update this code from this 

.product-card-wrapper:hover .quick-add {
display: block; /* Show button on hover */

To this 

.product-card-wrapper:hover .quick-add {
    display: block;
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -40%);
    width: 100%;
}

- Helpful? Like & Accept solution!
- Ryviu - Product Reviews & QA app: Collect customer reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Dhgate and CSV.
- Lookfy Gallery: Lookbook Image - Gain customers with photo gallery, video & shoppable image.
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- Enjoy 1 month of Shopify for $1. Sign up now.

CAVinhus
Tourist
5 0 1

Thank you so much this worked! Do you also know how I changed the text on the button?

Dan-From-Ryviu
Shopify Partner
12073 2359 2539

You can change text from your store admin > Sales channels > Online Store > Themes > click "..." in Current theme > Edit default theme content, search and change that text. 

- Helpful? Like & Accept solution!
- Ryviu - Product Reviews & QA app: Collect customer reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Dhgate and CSV.
- Lookfy Gallery: Lookbook Image - Gain customers with photo gallery, video & shoppable image.
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- Enjoy 1 month of Shopify for $1. Sign up now.