This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'woocommerce_cod_process_payment_order_status', 'change_cod_payment_order_status', 10, 2 ); | |
add_filter( 'woocommerce_bacs_process_payment_order_status', 'change_cod_payment_order_status', 10, 2 ); | |
function change_cod_payment_order_status( $order_status, $order ) { | |
return 'pending-payment'; | |
} | |
add_filter( 'easy_booking_get_order_statuses', 'wceb_remove_order_status', 10, 1 ); | |
function wceb_remove_order_status( $statuses ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action( 'ebac_order_processed', 'ebac_wpml_compatibility', 10, 3 ); | |
function ebac_wpml_compatibility( $item, $keep_stock_id, $booked ) { | |
global $sitepress; | |
$trid = $sitepress->get_element_trid( $keep_stock_id, 'post_product' ); | |
if ( is_numeric( $trid ) ) { | |
$translations = $sitepress->get_element_translations( $trid, 'post_product' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action( 'ebac_order_processed', 'ebac_wpml_compatibility', 10, 3 ); | |
function ebac_wpml_compatibility( $item, $keep_stock_id, $booked ) { | |
$original_post_id = apply_filters( 'wpml_master_post_from_duplicate', $keep_stock_id ); | |
if ( ! empty( $original_post_id ) ) { | |
$start = $item['ebs_start_format']; | |
$end = isset( $item['ebs_end_format'] ) ? $item['ebs_end_format'] : $start; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action( 'after_wcfm_products_manage_meta_save', 'wceb_compatibility_with_wcfm', 10, 2 ); | |
function wceb_compatibility_with_wcfm( $id, $data ) { | |
$booking_data = array( | |
'bookable' => isset( $data['_booking_option'] ) ? 'yes' : false, | |
'dates' => isset( $data['_booking_dates'] ) ? $data['_booking_dates'] : '', | |
'booking_min' => isset( $data['_booking_min'] ) ? $data['_booking_min'] : '', | |
'booking_max' => isset( $data['_booking_max'] ) ? $data['_booking_max'] : '', | |
'first_available_date' => isset( $data['_first_available_date'] ) ? $data['_first_available_date'] : '', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'easy_booking_calendar_event_summary', 'add_custom_event_name', 10, 3 ); | |
function add_custom_event_name( $name, $order_item, $order ) { | |
$name = '#' . absint( $order->get_order_number() ) . ' - ' . $order_item->get_name(); // Default name | |
return $name; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'easy_booking_calendar_event_description', 'add_custom_event_description', 10, 3 ); | |
function add_custom_event_description( $description, $order_item, $order ) { | |
$description = '<p>Client: ' . $order->get_formatted_billing_full_name() . '</p>'; | |
$meta_data = $order_item->get_formatted_meta_data(); | |
if ( ! empty( $meta_data ) ) { | |
foreach ( $meta_data as $meta_id => $data ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'easy_booking_set_booking_price', 'wceb_yith_deposit_price', 10, 2 ); | |
function wceb_yith_deposit_price( $booking_price, $cart_item ) { | |
if ( isset( $cart_item['deposit'] ) && true === $cart_item['deposit'] && isset( $cart_item['deposit_value'] ) ) { | |
$product = $cart_item['data']; | |
$product_id = $product->is_type( 'variation' ) ? $product->get_parent_id() : $product->get_id(); | |
$variation_id = $product->is_type( 'variation' ) ? $product->get_id() : false; | |
$booking_price = YITH_WCDP()->get_deposit( $product_id, $booking_price, false, $variation_id ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'easy_booking_set_booking_price', 'wceb_yith_deposit_price', 10, 2 ); | |
function wceb_yith_deposit_price( $booking_price, $cart_item ) { | |
if ( isset( $cart_item['deposit'] ) && true === $cart_item['deposit'] && isset( $cart_item['deposit_value'] ) ) { | |
$product = $cart_item['data']; | |
$product_id = $product->is_type( 'variation' ) ? $product->get_parent_id() : $product->get_id(); | |
$variation_id = $product->is_type( 'variation' ) ? $product->get_id() : false; | |
$booking_price = YITH_WCDP_Premium()->get_deposit( $product_id, $booking_price, 'edit', false, $variation_id ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action( 'woocommerce_check_cart_items', 'wceb_check_dates_in_cart', 10, 1 ); | |
function wceb_check_dates_in_cart() { | |
$return = true; | |
$start_date = ''; | |
$end_date = ''; | |
$i = 0; | |
foreach ( WC()->cart->get_cart() as $cart_item_key => $values ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'easy_booking_reports_columns', 'wceb_reports_columns', 10, 1 ); | |
function wceb_reports_columns( $columns ) { | |
unset( $columns['booking_status'] ); | |
return $columns; | |
} |
NewerOlder