Last active
December 2, 2023 18:59
-
-
Save softiconic/6b4be169c0e795dc1f29bf809ba2d9f3 to your computer and use it in GitHub Desktop.
In a WooCommerce product page, implement AJAX for the "Add to Cart" functionality.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Remove old button which submiting form: | |
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 30 ); | |
//Add ajax-link from archive page to single product page: | |
add_action( 'woocommerce_single_product_summary', 'woocommerce_template_loop_add_to_cart', 30 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment