woocommerce_ajax_added_to_cart

woocommerce_ajax_added_to_cart

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: action

See hook in core

Displaying hooks found in version: woocommerce.9.8.1

do_action('woocommerce_ajax_added_to_cart') is found 1 times:

  • /includes/class-wc-ajax.php line 482
    478
    479
    480
    481
    482
    483
    484
    485
    486
    487
    488
    }
     
    if ( $passed_validation && false !== WC()->cart->add_to_cart( $product_id, $quantity, $variation_id, $variation ) && ProductStatus::PUBLISH === $product_status ) {
     
        do_action( 'woocommerce_ajax_added_to_cart', $product_id );
     
        if ( 'yes' === get_option( 'woocommerce_cart_redirect_after_add' ) ) {
            wc_add_to_cart_message( array( $product_id => $quantity ), true );
        }
     
        self::get_refreshed_fragments();