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
- This topic has 20 replies, 2 voices, and was last updated 4 months ago by Aizaz Imtiaz Awan.
-
AuthorPosts
-
August 2, 2024 at 9:47 pm #587695
agenciawebinfiniteParticipantHello!
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/9sIDr0fI 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/svfwfbeCan you help with this?
Thank you
August 3, 2024 at 8:15 pm #587805
Aizaz Imtiaz AwanKeymasterHello,
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.
August 4, 2024 at 5:33 pm #587859
agenciawebinfiniteParticipantHI
I put the code you mentioned, but it looked like this:
https://imgur.com/g6aTz8dI 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?
August 6, 2024 at 10:43 am #588365
Aizaz Imtiaz AwanKeymasterHello,
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.
August 6, 2024 at 11:31 am #588384
agenciawebinfiniteParticipantHello!
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/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%; }
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.
August 6, 2024 at 11:39 am #588389
agenciawebinfiniteParticipantIt 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.August 6, 2024 at 5:07 pm #588522
Aizaz Imtiaz AwanKeymasterHello,
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.
August 6, 2024 at 5:12 pm #588526
agenciawebinfiniteParticipantYes.
August 7, 2024 at 12:34 pm #588679
Aizaz Imtiaz AwanKeymasterHello,
I am not able to access the site, have you enabled any IP restrictions from the server to access the site?
Best Regards.
August 8, 2024 at 7:48 pm #589111
agenciawebinfiniteParticipantI 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?
August 9, 2024 at 9:39 am #589169
Aizaz Imtiaz AwanKeymasterHello,
I access the site from Pakistan.
Best Regards.
August 9, 2024 at 1:43 pm #589268
agenciawebinfiniteParticipantWere you able to access it? Did the adjustment work?
August 9, 2024 at 4:51 pm #589336
Aizaz Imtiaz AwanKeymasterHello,
Yes, I am able to access the site now but the logins are not correct: https://ibb.co/sqNgdCp
Best Regards.
August 9, 2024 at 7:49 pm #589376
agenciawebinfiniteParticipantYes, 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:
August 10, 2024 at 11:56 am #589435
Aizaz Imtiaz AwanKeymasterHello,
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.
August 12, 2024 at 6:21 pm #589735
agenciawebinfiniteParticipantHello, 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; }
August 12, 2024 at 6:24 pm #589736
agenciawebinfiniteParticipantI replicated it on another site with this entire block and it worked.
Thank you very much.
August 12, 2024 at 6:28 pm #589737
agenciawebinfiniteParticipantThere 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?
August 13, 2024 at 12:34 pm #589865
Aizaz Imtiaz AwanKeymasterHello,
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.
August 13, 2024 at 12:52 pm #589868
agenciawebinfiniteParticipantNow it’s perfect, thank you very much
You can finalize the ticket.
August 13, 2024 at 12:53 pm #589870
Aizaz Imtiaz AwanKeymasterMost 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. -
AuthorPosts
The topic ‘Adjust add to cart button layout on mobile product page’ is closed to new replies.
- You must be logged in to create new topics. Login / Register