This topic has 10 replies, 2 voices, and was last updated 8 years, 8 months ago ago by Eva Kemp
I would like to display the add to cart button in the same line as the select with varations, not below it. How to achieve that?
Hello,
Please give us your site name.
Regards,
Eva Kemp.
I attach a link to my single product page. I know I can overwrite variable.php template to do that, but I don’t know how.
My goal is to display the add to cart button in the same line as select for variations, on the right side.
I was trying to add the button to table class=””variations”, but without success. The button keeps displaying below the select.
Hello,
Please add this code in Theme Options > Styling > Custom CSS > Custom CSS for desktop:
.product-information table.variations, .product-information form.variations_form.cart .single_variation_wrap {
width: 40% !important;
}
.product-information .cart {
display: inline-flex !important;
}
Regards,
Eva Kemp.
Thank you. It’s working, but when I select a variation, the button is moved down by a text: “In stock” or “Items left: 1”. How can I move this message below the add to cart button?
Hello,
In this case please also use this css code:
.woocommerce-variation-add-to-cart.variations_button {
margin-top: -90px;
}
.woocommerce-variation-availability {
margin-top: 50px;
margin-left: 30px;
}
Regards,
Eva Kemp.
OK, but when neither of the varations is selected (woocommerce-variation single_variation: display: none), then the button is going up.
Hello,
Try to remove the previous code:
.woocommerce-variation-add-to-cart.variations_button {
margin-top: -90px;
}
.woocommerce-variation-availability {
margin-top: 50px;
margin-left: 30px;
}
and use this code:
.woocommerce-variation-availability {
margin-top: 50px;
position: absolute;
}
Regards,
Eva Kemp.
Works like a charm. Thank you.
Hello,
You’re welcome.
Regards,
Eva Kemp.
The issue related to '‘Add to cart button – single product page’' has been successfully resolved, and the topic is now closed for further responses