WOOCS - Cambiador de divisas de WooCommerce

Reserva fácil de WooCommerce (por @_Ashanna)

Enlace del complemento: WooCommerce Easy Booking

El código se toma de aquí: https://herownsweetcode.com/easy-booking/documentation/easy-booking/compatibility-with-other-plugins/woocommerce-currency-switcher/


Agregue el siguiente código a su tema functions.php (Easy Booking 2.0.9 o superior):

add_filter ('easy_booking_two_dates_price', 'currency_switcher_new_price', 2, 1); function currency_switcher_new_price ($ booking_price) {if (class_exists ('WOOCS')) {global $ WOOCS; $ monedas = $ WOOCS-> get_currencies (); $ precio_reserva = $ WOOCS-> back_convert ($ precio_reserva, $ monedas [$ WOOCS-> moneda_actual] ['tarifa']); } return $ booking_price; } add_filter ('easy_booking_one_date_price', 'currency_switcher_new_price', 2, 1); function currency_switcher_new_price ($ booking_price) {if (class_exists ('WOOCS')) {global $ WOOCS; $ monedas = $ WOOCS-> get_currencies (); $ precio_reserva = $ WOOCS-> back_convert ($ precio_reserva, $ monedas [$ WOOCS-> moneda_actual] ['tarifa']); } return $ booking_price; }

 


Agregue el siguiente código a su tema functions.php (Easy Booking 2.0.6 o inferior):

add_filter ('easy_booking_get_new_item_price', 'currency_switcher_new_price', 2, 4); function currency_switcher_new_price ($ booking_price, $ producto, $ _product, $ duración) {if (class_exists ('WOOCS')) {global $ WOOCS; $ monedas = $ WOOCS-> get_currencies (); $ precio_reserva = $ WOOCS-> back_convert ($ precio_reserva, $ monedas [$ WOOCS-> moneda_actual] ['tarifa']); } return $ booking_price; } add_filter ('easy_booking_fragments', 'currency_switcher_price_fragment', 10, 1); function currency_switcher_price_fragment ($ fragments) {if (isset ($ fragments ['booking_price']) && class_exists ('WOOCS')) {global $ WOOCS; $ monedas = $ WOOCS-> get_currencies (); $ fragments ['booking_price'] = $ fragments ['booking_price'] * $ monedas [$ WOOCS-> current_currency] ['tarifa']; } devuelve $ fragmentos; }