Hi,
you need do use filter like this:
`add_filter(‘ppom_select_option_lable’, ‘change_select_option’);
function change_select_option( $select_label ) {
$select_label = “My Label”;
return $select_label;
}’
Ok, I tried adding that filter to my functions.php but the button is still labelled “Select Options”. Is there another file I should be adding this too?
Thanks,
Vince
I now have these filters in my functions.php
add_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->product_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 __( 'Buy Now', 'woocommerce' );
break;
default:
return __( 'Read more', 'woocommerce' );
}
}
// END ENQUEUE PARENT ACTION
add_filter('ppom_select_option_label', 'change_select_option');
function change_select_option( $select_label ) {
$select_label = "Buy Now";
return $select_label;
}
-
This reply was modified 6 years, 4 months ago by mcecomputing.