Skip to content

Instantly share code, notes, and snippets.

@elicus
Last active December 28, 2020 06:41
Show Gist options
  • Save elicus/05fdf2e45088ef60c47023e56cd6bbdd to your computer and use it in GitHub Desktop.
Save elicus/05fdf2e45088ef60c47023e56cd6bbdd to your computer and use it in GitHub Desktop.
/* Ajax Add to Cart button */
if ( ! function_exists( 'de_add_to_cart_button' ) ) {
function de_add_to_cart_button(){
if ( true === et_get_option( 'add_to_cart', false ) ) {
add_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 20 );
}
}
add_action( 'init', 'de_add_to_cart_button' );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment