Changeset 3108891
- Timestamp:
- 06/27/2024 05:28:49 PM (21 months ago)
- Location:
- shipping-envia-colvanes-woo
- Files:
-
- 6 edited
- 7 copied
-
tags/4.0.27 (copied) (copied from shipping-envia-colvanes-woo/trunk)
-
tags/4.0.27/includes/admin/settings.php (copied) (copied from shipping-envia-colvanes-woo/trunk/includes/admin/settings.php) (4 diffs)
-
tags/4.0.27/includes/class-method-shipping-envia-colvanes-ec.php (copied) (copied from shipping-envia-colvanes-woo/trunk/includes/class-method-shipping-envia-colvanes-ec.php) (2 diffs)
-
tags/4.0.27/includes/class-shipping-envia-colvanes-ec.php (copied) (copied from shipping-envia-colvanes-woo/trunk/includes/class-shipping-envia-colvanes-ec.php) (6 diffs)
-
tags/4.0.27/includes/class-shipping-envia-colvanes-plugin-ec.php (copied) (copied from shipping-envia-colvanes-woo/trunk/includes/class-shipping-envia-colvanes-plugin-ec.php) (3 diffs)
-
tags/4.0.27/readme.txt (copied) (copied from shipping-envia-colvanes-woo/trunk/readme.txt) (2 diffs)
-
tags/4.0.27/shipping-envia-colvanes-woo.php (copied) (copied from shipping-envia-colvanes-woo/trunk/shipping-envia-colvanes-woo.php) (3 diffs)
-
trunk/includes/admin/settings.php (modified) (4 diffs)
-
trunk/includes/class-method-shipping-envia-colvanes-ec.php (modified) (2 diffs)
-
trunk/includes/class-shipping-envia-colvanes-ec.php (modified) (6 diffs)
-
trunk/includes/class-shipping-envia-colvanes-plugin-ec.php (modified) (3 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/shipping-envia-colvanes-woo.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
shipping-envia-colvanes-woo/tags/4.0.27/includes/admin/settings.php
r3083559 r3108891 196 196 'type' => 'text', 197 197 'description' => __( 'Usuario de la cuenta de Envia Colvanes' ), 198 'desc_tip' => true 198 'desc_tip' => true, 199 'default' => 'EMPCAR01' 199 200 ), 200 201 'sandbox_password' => array( … … 202 203 'type' => 'password', 203 204 'description' => __( 'Contraseña de la cuenta de Envia Colvanes' ), 204 'desc_tip' => true 205 'desc_tip' => true, 206 'default' => 'EMPCAR1' 205 207 ), 206 208 'sandbox_code_account' => array( … … 208 210 'type' => 'text', 209 211 'description' => __( 'El código de la cuenta de Envia Colvanes' ), 210 'desc_tip' => true 212 'desc_tip' => true, 213 'default' => '001-001-30' 211 214 ), 212 215 'sandbox_is_collection' => array( … … 241 244 12 => __( 'Paquete Terrestre') 242 245 ) 243 ) ,246 ) 244 247 ) 245 248 ) -
shipping-envia-colvanes-woo/tags/4.0.27/includes/class-method-shipping-envia-colvanes-ec.php
r3083559 r3108891 162 162 { 163 163 164 if (($key === 'code_account' || 165 $key === 'sandbox_code_account') && 164 if ($value && str_contains($key, 'code_account') && 166 165 !preg_match('/^[0-9]+(-[0-9]+)+(-[0-9]+)$/', $value) 167 166 ){ … … 175 174 { 176 175 $code_account = $this->get_option($key_option); 176 177 if(!$code_account) return; 178 177 179 $code_account = explode('-', $code_account); 178 180 -
shipping-envia-colvanes-woo/tags/4.0.27/includes/class-shipping-envia-colvanes-ec.php
r3083559 r3108891 61 61 62 62 try { 63 $ instance->enviaColvanes->liquidation($params);63 $res = $instance->enviaColvanes->liquidation($params); 64 64 } catch (\Exception $e) { 65 65 shipping_envia_colvanes_ec()->log($params); … … 156 156 157 157 $weight = ceil($weight); 158 $volume_variant = $weight > 8 ? 400 : 222; 159 $total_weight = round($length * $width * $height * $volume_variant / 1000000); 158 160 159 161 $data['cart_prods'][] = [ … … 166 168 ]; 167 169 168 $volume_variant = $weight > 8 ? 400 : 222; 169 170 $data['total_weight'] = round($length * $width * $height * $volume_variant / 1000000); 171 172 $height = 0; 173 $length = 0; 174 $width = 0; 175 $weight = 0; 176 170 $data['total_weight'] = max($total_weight, 1); 177 171 } 178 172 } … … 247 241 $order_parent = new WC_Order($order_id_origin); 248 242 249 shipping_envia_colvanes_ec()->log($new_status);250 251 243 if(($order_parent->has_shipping_method($instance->id) || 252 244 $order_parent->get_shipping_total() == 0 && … … 261 253 262 254 update_post_meta($order->get_id(), 'guide_envia_colvanes', $guide->urlguia); 263 264 265 255 } 266 256 } … … 271 261 } 272 262 273 public static function get_shop($product_id) 263 public static function get_shop($product_id): array 274 264 { 275 265 $id = get_post_field( 'post_author', $product_id ); -
shipping-envia-colvanes-woo/tags/4.0.27/includes/class-shipping-envia-colvanes-plugin-ec.php
r3082125 r3108891 139 139 140 140 $order = new WC_Order($post->ID); 141 142 141 $order_id_origin = $order->get_id(); 143 144 142 $guide_url = get_post_meta($order_id_origin, 'guide_envia_colvanes', true); 145 143 … … 209 207 public static function variation_settings_fields($loop, $variation_data, $variation) 210 208 { 209 global ${"shipping_custom_price_product_smp_$variation->ID"}; 210 211 if (!isset(${"shipping_custom_price_product_smp_$variation->ID"})) { 212 ${"shipping_custom_price_product_smp_$variation->ID"} = false; 213 } 214 215 if(${"shipping_custom_price_product_smp_$variation->ID"}) return; 216 211 217 woocommerce_wp_text_input( 212 218 array( … … 219 225 ) 220 226 ); 227 228 ${"shipping_custom_price_product_smp_$variation->ID"} = true; 221 229 } 222 230 -
shipping-envia-colvanes-woo/tags/4.0.27/readme.txt
r3083559 r3108891 6 6 Tested up to: 6.5.2 7 7 Requires PHP: 8.1 8 Stable tag: 4.0.2 68 Stable tag: 4.0.27 9 9 License: GNU General Public License v3.0 10 10 License URI: http://www.gnu.org/licenses/gpl-3.0.html … … 96 96 = 4.0.26 = 97 97 * Fixed pago con reacaudo 98 = 4.0.27 = 99 * Fixed total_weight minor 1 100 * Fixed validate code_account 101 * Fixed repeat field _shipping_custom_price_product_smp in variation product 98 102 99 103 == Additional Info == -
shipping-envia-colvanes-woo/tags/4.0.27/shipping-envia-colvanes-woo.php
r3083559 r3108891 3 3 * Plugin Name: Shipping Envia Colvanes Woo 4 4 * Description: Shipping Envia Colvanes Woocommerce is available for Colombia 5 * Version: 4.0.2 65 * Version: 4.0.27 6 6 * Author: Saul Morales Pacheco 7 7 * Author URI: https://saulmoralespa.com … … 12 12 * Requires Plugins: woocommerce,departamentos-y-ciudades-de-colombia-para-woocommerce 13 13 * 14 * @package ShippingCoordinadora15 14 */ 16 15 … … 20 19 21 20 if(!defined('SHIPPING_ENVIA_COLVANES_EC_VERSION')){ 22 define('SHIPPING_ENVIA_COLVANES_EC_VERSION', '4.0.2 6');21 define('SHIPPING_ENVIA_COLVANES_EC_VERSION', '4.0.27'); 23 22 } 24 23 -
shipping-envia-colvanes-woo/trunk/includes/admin/settings.php
r3083559 r3108891 196 196 'type' => 'text', 197 197 'description' => __( 'Usuario de la cuenta de Envia Colvanes' ), 198 'desc_tip' => true 198 'desc_tip' => true, 199 'default' => 'EMPCAR01' 199 200 ), 200 201 'sandbox_password' => array( … … 202 203 'type' => 'password', 203 204 'description' => __( 'Contraseña de la cuenta de Envia Colvanes' ), 204 'desc_tip' => true 205 'desc_tip' => true, 206 'default' => 'EMPCAR1' 205 207 ), 206 208 'sandbox_code_account' => array( … … 208 210 'type' => 'text', 209 211 'description' => __( 'El código de la cuenta de Envia Colvanes' ), 210 'desc_tip' => true 212 'desc_tip' => true, 213 'default' => '001-001-30' 211 214 ), 212 215 'sandbox_is_collection' => array( … … 241 244 12 => __( 'Paquete Terrestre') 242 245 ) 243 ) ,246 ) 244 247 ) 245 248 ) -
shipping-envia-colvanes-woo/trunk/includes/class-method-shipping-envia-colvanes-ec.php
r3083559 r3108891 162 162 { 163 163 164 if (($key === 'code_account' || 165 $key === 'sandbox_code_account') && 164 if ($value && str_contains($key, 'code_account') && 166 165 !preg_match('/^[0-9]+(-[0-9]+)+(-[0-9]+)$/', $value) 167 166 ){ … … 175 174 { 176 175 $code_account = $this->get_option($key_option); 176 177 if(!$code_account) return; 178 177 179 $code_account = explode('-', $code_account); 178 180 -
shipping-envia-colvanes-woo/trunk/includes/class-shipping-envia-colvanes-ec.php
r3083559 r3108891 61 61 62 62 try { 63 $ instance->enviaColvanes->liquidation($params);63 $res = $instance->enviaColvanes->liquidation($params); 64 64 } catch (\Exception $e) { 65 65 shipping_envia_colvanes_ec()->log($params); … … 156 156 157 157 $weight = ceil($weight); 158 $volume_variant = $weight > 8 ? 400 : 222; 159 $total_weight = round($length * $width * $height * $volume_variant / 1000000); 158 160 159 161 $data['cart_prods'][] = [ … … 166 168 ]; 167 169 168 $volume_variant = $weight > 8 ? 400 : 222; 169 170 $data['total_weight'] = round($length * $width * $height * $volume_variant / 1000000); 171 172 $height = 0; 173 $length = 0; 174 $width = 0; 175 $weight = 0; 176 170 $data['total_weight'] = max($total_weight, 1); 177 171 } 178 172 } … … 247 241 $order_parent = new WC_Order($order_id_origin); 248 242 249 shipping_envia_colvanes_ec()->log($new_status);250 251 243 if(($order_parent->has_shipping_method($instance->id) || 252 244 $order_parent->get_shipping_total() == 0 && … … 261 253 262 254 update_post_meta($order->get_id(), 'guide_envia_colvanes', $guide->urlguia); 263 264 265 255 } 266 256 } … … 271 261 } 272 262 273 public static function get_shop($product_id) 263 public static function get_shop($product_id): array 274 264 { 275 265 $id = get_post_field( 'post_author', $product_id ); -
shipping-envia-colvanes-woo/trunk/includes/class-shipping-envia-colvanes-plugin-ec.php
r3082125 r3108891 139 139 140 140 $order = new WC_Order($post->ID); 141 142 141 $order_id_origin = $order->get_id(); 143 144 142 $guide_url = get_post_meta($order_id_origin, 'guide_envia_colvanes', true); 145 143 … … 209 207 public static function variation_settings_fields($loop, $variation_data, $variation) 210 208 { 209 global ${"shipping_custom_price_product_smp_$variation->ID"}; 210 211 if (!isset(${"shipping_custom_price_product_smp_$variation->ID"})) { 212 ${"shipping_custom_price_product_smp_$variation->ID"} = false; 213 } 214 215 if(${"shipping_custom_price_product_smp_$variation->ID"}) return; 216 211 217 woocommerce_wp_text_input( 212 218 array( … … 219 225 ) 220 226 ); 227 228 ${"shipping_custom_price_product_smp_$variation->ID"} = true; 221 229 } 222 230 -
shipping-envia-colvanes-woo/trunk/readme.txt
r3083559 r3108891 6 6 Tested up to: 6.5.2 7 7 Requires PHP: 8.1 8 Stable tag: 4.0.2 68 Stable tag: 4.0.27 9 9 License: GNU General Public License v3.0 10 10 License URI: http://www.gnu.org/licenses/gpl-3.0.html … … 96 96 = 4.0.26 = 97 97 * Fixed pago con reacaudo 98 = 4.0.27 = 99 * Fixed total_weight minor 1 100 * Fixed validate code_account 101 * Fixed repeat field _shipping_custom_price_product_smp in variation product 98 102 99 103 == Additional Info == -
shipping-envia-colvanes-woo/trunk/shipping-envia-colvanes-woo.php
r3083559 r3108891 3 3 * Plugin Name: Shipping Envia Colvanes Woo 4 4 * Description: Shipping Envia Colvanes Woocommerce is available for Colombia 5 * Version: 4.0.2 65 * Version: 4.0.27 6 6 * Author: Saul Morales Pacheco 7 7 * Author URI: https://saulmoralespa.com … … 12 12 * Requires Plugins: woocommerce,departamentos-y-ciudades-de-colombia-para-woocommerce 13 13 * 14 * @package ShippingCoordinadora15 14 */ 16 15 … … 20 19 21 20 if(!defined('SHIPPING_ENVIA_COLVANES_EC_VERSION')){ 22 define('SHIPPING_ENVIA_COLVANES_EC_VERSION', '4.0.2 6');21 define('SHIPPING_ENVIA_COLVANES_EC_VERSION', '4.0.27'); 23 22 } 24 23
Note: See TracChangeset
for help on using the changeset viewer.