Home › Forums › WoodMart support forum › Modifying “Add to Cart” Button Behavior in WooCommerce
Modifying “Add to Cart” Button Behavior in WooCommerce
- This topic has 4 replies, 2 voices, and was last updated 5 months ago by
Hung Pham.
-
AuthorPosts
-
March 6, 2025 at 12:20 pm #643359
AmitParticipantHello Support Team,
I would like to modify the WooCommerce “Add to Cart” button behavior as follows:
1. When the “Add to Cart” button is clicked, the selected item should be added to the cart, and the button should change to a quantity selector with plus (+) and minus (-) buttons.
2. The quantity in the cart should be adjustable using the plus/minus buttons, without displaying a “View Cart” button.
3. If the quantity is reduced to zero, the button should revert to the original “Add to Cart” state.
For reference, here are examples of the desired functionality:Onsitego Example – https://onsitego.com/ac-service-repair-delhi-noida-gurgaon
Woolworths Example – https://www.woolworths.com.au/shop/browse/fruit-veg/fruit
Could you please guide me on how to achieve this? I appreciate your help.Best regards,
AmitMarch 6, 2025 at 12:32 pm #643362
AmitParticipantIf this is not possible by default, could you please provide some jQuery or
functions.php
code to hide or unhide the button as follows?–
.cart .quantity
should be hidden by default.
– When I click the “Add to Cart” button and one quantity is successfully added,.cart .single_add_to_cart_button
should be hidden, and.cart .quantity
should be shown.
– If the quantity is decreased to zero,.cart .quantity
should be hidden, and.cart .single_add_to_cart_button
should be shown again.March 7, 2025 at 6:51 am #643677
Hung PhamKeymasterHi Amit,
Thanks for reaching to us.
Unfortunately, that is not possible, customization is out of our basic support. You need to find a third-party plugin to achieve more functionality that best suits you.
Regards,
March 7, 2025 at 1:14 pm #643808
AmitParticipantThis functionality is most suitable for small spaces where the quantity selection and “Add to Cart” button should be merged into one. It could be beneficial for WoodMart. Don’t you think?
March 9, 2025 at 11:48 am #644223
Hung PhamKeymasterHi Amit,
Thanks for your patience.
Currently, WoodMart has an option
Quantity input on product
in Theme Settings > Product archive > Products styles https://prnt.sc/LqS-7DFIDKMg andNo action
option for theAction after add to cart
https://prnt.sc/1ElD1GWQz_vvWhile auto update quantities works for Cart page only.
Hope it helps.
Regards,
-
AuthorPosts
- You must be logged in to create new topics. Login / Register