Quote from Millenary on April 20, 2020, 14:15
Hi Pablo,
Thank you.
There were no change when changing to " External/Affiliate product" however it worked when changing to "variable product" but the text on the button now displayed "Select Options" for sold out products instead of "Read more".
I added this snippet in functions.php to update the text to "Read more".
remove_action( 'woocommerce_single_product_summary',
'woocommerce_template_single_add_to_cart', 30 );
add_action( 'woocommerce_single_product_summary',
'woocommerce_template_single_add_to_cart', 15 );
add_filter( 'woocommerce_product_add_to_cart_text', function( $text ) {
global $product;
if ( $product->is_type( 'variable' ) ) {
$text = $product->is_purchasable() ? __( 'Read more', 'woocommerce' ) : __( 'Read more', 'woocommerce' );
}
return $text;
}, 10 );
I was still unable to display a unique price for a specific country and sold out for other countries. Might not work at all? I will use another solution for this..
Thank you for your help.
Hi Pablo,
Thank you.
There were no change when changing to" External/Affiliate product" however it worked when changing to"variable product" but the text on the button now displayed"Select Options" for sold out products instead of"Read more".
I added this snippet in functions.php to update the text to"Read more".
remove_action( 'woocommerce_single_product_summary',
'woocommerce_template_single_add_to_cart', 30 );
add_action( 'woocommerce_single_product_summary',
'woocommerce_template_single_add_to_cart', 15 );
add_filter( 'woocommerce_product_add_to_cart_text', function( $text ) {
global $product;
if ( $product->is_type( 'variable' ) ) {
$text = $product->is_purchasable() ? __( 'Read more', 'woocommerce' ) : __( 'Read more', 'woocommerce' );
}
return $text;
}, 10 );
I was still unable to display a unique price for a specific country and sold out for other countries. Might not work at all? I will use another solution for this..
Thank you for your help.