Hello,
Please have a look at the FAQ (under How can I change the ” / day” and “Select dates” texts?) and you’ll see that you can easily change this text.
Please remove your rating, it is not justified…
Regards,
Natasha
I will remove it with pleasure, but first improve this small defect. I have read FAQ (under How can I change the ” / day” and “Select dates” texts?), but it is bad way to change the label… I dont want to change WooCommerce link, JUST a text.
I hope for your understanding, thanks
-
This reply was modified 7 years, 1 month ago by
liubovwp.
Well, you can change the text with this filter. Add the code to your theme functions.php:
add_filter( 'easy_booking_loop_add_to_cart_link', 'easy_booking_loop_add_to_cart_link', 10, 2 );
function easy_booking_loop_add_to_cart_link( $content, $product ) {
$product_id = is_callable( array( $product, 'get_id' ) ) ? $product->get_id() : $product->id;
$link = get_permalink( $product_id );
$label = __( 'Your custom text', 'easy_booking' );
$content = '<a href="' . esc_url( $link ) . '" rel="nofollow" class="button">' . esc_html( $label ) . '</a>';
return $content;
}
And then change “Your custom text” to whatever text you want 🙂
I see, but WooCommerce allowe me to use filters: woocommerce_product_add_to_cart_text, woocommerce_product_single_add_to_cart_text. And because of your plugin this ability is lost.
As result, I must duplicate WooCommerce code 🙁
-
This reply was modified 7 years, 1 month ago by
liubovwp.
It’s not lost, you just need to use easy_booking_loop_add_to_cart_link instead for your bookable products. It works the same way as the two others.
-
This reply was modified 7 years, 1 month ago by
Ashanna.
-
This reply was modified 7 years, 1 month ago by
Ashanna.
I changed the rating because your plugin is realy useful, but still not satisfied. I hope you will improve your code
Thank you.
I can add another filter in the next update so you only need to change the text, and not the link (it’s almost the same thing though). But it will be another filter, because I need it to be different for bookable products. Something like wceb_bookable_product_add_to_cart_text.
-
This reply was modified 7 years, 1 month ago by
Ashanna.