Home › Forums › WoodMart support forum › WooCommerce Extra Product Options error in Product Archiv Page › Reply To: WooCommerce Extra Product Options error in Product Archiv Page
October 8, 2022 at 2:51 am
#411922
Elise Noromit
Member
Hello,
Please add this code to the functions.php of the child theme:
if ( ! function_exists( 'wd_update_add_to_cart_btn' ) ) {
function wd_update_add_to_cart_btn() {
remove_action( 'woodmart_add_loop_btn', 'woocommerce_template_loop_add_to_cart', 10 );
add_action( 'woodmart_add_loop_btn', function () {
global $product;
echo '<a href="' . $product->get_permalink() . '" class="button product_type_variable add_to_cart_button add-to-cart-loop" rel="nofollow"><span>' . esc_html__('add_to_cart', 'woodmart' ) . '</span></a>';
}, 15 );
}
add_action( 'wp', 'wd_update_add_to_cart_btn', 15 );
}
Best Regards