0.00  View cart

Forum Replies Created

Viewing 15 posts - 1 through 15 (of 1,264 total)
  • Author
    Posts
  • in reply to: Multilingual translation #7622
    Ashanna
    Plugin's author

    Hello,

    Yes it’s possible by doing the following: in your admin panel, go to Languages > Settings > Synchronization > Settings > Check “Custom fields”.

    Availabilities and disabled dates should be automatically synchronized between your translations 🙂

    Regards,
    Natasha

    in reply to: [Resolved] add to cart button disabled #7611
    Ashanna
    Plugin's author

    Great 🙂

    in reply to: [Resolved] add to cart button disabled #7608
    Ashanna
    Plugin's author

    Allright, that’s most probably an issue with your theme or with another plugin.

    Please check this: https://wordpress.org/support/topic/t-addclass-block-is-not-a-function/.

    Try to switch to another theme (like Storefront or Tweentynineteen) to see if it’s the theme. If it’s not, disable all your plugins (except WooCommerce and Easy Booking) and enable them on by one to see which one is conflicting.

    Then it’s an issue with a script somewhere, but I won’t be able to help further without accessing the website.

    in reply to: [Resolved] add to cart button disabled #7606
    Ashanna
    Plugin's author

    But if the add to cart button is disabled, you shouldn’t be able to click it and therefore you shouldn’t see the “Please choose two dates” message? Or am I missing something? When do you get the message exactly?

    It’s hard to tell without accessing the website.

    Is there any error somewhere?

    • Check for JS errors: open your browser console (F12 on a PC) and go to the “console” tab and select dates. Tell me if you see anything.
    • Check for PHP error, make sure debugging mode is enabled in your wp-config.php file:
    define( 'WP_DEBUG', true );
    define( 'WP_DEBUG_LOG', true );

    Then select dates and check the debug.log file (in wp-content).

    in reply to: [Resolved] add to cart button disabled #7604
    Ashanna
    Plugin's author

    Hello,

    I need a link to your website. Thank you.

    The “Please choose two dates” issue usually happens with cache plugins. Easy Booking is not compatible with caching and you need to disable it on the product pages.

    But it can be something else.

    Regards,
    Natasha

    in reply to: “wrong” date show availability #7593
    Ashanna
    Plugin's author

    Hello,

    This is because in “Nights” mode, dates in Start and End calendars are not the same. If you look on the product page at the end calendar, it will match the ones in the backend.

    As there is only one calendar in the backend, I had to make a choice and so it displays the end calendar dates only 🙂

    I hope it’s clear!

    I know it’s not perfect, I’m still looking to improve the reports page but for the moment it’s the best solution I’ve found.

    Regards,
    Natasha

    Ashanna
    Plugin's author

    When you do your translation with Poedit, you should have a “Single/Plural” selection, like this: https://www.dropbox.com/s/kloh94c0tz83pre/Poedit.PNG?dl=0.

    Now if it still doesn’t work, could you please send me your .mo and .po files at contact@easy-booking.me?

    Thanks.

     

    Ashanna
    Plugin's author

    Have you updated your files as explained in the documentation here (Update or create translation files > Update an existing file with Poedit > same but with Duration Discounts files)?

    Ashanna
    Plugin's author

    Please update Duration Discounts to its latest version (1.8.1), these issues have been fixed. If you don’t have automatic update (because your version is very old), please visit http://download.easy-booking.me/your-license-key/.

    Then you should be able to update the POT file for the translation.

    Ashanna
    Plugin's author

    Hello,

    Can you tell me which versions of Easy Booking and Duration Discounts you have?

    Regards,
    Natasha

    in reply to: [Resolved] Enable a date after order cancel #7570
    Ashanna
    Plugin's author

    I mark this as resolved as it will be fixed in Easy Booking 2.2.6.

    in reply to: [Resolved] Fixed price per period? #7569
    Ashanna
    Plugin's author

    Sorry, I should have been more precise!

    Good if it works 🙂

    in reply to: Global Discount for All Booking Product #7564
    Ashanna
    Plugin's author

    Hello,

    There is not filter or action hook, you can use this function but it’s a bit risky (read carefully please):

    function set_seasonal_prices() {
    
        $seasonal_prices = array(
            0 => array(
                'type'     => 'ebp_daterange',
                'date'     => array( '2019-12-20', '2019-12-31' ),
                'repeat'   => 'on',
                'price'    => '1500',
                'unit'     => 'ebp_single'
            )
        );
    
        $args = array(
            'post_type'      => array( 'product', 'product_variation' ),
            'posts_per_page' => -1,
            'post_status'    => 'publish'
        );
    
        $query = new WP_Query( $args );
    
        while ( $query->have_posts() ) : $query->the_post();
            global $post;
    
            $post_id = $post->ID;
    
            // Get already set prices
            $product_prices = (array) get_post_meta( $post_id, '_ebp_product_prices', true );
    
            // Merge arrays
            $prices = array_merge( $product_prices, $seasonal_prices );
    
            update_post_meta( $post_id, '_ebp_product_prices', $prices );
            
        endwhile;
    }
    
    set_seasonal_prices();

    Now be careful. Put it in your theme’s functions.php and reload your website once. Then remove the function. I insist on loading your website only once, otherwise prices will be added several times and then you’ll need to delete all prices in order to start fresh. So please make a backup of your database before using this.

    Replace array( ‘2019-12-20’, ‘2019-12-31’ ) in line 6 with your own dates. You an also set “repeat” to “off” if you want (line 7).

    I hope this helps. And sorry it’s a bit far-fetched, I need to add more filters/action hooks to the plugins. I’m also thinking about adding “Global prices” (like the other addons) that will apply to all products. I didn’t want to do it at first because all products can have a different price, but it seems that a lot of people need this feature.

    Regards,
    Natasha

    in reply to: [Resolved] Fixed price per period? #7563
    Ashanna
    Plugin's author

    Hello,

    Good if it works, but it will be overwritten by updates, so it’s not a very good solution.

    It works with variations, in this case $child_id needs to be the ID of the variation (not the parent product). And $product_id is the ID of the bundle product.

    To be sure that the code is considered, use this instead:

    add_filter( 'easy_booking_two_dates_price', 'easy_booking_return_base_price', 10, 5 );
     
    function easy_booking_return_base_price( $booking_price, $product, $_product, $data, $price_type ) {
    
    	$prices_include_tax = get_option('woocommerce_prices_include_tax');
    	$price = ( $price_type === 'regular_price' ) ? $_product->get_regular_price() : $_product->get_price();
    	$args = array( 'price' => $price );       
    	$price = $prices_include_tax === 'yes' ? wc_get_price_including_tax( $_product, $args ) : wc_get_price_excluding_tax( $_product, $args );
    	return $price;
        
    }

    It should return the base price (not multiplied) for everything. If it doesn’t, then maybe you didn’t put the code at the right place?

    Regards,
    Natasha

    in reply to: [Resolved] Fixed price per period? #7559
    Ashanna
    Plugin's author

    Ok, so I think you could do this:

    add_filter( 'easy_booking_two_dates_price', 'easy_booking_return_base_price', 10, 5 );
     
    function easy_booking_return_base_price( $booking_price, $product, $_product, $data, $price_type ) {
        
        $product_id = $product->get_id();
        $child_id   = $_product->get_id();
    
        if ( $product_id == '79' && $child_id == '93' ) {
    
            $prices_include_tax = get_option('woocommerce_prices_include_tax');
            $price = ( $price_type === 'regular_price' ) ? $_product->get_regular_price() : $_product->get_price();
            $args = array( 'price' => $price );       
            $price = $prices_include_tax === 'yes' ? wc_get_price_including_tax( $_product, $args ) : wc_get_price_excluding_tax( $_product, $args );
            return $price;
    
        }
     
        return $booking_price;
        
    }

    Replace 79 with the ID of your bundle (parent product) and 93 with the ID of the bundled variable product.

    Otherwise, you can mix bookable and non-bookable items in a bundle. This way you can have some products with a “normal” price (not multiplied). There’s only a small issue in the plugin right now (I’ll fix it in the next update), but if you want to try now:

    • In woocommerce-easy-booking-system/includes/class-wceb-ajax.php
    • Find lines 260-264 and replace them with:
    $child_new_price = wc_format_decimal( $children_prices[$child_id]['price'] );
    
    if ( isset( $children_prices[$child_id]['regular_price'] ) ) {
        $child_new_regular_price = wc_format_decimal( $children_prices[$child_id]['regular_price'] );
    }

    Now you can have your variable product not bookable and the price will not be multiplied.

Viewing 15 posts - 1 through 15 (of 1,264 total)

Want to know what's next with Easy Booking? Check the roadmap!