Home Forums WoodMart support forum Adjust add to cart button layout on mobile product page

Adjust add to cart button layout on mobile product page

Viewing 21 posts - 1 through 21 (of 21 total)
  • Author
    Posts
  • #587695

    agenciawebinfinite
    Participant

    Hello!

    A while ago you helped with some css code to improve the buttons on the Mobile product page.

    /* Justificar Botões Comprar no Mobile */
    form.cart :where(.single_add_to_cart_button,.wd-buy-now-btn,.quantity) {
        flex: 0 0 100%;
    }

    But I need to make this even better, we need to have this screen with more optimized space, see how it is:
    https://www.boottrainingbrasil.com.br/produto/combo-b-day-2/
    https://imgur.com/9sIDr0f

    I need the black button (add to cart) to be next to the quantity button, can you help?

    Something like this: (I edited it in paint):
    https://imgur.com/svfwfbe

    Can you help with this?

    Thank you

    #587805

    Hello,

    Please use the below custom CSS code and paste it to Theme Settings >> Custom CSS >> Global CSS section:

    .single-product button#wd-add-to-cart {
        flex: 1 1 100%;
    }

    Best Regards.

    #587859

    agenciawebinfinite
    Participant

    HI

    I put the code you mentioned, but it looked like this:
    https://imgur.com/g6aTz8d

    I want the black button to fill the entire space.

    Note: remember that I want to make this adjustment only for Mobile, on Desktop it is already ok, I have these 2 codes that you gave me to adjust the button on Desktop:

    1-`/* Justificar os Botões Comprar na Página do Produto */

    .woocommerce-variation-add-to-cart .single_add_to_cart_button,
    .woocommerce-variation-add-to-cart .wd-buy-now-btn {
    flex-grow: 1;
    flex-basis: calc(50% – 52px);
    }`

    2- `/* Justificar os Botões Comprar na Página do Produto Simples */
    .summary-inner form.cart :where(.single_add_to_cart_button, .wd-buy-now-btn) {
    flex: 1 1 auto;
    }`

    How can I adjust the code to only work on Mobile?

    #588365

    Hello,

    Please try to use the below custom CSS code and paste this code in the Theme Settings >> Custom CSS >> CSS for Mobile section:

    form.cart :where(.single_add_to_cart_button,.wd-buy-now-btn,.quantity) {
        flex: 0 0 auto;
    }
    
    .single-product button#wd-add-to-cart {
        flex: 0 0 100%;
        max-width: 93%;
    }

    Best Regards.

    #588384

    agenciawebinfinite
    Participant

    Hello!

    The code is not yet valid, see, I’m testing it on this other website of mine:
    https://www.bhlfitness.com.br/produto/proteina-isolada-e-hidrolisada-true-whey-837g-true-source/

    https://imgur.com/jhphWd0

    Black button still doesn’t fill, and green one is on one side of the screen.

    It needs to be 100 and not 93% for the green button to be ok: max-width: 100%;

    I made some adjustments to your code, and visually it looks better, but there’s still a big gap here:

    /* Justificar Botões Comprar no Mobile */
    form.cart :where(.single_add_to_cart_button,.wd-buy-now-btn,.quantity) {
        flex: 1 0 auto;
    }
    
    .single-product button#wd-add-to-cart {
        flex: 0 0 100%;
        max-width: 100%;
    }

    https://imgur.com/JN3HY79

    And I also don’t know if this code can cause any other layout problem, I don’t understand lol, I was just testing it.

    #588389

    agenciawebinfinite
    Participant

    It seems that the space in the middle is due to the quantity element, see:

    https://imgur.com/HC0kogR
    Can you adjust the extra space it’s taking up? That way, the black add to cart button will fit better.

    #588522

    Hello,

    Sorry to hear about the inconvenience. Kindly, please share your Site WP-ADMIN Login details in the Private Content field so that we can check this concern on your Site and help you out accordingly.

    Best Regards.

    #588526

    agenciawebinfinite
    Participant

    Yes.

    #588679

    Hello,

    I am not able to access the site, have you enabled any IP restrictions from the server to access the site?

    https://ibb.co/z5tH24N

    Best Regards.

    #589111

    agenciawebinfinite
    Participant

    I have a rule in the Cloudflare firewall to block some countries that generate a lot of attack logs.

    I just disabled the rule so you can access it.

    What is your country of origin?

    #589169

    Hello,

    I access the site from Pakistan.

    Best Regards.

    #589268

    agenciawebinfinite
    Participant

    Were you able to access it? Did the adjustment work?

    #589336

    Hello,

    Yes, I am able to access the site now but the logins are not correct: https://ibb.co/sqNgdCp

    Best Regards.

    #589376

    agenciawebinfinite
    Participant

    Yes, that’s right, I just tested it, and I copied it from the form.

    Could you copy and paste the password? And check that there are no spaces?

    Here it is again:

    #589435

    Hello,

    Please use the below custom CSS code and paste it to Theme Settings >> Custom CSS >> Mobile CSS section:

    .single-product .woocommerce-variation-add-to-cart.variations_button.woocommerce-variation-add-to-cart-disabled .quantity {
        flex: 0 0 auto;
    }

    Best Regards.

    #589735

    agenciawebinfinite
    Participant

    Hello, I removed the previous codes and included this one and it didn’t work.

    I noticed that I have to leave them all together?

    In other words, for this adjustment to work, I actually need to include this entire block of code?

    /* Justificar Botões Comprar no Mobile */
    form.cart :where(.single_add_to_cart_button,.wd-buy-now-btn,.quantity) {
        flex: 1 0 auto;
    }
    .single-product button#wd-add-to-cart {
        flex: 0 0 100%;
        max-width: 100%;
    }
    .single-product .woocommerce-variation-add-to-cart.variations_button.woocommerce-variation-add-to-cart-disabled .quantity {
        flex: 0 0 auto;
    }
    #589736

    agenciawebinfinite
    Participant

    I replicated it on another site with this entire block and it worked.

    Thank you very much.

    #589737

    agenciawebinfinite
    Participant

    There is a small problem:

    -> When selecting the variation, the adjustment is “lost” and the space between the quantity and the button returns. Can you check and test?

    #589865

    Hello,

    Please use the below code as well:

    .single-product .woocommerce-variation-add-to-cart.variations_button.woocommerce-variation-add-to-cart-enabled .quantity {
        flex: 0 0 auto !important;
    }

    Best Regards.

    #589868

    agenciawebinfinite
    Participant

    Now it’s perfect, thank you very much

    You can finalize the ticket.

    #589870

    Most Welcome!!!.

    I’m so happy to hear you are pleased with the Theme and Support. XTEMOS strives to deliver the best customer experience, and it makes our day to hear we have accomplished that.

    We count ourselves lucky to have you as a customer. You can always reach us at any time. We are always here to help you.

    Thanks for contacting us.
    Have a great day.

    Topic Closed.
    Best Regards.

Viewing 21 posts - 1 through 21 (of 21 total)

The topic ‘Adjust add to cart button layout on mobile product page’ is closed to new replies.