Change "Add to Cart" button (when mouse hover) on product page
-
I am using the latest woocommerce version and I need to change the ‘Add to cart’ button on Woocommerce product page to click through to the actual products details for single products and with the name changed for example to “View More” (with translation enabled aswell).
I tried using this code looking into another forums:
//Button remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10 ); add_action( 'woocommerce_after_shop_loop_item', 'my_woocommerce_template_loop_add_to_cart', 10 ); function my_woocommerce_template_loop_add_to_cart() { global $product; echo '<form action="' . esc_url( $product->get_permalink( $product->id ) ) . '" method="get"> <button type="submit" class="single_add_to_cart_button button alt">' . __('More Detail', 'woocommerce') . '</button> </form>'; }
Tested, but that code is just creating another button below each product and is not changing the hover button (nor redirecting it to the actual product details) over single products. I just need to change the “Add to Cart” button that is already showing up on single products when hover on the products page.
Could you help me?
Thanks in advance!
- The topic ‘Change "Add to Cart" button (when mouse hover) on product page’ is closed to new replies.