FOX - Currency Switcher for WooCommerce

Name Your Price - WooThemes

Enlace del pluginhttps://woocommerce.com/products/name-your-price/ En el archivo plugins\woocommerce-name-your-price\includes\class-wc-name-your-price-cart.php  añade el siguiente código:
if (class_exists('WOOCS')) {
    global $WOOCS;
    if ($WOOCS->current_currency != $WOOCS->default_currency) {
        $currencies = $WOOCS->get_currencies();
        $posted_price = $posted_price / $currencies[$WOOCS->current_currency]['rate'];
    }
}
Name Your Price - WooThemesName Your Price - WooThemesName Your Price - WooThemesName Your Price - WooThemesName Your Price - WooThemesName Your Price - WooThemesName Your Price - WooThemes

Versión anterior:

  • en el archivo \wp-content\plugins\woocommerce-name-your-price\includes\class-wc-name-your-price-helpers.php añade el código:
    if (class_exists('WOOCS')) {
        global $WOOCS;
        if ($WOOCS->is_multiple_allowed) {
            $price = $WOOCS->woocs_exchange_value(floatval($price));
        }
    }
  • en el mismo archivo añade el código:
    if (class_exists('WOOCS')) {
        global $WOOCS;
        if ($WOOCS->current_currency != $WOOCS->default_currency) {
            $currencies = $WOOCS->get_currencies();
            $posted = $posted / $currencies[$WOOCS->current_currency]['rate'];
        }
    }
  • en el mismo código añade el código:
    if (class_exists('WOOCS')) {
        global $WOOCS;
        if ($WOOCS->is_multiple_allowed) {
            $price = $WOOCS->woocs_exchange_value(floatval($price));
        }
    }
  • en el mismo código añade el código:
    if (class_exists('WOOCS')) {
        global $WOOCS;
        $price = $WOOCS->woocs_exchange_value(floatval($price));
        $minimum = $WOOCS->woocs_exchange_value(floatval($minimum));
    }
  • abre el archivo plugins\woocommerce-name-your-price\includes\class-wc-name-your-price-cart.php y añade el siguiente código:
    $price = (double) WC_Name_Your_Price_Helpers::standardize_number($_REQUEST[$posted_nyp_field]);
    if (class_exists('WOOCS')) {
        global $WOOCS;
        if ($WOOCS->current_currency != $WOOCS->default_currency) {
            $currencies = $WOOCS->get_currencies();
            $price = $price / $currencies[$WOOCS->current_currency]['rate'];
        }
    }
    $cart_item_data['nyp'] = $price;
    
    Y
    if (class_exists('WOOCS')) {
        global $WOOCS;
        $minimum = $WOOCS->woocs_exchange_value(floatval($minimum));
    }