• Resolved lauramark

    (@lauramark)


    Hello,

    I am using WP-Ocean and Elementor. When I add products in the Home show the grid with read more text. Is possibl change this text?

    Maybe with PHP?

    Thank you

Viewing 1 replies (of 1 total)
  • Theme Author oceanwp

    (@oceanwp)

    Hello, add this code in the functions.php file of your child theme:

    add_filter( 'woocommerce_product_add_to_cart_text' , 'custom_woocommerce_product_add_to_cart_text' );
    function custom_woocommerce_product_add_to_cart_text() {
    	global $product;
    	
    	$product_type = $product->product_type;
    	
    	switch ( $product_type ) {
    		case 'external':
    			return __( 'External text', 'woocommerce' );
    		break;
    		case 'grouped':
    			return __( 'Grouped text', 'woocommerce' );
    		break;
    		case 'simple':
    			return __( 'Simple text', 'woocommerce' );
    		break;
    		case 'variable':
    			return __( 'Variable text', 'woocommerce' );
    		break;
    		default:
    			return __( 'Read more', 'woocommerce' );
    	}
    	
    }
Viewing 1 replies (of 1 total)
  • The topic ‘Change text read more in woocommerce products’ is closed to new replies.