FOX - Currency Switcher for WooCommerce

RnB - WooCommerce Booking & Rental Plugin By redqteam

Enlace del plugin: https://codecanyon.net/item/rnb-woocommerce-rental-booking-system/14835145 Señal enviada: https://codecanyon.net/comments/29910477 NOTA: Desde la versión 15.0.1 – 16 de octubre de 2023, este plugin es compatible con el plugin FOX sin necesidad de modificaciones adicionales según la información del equipo de desarrollo de «RnB - WooCommerce Booking & Rental Plugin».
Para desarrolladores: contáctanos si tienes problemas con las implementaciones.
  • en el archivo wp-content\plugins\woocommerce-rental-and-booking\includes\rnb-global-functions.php añade el siguiente código:
    if (class_exists('WOOCS') AND $daily_pricing > 0) {
        global $WOOCS;
        $daily_pricing = $WOOCS->woocs_exchange_value($daily_pricing);
    }
    
  • También en el mismo archivo:
    if (class_exists('WOOCS') AND $monthly_pricing > 0) {
        global $WOOCS;
        $monthly_pricing = $WOOCS->woocs_exchange_value($monthly_pricing);
    }
    
  • También en el mismo archivo añade el siguiente código:
    if (class_exists('WOOCS') AND $general_price > 0) {
        global $WOOCS;
        $general_price = $WOOCS->woocs_exchange_value($general_price);
    }
    
  • También en el mismo archivo añade el siguiente código:
    if (class_exists('WOOCS') AND $hourly_price > 0) {
        global $WOOCS;
        $hourly_price = $WOOCS->woocs_exchange_value($hourly_price);
    }
    
  • También en el mismo archivo añade el siguiente código:
    if (class_exists('WOOCS') AND $hourly_price > 0) {
        global $WOOCS;
        $price_discount = $WOOCS->woocs_exchange_value($price_discount);
    }
    
  • En el archivo wp-content\plugins\woocommerce-rental-and-booking\includes\class-rnb-product-cart.php añade el siguiente código:
    if (isset($cart_item_meta['rental_data']['rental_days_and_costs']['cost'])) {
        if (class_exists('WOOCS') AND $cart_item_meta['rental_data']['rental_days_and_costs']['cost']) {
            global $WOOCS;
            if ($WOOCS->is_multiple_allowed) {
                $currrent = $WOOCS->current_currency;
                if ($currrent != $WOOCS->default_currency) {
                    $currencies = $WOOCS->get_currencies();
                    $rate = $currencies[$currrent]['rate'];
                    $cart_item_meta['rental_data']['rental_days_and_costs']['cost'] = $cart_item_meta['rental_data']['rental_days_and_costs']['cost'] / $rate;
                    $cart_item_meta['rental_data']['rental_days_and_costs']['line_total'] = $cart_item_meta['rental_data']['rental_days_and_costs']['line_total'] / $rate;
                    $cart_item_meta['rental_data']['rental_days_and_costs']['price_breakdown']['duration_total'] = $cart_item_meta['rental_data']['rental_days_and_costs']['price_breakdown']['duration_total'] / $rate;
                    $cart_item_meta['rental_data']['rental_days_and_costs']['price_breakdown']['total'] = $cart_item_meta['rental_data']['rental_days_and_costs']['price_breakdown']['total'] / $rate;
                    $cart_item_meta['rental_data']['rental_days_and_costs']['price_breakdown']['deposit_free_total'] = $cart_item_meta['rental_data']['rental_days_and_costs']['price_breakdown']['deposit_free_total'] / $rate;
                    $cart_item_meta['rental_data']['rental_days_and_costs']['price_breakdown']['duration_breakdown']['daily'] = $cart_item_meta['rental_data']['rental_days_and_costs']['price_breakdown']['duration_breakdown']['daily'] / $rate;
                }
            }
        }
    }
  • en el mismo archivo añade el siguiente código:
    if (class_exists('WOOCS') AND $duration_total > 0) {
        global $WOOCS;
        $duration_total = $WOOCS->woocs_exchange_value($duration_total);
    }
  • en el mismo archivo añade el siguiente código:
    if (class_exists('WOOCS') AND $cost > 0) {
        global $WOOCS;
        $cost = $WOOCS->woocs_exchange_value($cost);
    }
    
  • en el mismo archivo añade el siguiente código:
    if (class_exists('WOOCS') AND $cost > 0) {
        global $WOOCS;
        $cost = $WOOCS->woocs_exchange_value($cost);
    }
    
  • en el mismo archivo añade el siguiente código:
    if (class_exists('WOOCS') AND $rental_data['location_cost'] > 0) {
        global $WOOCS;
        $rental_data['location_cost'] = $WOOCS->woocs_exchange_value($rental_data['location_cost']);
    }
    
  • en el mismo archivo añade el siguiente código:
    if (class_exists('WOOCS') AND $category['cost'] > 0) {
        global $WOOCS;
        $category['cost'] = $WOOCS->woocs_exchange_value($category['cost']);
    }
    
  • en el mismo archivo añade el siguiente código:
    if (class_exists('WOOCS') AND $resource['cost'] > 0) {
        global $WOOCS;
        $resource['cost'] = $WOOCS->woocs_exchange_value($resource['cost']);
    }
    
  • en el mismo archivo añade el siguiente código:
    if (class_exists('WOOCS') AND $deposit['cost'] > 0) {
        global $WOOCS;
        $deposit['cost'] = $WOOCS->woocs_exchange_value($deposit['cost']);
    }
    
  • en el mismo archivo añade el siguiente código:
    if (class_exists('WOOCS') AND $adult['cost'] > 0) {
        global $WOOCS;
        $adult['cost'] = $WOOCS->woocs_exchange_value($adult['cost']);
    }
    
  • en el mismo archivo añade el siguiente código:
    if (class_exists('WOOCS') AND $child['cost'] > 0) {
        global $WOOCS;
        $child['cost'] = $WOOCS->woocs_exchange_value($child['cost']);
    }
    
  • en el mismo archivo añade el siguiente código:
    if (class_exists('WOOCS') AND $rental_data['rental_days_and_costs']['due_payment'] > 0) {
        global $WOOCS;
        $rental_data['rental_days_and_costs']['due_payment'] = $WOOCS->woocs_exchange_value($rental_data['rental_days_and_costs']['due_payment']);
    }
    
  • en el archivo wp-content\plugins\woocommerce-rental-and-booking\includes\rnb-global-functions.php añade el siguiente código:
    foreach ($days_range as $key => $range) {
        if (class_exists('WOOCS') AND isset($days_range[$key]['range_cost']) AND $days_range[$key]['range_cost'] > 0) {
            global $WOOCS;
            $days_range[$key]['range_cost'] = $WOOCS->woocs_exchange_value($days_range[$key]['range_cost']);
        }
    }
    
Esta modificación está dentro del archivo de otro plugin, por lo que una actualización del plugin la deshará. Anota el cambio y vuelve a aplicarlo después de cada actualización de ese plugin — o pide a sus autores que incluyan la corrección en su lado, que es la única versión que perdura. Si el cambio está dentro del propio FOX, dínoslo: una corrección que debe volverse a aplicar manualmente es un error de nuestra parte, no una solución.