Adding AJAX classes to add-to-cart buttons.

Need to add in the default woocommerce ajax and add to cart classes for ajax to work.
This commit is contained in:
Jason King 2017-02-03 12:13:31 +10:30 committed by GitHub
parent c0ea2d9f6e
commit 527ff7fc5a
1 changed files with 1 additions and 1 deletions

View File

@ -23,7 +23,7 @@ if ( ! defined( 'ABSPATH' ) ) {
global $product;
echo apply_filters( 'woocommerce_loop_add_to_cart_link',
sprintf( '<a rel="nofollow" href="%s" data-quantity="%s" data-product_id="%s" data-product_sku="%s" class="btn btn-outline-primary btn-block">%s</a>',
sprintf( '<a rel="nofollow" href="%s" data-quantity="%s" data-product_id="%s" data-product_sku="%s" class="add_to_cart_button ajax_add_to_cart btn btn-outline-primary btn-block">%s</a>',
esc_url( $product->add_to_cart_url() ),
esc_attr( isset( $quantity ) ? $quantity : 1 ),
esc_attr( $product->id ),