• When using this Plugin together with Woocommerce Bookings I ran into a few compatibility issues, but managed to fix them. I just wanted to share my findings here:

    File woo-wulti-currency/plugins/woocommerce_bookings.php starting at line 31:

    
    	public function woocommerce_bookings_calculated_booking_cost_success_output( $output, $display_price, $product ) {
    		$posted = array();
    // This removes characters from wc_bookings_field_start_date_time which results in wrong year being parsed
    //		parse_str( sanitize_text_field( $_POST['form'] ), $posted );
    		parse_str( $_POST['form'], $posted );
    // WC_Booking_Form::calculate_booking_cost() is deprecated and causes a Notice with debug on.
    //		$booking_form = new WC_Booking_Form( $product );
    //		$cost         = $booking_form->calculate_booking_cost( $posted );
    		$data = wc_bookings_get_posted_data( $posted, $product );
    		$cost = WC_Bookings_Cost_Calculation::calculate_booking_cost( $data, $product );
    
    		if ( is_wp_error( $cost ) ) {
    			wp_send_json( array(
    				'result' => 'ERROR',
    // THIS FILTER CAUSES A LOOP!
    //				'html'   => apply_filters( 'woocommerce_bookings_calculated_booking_cost_success_output', '<span class="booking-error">' . $cost->get_error_message() . '</span>', $cost, $product ),
    				'html'   => '<span class="booking-error">' . $cost->get_error_message() . '</span>',
    //				),
    			) );
    		}
    	[...]
    
Viewing 1 replies (of 1 total)
  • Hi j.hoffmann,

    Thank you very much for your contribution about the compatibility between our plugin and WooCommerce Bookings.

    Best regards,

Viewing 1 replies (of 1 total)
  • The topic ‘Compatibility fix for WooCommerce Bookings’ is closed to new replies.