[Resolved] Giant add to cart button

Home Forums Support [Resolved] Giant add to cart button

Home Forums Support Giant add to cart button

  • This topic has 11 replies, 4 voices, and was last updated 4 years ago by David.
Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #855102
    Pedro

    Hello! I would like the “add to cart” button on the product page to occupy the full width and be located just below the product quantity.

    This is in both versions, mobile and desktop.

    I send you a screenshot of how my site looks at the moment: https://www.dropbox.com/s/wj3dyca42fw45r1/Screenshot_2019-03-31-12-53-07-123_com.android.chrome.png?dl=0

    How can I do it?

    Thank you!!

    #855300
    Tom
    Lead Developer
    Lead Developer

    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;
    }
    #855342
    Pedro

    Hello Tom!

    It worked very well, however now the quantity section is aligned to the right.

    I would like this to not happen, I just want the add button to the cart to be bigger.

    You can see a screenshot here:

    https://www.dropbox.com/s/gwbbfbnzfsu3azu/Screenshot_2019-03-31-21-44-12-297_com.android.chrome.png?dl=0

    #855480
    David
    Staff
    Customer Support

    Hi there,

    add this CSS:

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

    Hello david! It worked perfectly! Thank you!

    #856192
    David
    Staff
    Customer Support

    Glad we could be of help.

    #1242795
    Sam

    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

    #1242912
    David
    Staff
    Customer Support

    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%;
        }
    }
    #1242929
    Sam

    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%?

    #1243100
    David
    Staff
    Customer Support

    I adjusted the code above.

    #1243109
    Sam

    Awesome! You guys are the best.

    #1243113
    David
    Staff
    Customer Support

    Glad to be of help. Nice looking site.

Viewing 12 posts - 1 through 12 (of 12 total)
  • You must be logged in to reply to this topic.