Site logo

Archived topic

Giant add to cart button

11 replies · Started by Pedro on March 31, 2019

Viewing posts 1–12 of 12

Hi there,

Try this:

.woocommerce div.product form.cart div.quantity {
    float: none;
    width: 100%;
    margin-right: 0;
}

.woocommerce div.product form.cart .button {
    width: 100%;
    margin-top: 10px;
    padding: 20px;
}

Hi there,

add this CSS:

@media (max-width: 768px) {
    .do-quantity-buttons div.quantity {
        justify-content: flex-start !important;
    }
}

Hello david! It worked perfectly! Thank you!

Glad we could be of help.

Hi there I found this but the add to cart button seems to display strangely on mobile the text moves down below centre and the button does not have as much height as the desktop view.

I am trying to do something similar and hope you can help. Rather than have the add to cart button full width and below the quantity field, I would like to do the following:

1) on the desktop I just want the add to cart button to fill the rest of the space to the right of it (within the .single_variation_wrap div) so it fills all the way to the right.
2) on mobile I would like the buy button to be full width and below the quantity, but with the quantity to be full with as well.

You can see how it is currently on our site here: https://www.supereight.net/shop/adidas-matchbreak-super-shoes-core-black-white-gold-metallic/

Many thanks
Sam

Hi there,

1. This CSS:

.woocommerce.single-product div.product form.cart .button {
    flex: 1;
}

2. Try this:

@media (max-width: 768px) {
    .woocommerce div.product form.cart div.quantity {
        flex: 1 0 100%;
    }
    .woocommerce div.product form.cart div.quantity a {
        max-width: unset;
        flex: 0 0 25%;
    }
    .woocommerce div.product form.cart div.quantity input {
        max-width: unset;
        flex: 0 0 50%;
    }
}

Wow! thanks so much, that did it!

One minor tweak... for the quantity input on mobile you gave it equal widths for each part "33.33%".

Is it possible to give the number 50% and the plus and minus as 25%?

I adjusted the code above.

Awesome! You guys are the best.

Glad to be of help. Nice looking site.

This archived topic is closed to new replies.