Support » Plugin: WooCommerce Easy Booking » Can’t change ‘Select date(s)’ easily

  • It is very bad for you to replace standard WooCommerce text “Add to cart” and even not allow to remove your filter. Please, let me know if you will change it. Thanks

    • This topic was modified 2 years, 9 months ago by liubovwp.
Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Ashanna

    (@morki)

    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 2 years, 9 months ago by liubovwp.
    Plugin Author Ashanna

    (@morki)

    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 2 years, 9 months ago by liubovwp.
    Plugin Author Ashanna

    (@morki)

    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 2 years, 9 months ago by Ashanna.
    • This reply was modified 2 years, 9 months ago by Ashanna.

    I changed the rating because your plugin is realy useful, but still not satisfied. I hope you will improve your code

    Plugin Author Ashanna

    (@morki)

    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 2 years, 9 months ago by Ashanna.

    I like this solution!

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Can’t change ‘Select date(s)’ easily’ is closed to new replies.