Login WordPress Dashboard > Appearance > Theme File Editor > Select Active Theme > Click on Functions.php
Copy This PHP Code and Paste it in Functions.php & Click Update File
add_filter( 'woocommerce_loop_add_to_cart_link', 'add_to_cart_dofollow', 10, 2 );
function add_to_cart_dofollow($html, $product){
$html = sprintf( '%s',
esc_url( $product->add_to_cart_url() ),
esc_attr( isset( $quantity ) ? $quantity : 1 ),
esc_attr( $product->get_id() ),
esc_attr( $product->get_sku() ),
esc_attr( isset( $class ) ? $class : 'button' ),
esc_html( $product->add_to_cart_text() )
);
return $html;
}
Congrats! You fix the issue. If it’s really helpful for you please just give a thumsup
© 2020-2023 Mijan Pro | All Rights Reserved.