woocommerce_add_to_cart_form_action

woocommerce_add_to_cart_form_action

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: filter
See hook in action

See hook in core

Displaying hooks found in version: woocommerce.9.3.3

apply_filters('woocommerce_add_to_cart_form_action') is found 3 times:

  • /templates/single-product/add-to-cart/grouped.php line 24

    global $product, $post;

    do_action( ‘woocommerce_before_add_to_cart_form’ ); ?>

  • /templates/single-product/add-to-cart/simple.php line 32

    if ( $product->is_in_stock() ) : ?>

    Share this:

  • /templates/single-product/add-to-cart/variable.php line 28
    $variations_attr = function_exists( 'wc_esc_json' ) ? wc_esc_json( $variations_json ) : _wp_specialchars( $variations_json, ENT_QUOTES, 'UTF-8', true );
    
    do_action( 'woocommerce_before_add_to_cart_form' ); ?>
    
    <form class="variations_form cart" action="<?php echo esc_url( apply_filters( 'woocommerce_add_to_cart_form_action', $product->get_permalink() ) ); ?>" method="post" enctype='multipart/form-data' data-product_id="<?php echo absint( $product->get_id() ); ?>" data-product_variations="<?php echo $variations_attr; // WPCS: XSS ok. ?>">
    	<?php do_action( 'woocommerce_before_variations_form' ); ?>
    
    	<?php if ( empty( $available_variations ) && false !== $available_variations ) : ?>
    		<p class="stock out-of-stock"><?php echo esc_html( apply_filters( 'woocommerce_out_of_stock_message', __( 'This product is currently out of stock and unavailable.', 'woocommerce' ) ) ); ?></p>
    	<?php else : ?>
    		<table class="variations" cellspacing="0" role="presentation">
    
  • See this hook used in plugins: