dd_filter( 'woocommerce_product_add_to_cart_text' , 'custom_woocommerce_product_add_to_cart_text' ); /* * custom_woocommerce_template_loop_add_to_cart**/ function custom_woocommerce_product_add_to_cart_text() { global $product; $product_type = $product->get_type(); switch ( $product_type ) { case 'external': return _( 'Buy product', 'woocommerce' ); break; case 'grouped': return _( 'View products', 'woocommerce' ); break; case 'simple': return _( 'Add to cart', 'woocommerce' ); break; case 'variable': return _( 'Select options', 'woocommerce' ); break; default: return __( 'Read more', 'woocommerce' ); } }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter