Plugin Directory

Changeset 1785674


Ignore:
Timestamp:
12/12/2017 06:46:42 PM (8 years ago)
Author:
ecomerciar
Message:

Actualizacion 1.3

Location:
woo-oca/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • woo-oca/trunk/oca-shipping.php

    r1785038 r1785674  
    4646 */
    4747function woo_oca_crear_datos_oca($datos = array(), $order = '', $envio = ''){
     48
     49    $countries_obj = new WC_Countries();
     50    $country_states_array = $countries_obj->get_states();
     51    if($order->get_shipping_first_name()){
     52        $provincia = $country_states_array['AR'][$order->get_shipping_state()];
     53        $datos['nombre_cliente'] = $order->get_shipping_first_name();
     54        $datos['apellido_cliente'] = $order->get_shipping_last_name();
     55        $datos['direccion_cliente'] = $order->get_shipping_address_1();
     56        $datos['ciudad_cliente'] = $order->get_shipping_city();
     57        $datos['cp_cliente'] = $order->get_shipping_postcode();
     58        $datos['observaciones_cliente'] = $order->get_shipping_address_2();
     59    }else{
     60        $provincia = $country_states_array['AR'][$order->get_billing_state()];
     61        $datos['nombre_cliente'] = $order->get_billing_first_name();
     62        $datos['apellido_cliente'] = $order->get_billing_last_name();
     63        $datos['direccion_cliente'] = $order->get_billing_address_1();
     64        $datos['ciudad_cliente'] = $order->get_billing_city();
     65        $datos['cp_cliente'] = $order->get_billing_postcode();
     66        $datos['observaciones_cliente'] = $order->get_billing_address_2();
     67    }
     68    $datos['provincia_cliente'] = $provincia;   
     69    $datos['telefono_cliente'] = $order->get_billing_phone();
     70    $datos['celular_cliente'] = $order->get_billing_phone();
     71    $datos['email_cliente'] = $order->get_billing_email();
     72    $datos['sucursal_oca_destino'] = $order->get_meta('sucursal_oca_destino');
     73
     74    // Se filtran las comillas
     75    $datos = array_map(function($value){
     76        $value = str_replace('"', "", $value);
     77        $value = str_replace("'", "", $value);
     78        return $value;
     79    }, $datos);
     80
    4881    $xml = '<?xml version="1.0" encoding="iso-8859-1" standalone="yes"?>
    4982    <ROWS>   
     
    5386                <envios>         
    5487                    <envio idoperativa="'.$datos[$envio[3]].'" nroremito="'.$order->get_order_number().'">';
    55                     $countries_obj = new WC_Countries();
    56                     $country_states_array = $countries_obj->get_states();
    57                     if($order->get_shipping_first_name()){
    58                         $provincia = $country_states_array['AR'][$order->get_shipping_state()];
    59                         $xml .= '<destinatario apellido="'.$order->get_shipping_last_name().'" nombre="'.$order->get_shipping_first_name().'" calle="'.$order->get_shipping_address_1().'" nro="0" piso="" depto="" localidad="'.$order->get_shipping_city().'" provincia="'.$provincia.'" cp="'.$order->get_shipping_postcode().'" telefono="'.$order->get_billing_phone().'" email="'.$order->get_billing_email().'" idci="'.$order->get_meta('sucursal_oca_destino').'" celular="'.$order->get_billing_phone().'" observaciones="'.$order->get_shipping_address_2().'" />';
    60                     }else{
    61                         $provincia = $country_states_array['AR'][$order->get_billing_state()];
    62                         $xml .= '<destinatario apellido="'.$order->get_billing_last_name().'" nombre="'.$order->get_billing_first_name().'" calle="'.$order->get_billing_address_1().'" nro="0" piso="" depto="" localidad="'.$order->get_billing_city().'" provincia="'.$provincia.'" cp="'.$order->get_billing_postcode().'" telefono="'.$order->get_billing_phone().'" email="'.$order->get_billing_email().'" idci="'.$order->get_meta('sucursal_oca_destino').'" celular="'.$order->get_billing_phone().'" observaciones="'.$order->get_billing_address_2().'" />';                       
    63                     }           
     88                    $xml .= '<destinatario apellido="'.$datos['apellido_cliente'].'" nombre="'.$datos['nombre_cliente'].'" calle="'.$datos['direccion_cliente'].'" nro="0" piso="" depto="" localidad="'.$datos['ciudad_cliente'].'" provincia="'.$datos['provincia_cliente'].'" cp="'.$datos['cp_cliente'].'" telefono="'.$datos['telefono_cliente'].'" email="'.$datos['email_cliente'].'" idci="'.$datos['sucursal_oca_destino'].'" celular="'.$datos['celular_cliente'].'" observaciones="'.$datos['observaciones_cliente'].'" />';
    6489                    $xml .= '<paquetes>';
    6590                    $items = $order->get_items();
  • woo-oca/trunk/readme.txt

    r1785038 r1785674  
    66Tested up to: 4.9
    77Requires PHP: 5.6
    8 Stable tag: 1.1
     8Stable tag: 1.2
     9Language: Spanish
    910License: GPLv2 or later
    1011License URI: https://www.gnu.org/licenses/gpl-2.0.html
    1112
    12 === Plugin Name ===
    1313WooCommerce OCA Envios
    1414
     
    4242Reiniciar Cache de Envíos
    4343
     44= 1.2 =
     45Reiniciar Cache de Envíos
     46
    4447== Screenshots ==
    4548
     
    5356== Changelog ==
    5457
     58= 1.2 =
     59* Código optimizado
     60* Agregada sanitización de información del usuario antes de realizar un envío
     61
     62= 1.1 =
     63* Agregada verificación de dimensiones y pesos cero
     64* Agregada descripción sobre el CUIT en la configuración del plugin
     65* Agregada la opción para enviar con contrareembolso
     66
    5567= 1.0 =
    5668* Primera subida
    5769
    58 = 1.1 =
    59 * Sumamos posibilidad de Pago en Destino y Corregimos un bug de sucursales
    60 
    6170Si necesitas ayuda podes contactarnos a traves de nuestra web de [Ecomerciar](http://ecomerciar.com/ "Ecomerciar").
  • woo-oca/trunk/woocommerce-oca.php

    r1785038 r1785674  
    55Plugin URI: http://ecomerciar.com
    66Description: Integración de oca para realizar envíos a través de la plataforma WooCommerce.
    7 Version: 1.1
     7Version: 1.2
    88Author: Ecomerciar
    99Author URI: http://ecomerciar.com
Note: See TracChangeset for help on using the changeset viewer.