Plugin Directory

Changeset 1175236


Ignore:
Timestamp:
06/05/2015 12:19:46 PM (11 years ago)
Author:
ctala
Message:

Agregado el limpiar cache.
Cache queda en una semana.
Valor de l dolar queda por defecto en 630CLP

Location:
woocommerce-chilean-peso-currency/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • woocommerce-chilean-peso-currency/trunk/readme.txt

    r953689 r1175236  
    1111Tested up to: 3.6
    1212
    13 Stable tag: 2.5
     13Stable tag: 2.5.5
    1414
    1515== Description ==
     
    3030== Changelog ==
    3131
     32= 2.5.5 =
     33
     34Actualizado el 5 de Junio del 2015
     35
     36 * Se baja el tiempo del caché.
     37 * Se actualiza el valor del dolar por defecto a 630.
     38
    3239= 2.5 =
    3340
  • woocommerce-chilean-peso-currency/trunk/woocommerce-chilean-peso.php

    r953689 r1175236  
    55  Plugin URI: http://plugins.svn.wordpress.org/woocommerce-chilean-peso-currency/
    66  Description: This plugin enables the payment with paypal for Chile and the Chilean states to WooCommerce.
    7   Version: 2.5
     7  Version: 2.5.5
    88  Author: Cristian Tala Sánchez <cristian.tala@gmail.com>
    99  Author URI: http://www.cristiantala.cl
    1010  License: GPLv3
    1111  Requires at least: 3.0 +
    12   Tested up to: 3.9.1
     12  Tested up to: 4.2
    1313 */
    1414/*
     
    3030 *      MA 02110-1301, USA.
    3131 */
     32register_activation_hook(__FILE__, 'ctala_install_cleancache');
     33
     34/*
     35 * Esta funcion limpia el cache luego de instalar la nueva versión del plugin.
     36 */
     37function ctala_install_cleancache() {
     38
     39    wp_cache_delete("clp_usd_ctala", "ctala");
     40}
    3241
    3342function add_clp_currency($currencies) {
     
    7988
    8089function convert_clp_to_usd($paypal_args) {
     90    //Grupo para el cache
     91    $ctala_group = "ctala";
     92//Segundos en una semana a cachear el valor.
     93    $ctala_expire = 604800;
     94
    8195    if ($paypal_args['currency_code'] == 'CLP') {
    8296
    83         $valorDolar = wp_cache_get('clp_usd_ctala');
     97        $valorDolar = wp_cache_get('clp_usd_ctala', $ctala_group);
    8498        if (false === $valorDolar) {
    8599            if (function_exists('curl_version')) {
     
    99113                $valorDolar = $exchangeRates->rates->CLP;
    100114            } else {
    101                $valorDolar = 580; // Este es el valor por defecto.
     115                $valorDolar = 630; // Este es el valor por defecto.
    102116            }
    103             wp_cache_set('clp_usd_ctala', $valorDolar);
     117            wp_cache_set('clp_usd_ctala', $valorDolar, $ctala_group, $ctala_expire);
    104118        }
    105119
     
    123137}
    124138
    125 //Se eliminan los códigos portales como obligatorios. (Filtro)
     139//Se eliminan los códigos postales como obligatorios. (Filtro)
    126140add_filter('woocommerce_default_address_fields', 'postalcode_override_default_address_fields');
    127141
Note: See TracChangeset for help on using the changeset viewer.