Plugin Directory

Changeset 3108891


Ignore:
Timestamp:
06/27/2024 05:28:49 PM (21 months ago)
Author:
saulmorales
Message:

tagging version 4.0.27

Location:
shipping-envia-colvanes-woo
Files:
6 edited
7 copied

Legend:

Unmodified
Added
Removed
  • shipping-envia-colvanes-woo/tags/4.0.27/includes/admin/settings.php

    r3083559 r3108891  
    196196                'type'  => 'text',
    197197                'description' => __( 'Usuario de la cuenta de Envia Colvanes' ),
    198                 'desc_tip' => true
     198                'desc_tip' => true,
     199                'default' => 'EMPCAR01'
    199200            ),
    200201            'sandbox_password' => array(
     
    202203                'type'  => 'password',
    203204                'description' => __( 'Contraseña de la cuenta de Envia Colvanes' ),
    204                 'desc_tip' => true
     205                'desc_tip' => true,
     206                'default' => 'EMPCAR1'
    205207            ),
    206208            'sandbox_code_account' => array(
     
    208210                'type'  => 'text',
    209211                'description' => __( 'El código de la cuenta de Envia Colvanes' ),
    210                 'desc_tip' => true
     212                'desc_tip' => true,
     213                'default' => '001-001-30'
    211214            ),
    212215            'sandbox_is_collection' => array(
     
    241244                    12    => __( 'Paquete Terrestre')
    242245                )
    243             ),
     246            )
    244247        )
    245248    )
  • shipping-envia-colvanes-woo/tags/4.0.27/includes/class-method-shipping-envia-colvanes-ec.php

    r3083559 r3108891  
    162162    {
    163163
    164         if (($key === 'code_account' ||
    165             $key === 'sandbox_code_account') &&
     164        if ($value && str_contains($key, 'code_account') &&
    166165            !preg_match('/^[0-9]+(-[0-9]+)+(-[0-9]+)$/', $value)
    167166        ){
     
    175174    {
    176175        $code_account = $this->get_option($key_option);
     176
     177        if(!$code_account) return;
     178
    177179        $code_account = explode('-', $code_account);
    178180
  • shipping-envia-colvanes-woo/tags/4.0.27/includes/class-shipping-envia-colvanes-ec.php

    r3083559 r3108891  
    6161
    6262        try {
    63             $instance->enviaColvanes->liquidation($params);
     63            $res = $instance->enviaColvanes->liquidation($params);
    6464        } catch (\Exception $e) {
    6565            shipping_envia_colvanes_ec()->log($params);
     
    156156
    157157                $weight = ceil($weight);
     158                $volume_variant = $weight > 8 ? 400 : 222;
     159                $total_weight = round($length * $width * $height * $volume_variant / 1000000);
    158160
    159161                $data['cart_prods'][] = [
     
    166168                ];
    167169
    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);
    177171            }
    178172        }
     
    247241        $order_parent = new WC_Order($order_id_origin);
    248242
    249         shipping_envia_colvanes_ec()->log($new_status);
    250 
    251243        if(($order_parent->has_shipping_method($instance->id) ||
    252244                $order_parent->get_shipping_total() == 0 &&
     
    261253
    262254            update_post_meta($order->get_id(), 'guide_envia_colvanes', $guide->urlguia);
    263 
    264 
    265255        }
    266256    }
     
    271261    }
    272262
    273     public static function get_shop($product_id)
     263    public static function get_shop($product_id): array
    274264    {
    275265        $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  
    139139
    140140        $order = new WC_Order($post->ID);
    141 
    142141        $order_id_origin = $order->get_id();
    143 
    144142        $guide_url = get_post_meta($order_id_origin, 'guide_envia_colvanes', true);
    145143
     
    209207    public static function variation_settings_fields($loop, $variation_data, $variation)
    210208    {
     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
    211217        woocommerce_wp_text_input(
    212218            array(
     
    219225            )
    220226        );
     227
     228        ${"shipping_custom_price_product_smp_$variation->ID"} = true;
    221229    }
    222230
  • shipping-envia-colvanes-woo/tags/4.0.27/readme.txt

    r3083559 r3108891  
    66Tested up to: 6.5.2
    77Requires PHP: 8.1
    8 Stable tag: 4.0.26
     8Stable tag: 4.0.27
    99License: GNU General Public License v3.0
    1010License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    9696= 4.0.26 =
    9797* 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
    98102
    99103== Additional Info ==
  • shipping-envia-colvanes-woo/tags/4.0.27/shipping-envia-colvanes-woo.php

    r3083559 r3108891  
    33 * Plugin Name: Shipping Envia Colvanes Woo
    44 * Description: Shipping Envia Colvanes Woocommerce is available for Colombia
    5  * Version: 4.0.26
     5 * Version: 4.0.27
    66 * Author: Saul Morales Pacheco
    77 * Author URI: https://saulmoralespa.com
     
    1212 * Requires Plugins: woocommerce,departamentos-y-ciudades-de-colombia-para-woocommerce
    1313 *
    14  * @package ShippingCoordinadora
    1514 */
    1615
     
    2019
    2120if(!defined('SHIPPING_ENVIA_COLVANES_EC_VERSION')){
    22     define('SHIPPING_ENVIA_COLVANES_EC_VERSION', '4.0.26');
     21    define('SHIPPING_ENVIA_COLVANES_EC_VERSION', '4.0.27');
    2322}
    2423
  • shipping-envia-colvanes-woo/trunk/includes/admin/settings.php

    r3083559 r3108891  
    196196                'type'  => 'text',
    197197                'description' => __( 'Usuario de la cuenta de Envia Colvanes' ),
    198                 'desc_tip' => true
     198                'desc_tip' => true,
     199                'default' => 'EMPCAR01'
    199200            ),
    200201            'sandbox_password' => array(
     
    202203                'type'  => 'password',
    203204                'description' => __( 'Contraseña de la cuenta de Envia Colvanes' ),
    204                 'desc_tip' => true
     205                'desc_tip' => true,
     206                'default' => 'EMPCAR1'
    205207            ),
    206208            'sandbox_code_account' => array(
     
    208210                'type'  => 'text',
    209211                'description' => __( 'El código de la cuenta de Envia Colvanes' ),
    210                 'desc_tip' => true
     212                'desc_tip' => true,
     213                'default' => '001-001-30'
    211214            ),
    212215            'sandbox_is_collection' => array(
     
    241244                    12    => __( 'Paquete Terrestre')
    242245                )
    243             ),
     246            )
    244247        )
    245248    )
  • shipping-envia-colvanes-woo/trunk/includes/class-method-shipping-envia-colvanes-ec.php

    r3083559 r3108891  
    162162    {
    163163
    164         if (($key === 'code_account' ||
    165             $key === 'sandbox_code_account') &&
     164        if ($value && str_contains($key, 'code_account') &&
    166165            !preg_match('/^[0-9]+(-[0-9]+)+(-[0-9]+)$/', $value)
    167166        ){
     
    175174    {
    176175        $code_account = $this->get_option($key_option);
     176
     177        if(!$code_account) return;
     178
    177179        $code_account = explode('-', $code_account);
    178180
  • shipping-envia-colvanes-woo/trunk/includes/class-shipping-envia-colvanes-ec.php

    r3083559 r3108891  
    6161
    6262        try {
    63             $instance->enviaColvanes->liquidation($params);
     63            $res = $instance->enviaColvanes->liquidation($params);
    6464        } catch (\Exception $e) {
    6565            shipping_envia_colvanes_ec()->log($params);
     
    156156
    157157                $weight = ceil($weight);
     158                $volume_variant = $weight > 8 ? 400 : 222;
     159                $total_weight = round($length * $width * $height * $volume_variant / 1000000);
    158160
    159161                $data['cart_prods'][] = [
     
    166168                ];
    167169
    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);
    177171            }
    178172        }
     
    247241        $order_parent = new WC_Order($order_id_origin);
    248242
    249         shipping_envia_colvanes_ec()->log($new_status);
    250 
    251243        if(($order_parent->has_shipping_method($instance->id) ||
    252244                $order_parent->get_shipping_total() == 0 &&
     
    261253
    262254            update_post_meta($order->get_id(), 'guide_envia_colvanes', $guide->urlguia);
    263 
    264 
    265255        }
    266256    }
     
    271261    }
    272262
    273     public static function get_shop($product_id)
     263    public static function get_shop($product_id): array
    274264    {
    275265        $id = get_post_field( 'post_author', $product_id );
  • shipping-envia-colvanes-woo/trunk/includes/class-shipping-envia-colvanes-plugin-ec.php

    r3082125 r3108891  
    139139
    140140        $order = new WC_Order($post->ID);
    141 
    142141        $order_id_origin = $order->get_id();
    143 
    144142        $guide_url = get_post_meta($order_id_origin, 'guide_envia_colvanes', true);
    145143
     
    209207    public static function variation_settings_fields($loop, $variation_data, $variation)
    210208    {
     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
    211217        woocommerce_wp_text_input(
    212218            array(
     
    219225            )
    220226        );
     227
     228        ${"shipping_custom_price_product_smp_$variation->ID"} = true;
    221229    }
    222230
  • shipping-envia-colvanes-woo/trunk/readme.txt

    r3083559 r3108891  
    66Tested up to: 6.5.2
    77Requires PHP: 8.1
    8 Stable tag: 4.0.26
     8Stable tag: 4.0.27
    99License: GNU General Public License v3.0
    1010License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    9696= 4.0.26 =
    9797* 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
    98102
    99103== Additional Info ==
  • shipping-envia-colvanes-woo/trunk/shipping-envia-colvanes-woo.php

    r3083559 r3108891  
    33 * Plugin Name: Shipping Envia Colvanes Woo
    44 * Description: Shipping Envia Colvanes Woocommerce is available for Colombia
    5  * Version: 4.0.26
     5 * Version: 4.0.27
    66 * Author: Saul Morales Pacheco
    77 * Author URI: https://saulmoralespa.com
     
    1212 * Requires Plugins: woocommerce,departamentos-y-ciudades-de-colombia-para-woocommerce
    1313 *
    14  * @package ShippingCoordinadora
    1514 */
    1615
     
    2019
    2120if(!defined('SHIPPING_ENVIA_COLVANES_EC_VERSION')){
    22     define('SHIPPING_ENVIA_COLVANES_EC_VERSION', '4.0.26');
     21    define('SHIPPING_ENVIA_COLVANES_EC_VERSION', '4.0.27');
    2322}
    2423
Note: See TracChangeset for help on using the changeset viewer.