Site icon Experience Wordpress Developer Online – Design Develop and Maintenance Support

Change Add to cart button on the WooCommerce Shop and Archive page

Want to change ADD TO CART button on Woocomme Shop and Category Archive Page ? and not getting any help from Woocommerce document well, go ahead and see it is very easy to Change Add to cart button on the WooCommerce Shop and Category Archive page

Add following code to your active theme functions.php and don’t forget to make a change in Text for Button or Anchor link. If you not familiar with Php Programming code and looking for plugin take a look Change add to cart button text using Plugin

/* 1 - 1st Remove ADD TO CART Button from Shop and Category Archive page */
function remove_add_to_cart_button(){
remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10 );
}
add_action('init','remove_add_to_cart_button');


/* 2 - Add New Anchor Link Or Button with your Text */
add_action('woocommerce_after_shop_loop_item','replace_add_to_cart_button');
function replace_add_to_cart_button() {
global $product;
$link = $product->get_permalink();
echo '<a href="' . esc_attr($link) . '">View Listing</a>';
// if you want to show here Button than replace above 1 line code by below 
 echo '<form action="' . esc_url($link) . '" method="get"><button class="single_add_to_cart_button button alt" type="submit">' . __('View More', 'woocommerce') . '</button></form>'; }
 

To Change “ADD To CART” Button text only on Product Detail Page

#
add_filter( 'woocommerce_product_single_add_to_cart_text', 'wc_wdo_custom_single_addtocart_text' );
function wc_wdo_custom_single_addtocart_text() {
    return "Buy Now"; //  Change "Buy Now" text by your text you want to see
}

Other Helpful resources
Change add to cart button text in Woocommerce

Change add to cart button text using a plugin

To WC Custom Add to Cart labels plugin in WordPress make your task easy to Change WooCommerce Add to cart button text without work to any programming code.
To WC Custom Add to Cart labels is a free plugin allows you to change “add to cart” button labels on all single product pages (Product Detail page) and also on archive/shop page (Product Category page) according to your need.

If you get it done by any other method please share with us via the comment box, also if explain a solution in the current article not work for you and looking help from our Experience WooCommerce Developer don’t hesitate to contact us through Online Chat, Contact Us form or Email

Exit mobile version