I have not been able to edit the buttons as there is not way to use visual composer for the category page.
I want to enter the name of each product instead of 'view product' which is currently on the button.
Screenshot:
I have not been able to edit the buttons as there is not way to use visual composer for the category page.
I want to enter the name of each product instead of 'view product' which is currently on the button.
Screenshot:
you can change the woocommerce button name (View products,Buy product,Add to cart,Select options,Read more) by using below function.
Add below in theme function.php file
add_filter( 'woocommerce_product_add_to_cart_text' , 'sm_woocommerce_product_add_to_cart_text' );
/**
* sm_woocommerce_product_add_to_cart_text
*/
function sm_woocommerce_product_add_to_cart_text() {
global $product;
$product_type = $product->product_type;
$id = $product->get_id();
$product = wc_get_product( $id );
switch ( $product_type ) {
case 'external':
return __( 'Buy product', 'woocommerce' );
break;
case 'grouped':
//return __( 'View products', 'woocommerce' );
return __( $product->get_title(), 'woocommerce' );
break;
case 'simple':
return __( 'Add to cart', 'woocommerce' );
break;
case 'variable':
return __( 'Select options', 'woocommerce' );
break;
default:
return __( 'Read more', 'woocommerce' );
}
}
You can find the needed text in the category.php file. Sometimes the text is hard coded in the .php files.
For easy String search, you can use this plugin https://wordpress.org/plugins/string-locator/ the plugin find the necessary text and the hard coded location where it is.