Changeset 1785674
- Timestamp:
- 12/12/2017 06:46:42 PM (8 years ago)
- Location:
- woo-oca/trunk
- Files:
-
- 3 edited
-
oca-shipping.php (modified) (2 diffs)
-
readme.txt (modified) (3 diffs)
-
woocommerce-oca.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
woo-oca/trunk/oca-shipping.php
r1785038 r1785674 46 46 */ 47 47 function 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 48 81 $xml = '<?xml version="1.0" encoding="iso-8859-1" standalone="yes"?> 49 82 <ROWS> … … 53 86 <envios> 54 87 <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'].'" />'; 64 89 $xml .= '<paquetes>'; 65 90 $items = $order->get_items(); -
woo-oca/trunk/readme.txt
r1785038 r1785674 6 6 Tested up to: 4.9 7 7 Requires PHP: 5.6 8 Stable tag: 1.1 8 Stable tag: 1.2 9 Language: Spanish 9 10 License: GPLv2 or later 10 11 License URI: https://www.gnu.org/licenses/gpl-2.0.html 11 12 12 === Plugin Name ===13 13 WooCommerce OCA Envios 14 14 … … 42 42 Reiniciar Cache de Envíos 43 43 44 = 1.2 = 45 Reiniciar Cache de Envíos 46 44 47 == Screenshots == 45 48 … … 53 56 == Changelog == 54 57 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 55 67 = 1.0 = 56 68 * Primera subida 57 69 58 = 1.1 =59 * Sumamos posibilidad de Pago en Destino y Corregimos un bug de sucursales60 61 70 Si necesitas ayuda podes contactarnos a traves de nuestra web de [Ecomerciar](http://ecomerciar.com/ "Ecomerciar"). -
woo-oca/trunk/woocommerce-oca.php
r1785038 r1785674 5 5 Plugin URI: http://ecomerciar.com 6 6 Description: Integración de oca para realizar envíos a través de la plataforma WooCommerce. 7 Version: 1. 17 Version: 1.2 8 8 Author: Ecomerciar 9 9 Author URI: http://ecomerciar.com
Note: See TracChangeset
for help on using the changeset viewer.