woocommerce_before_add_to_cart_button

woocommerce_before_add_to_cart_button

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

See hook in core

Displaying hooks found in version: woocommerce.9.8.1

do_action('woocommerce_before_add_to_cart_button') is found 7 times:

  • /src/Blocks/BlockTypes/AddToCartWithOptions.php line 131
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
         * Hook: woocommerce_before_add_to_cart_button.
         *
         * @since 1.5.0
         */
        do_action( 'woocommerce_before_add_to_cart_button' );
    } elseif ( ProductType::EXTERNAL === $product_type ) {
        /**
         * Hook: woocommerce_before_add_to_cart_button.
         *
         * @since 1.5.0
         */
  • /src/Blocks/BlockTypes/AddToCartWithOptions.php line 138
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
         * Hook: woocommerce_before_add_to_cart_button.
         *
         * @since 1.5.0
         */
        do_action( 'woocommerce_before_add_to_cart_button' );
    } elseif ( ProductType::GROUPED === $product_type ) {
        /**
         * Hook: woocommerce_before_add_to_cart_button.
         *
         * @since 1.5.0
         */
  • /src/Blocks/BlockTypes/AddToCartWithOptions.php line 145
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
         * Hook: woocommerce_before_add_to_cart_button.
         *
         * @since 1.5.0
         */
        do_action( 'woocommerce_before_add_to_cart_button' );
    } elseif ( ProductType::VARIABLE === $product_type ) {
        /**
         * Hook: woocommerce_before_variations_form.
         *
         * @since 2.4.0
         */
  • /templates/single-product/add-to-cart/external.php line 23
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    do_action( 'woocommerce_before_add_to_cart_form' ); ?>
     
    <form class="cart" action="<?php echo esc_url( $product_url ); ?>" method="get">
        <?php do_action( 'woocommerce_before_add_to_cart_button' ); ?>
     
        <button type="submit" class="single_add_to_cart_button button alt<?php echo esc_attr( wc_wp_theme_get_element_class_name( 'button' ) ? ' ' . wc_wp_theme_get_element_class_name( 'button' ) : '' ); ?>"><?php echo esc_html( $button_text ); ?></button>
     
        <?php wc_query_string_form_fields( $product_url ); ?>
     
        <?php do_action( 'woocommerce_after_add_to_cart_button' ); ?>
  • /templates/single-product/add-to-cart/grouped.php line 136
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    <input type="hidden" name="add-to-cart" value="<?php echo esc_attr( $product->get_id() ); ?>" />
     
    <?php if ( $quantites_required && $show_add_to_cart_button ) : ?>
     
        <?php do_action( 'woocommerce_before_add_to_cart_button' ); ?>
     
        <button type="submit" class="single_add_to_cart_button button alt<?php echo esc_attr( wc_wp_theme_get_element_class_name( 'button' ) ? ' ' . wc_wp_theme_get_element_class_name( 'button' ) : '' ); ?>"><?php echo esc_html( $product->single_add_to_cart_text() ); ?></button>
     
        <?php do_action( 'woocommerce_after_add_to_cart_button' ); ?>
     
    <?php endif; ?>
  • /templates/single-product/add-to-cart/simple.php line 33

    Share this:

  • /templates/single-product/add-to-cart/variation-add-to-cart-button.php line 15

    global $product;
    ?>