Changeset 3159775
- Timestamp:
- 09/30/2024 11:27:01 AM (18 months ago)
- Location:
- seur/trunk
- Files:
-
- 18 edited
-
classes/class-seur-collections.php (modified) (1 diff)
-
classes/class-seur-global.php (modified) (3 diffs)
-
classes/class-seur-seguimiento.php (modified) (1 diff)
-
classes/tcpdf/include/tcpdf_static.php (modified) (6 diffs)
-
classes/tcpdf/tcpdf.php (modified) (3 diffs)
-
core/functions/functions.php (modified) (1 diff)
-
core/labels-cpt/labels-cpt.php (modified) (1 diff)
-
core/pages/rates/seur-edit-form.php (modified) (2 diffs)
-
core/pages/seur-settings.php (modified) (1 diff)
-
core/woocommerce/includes/class-seur_local_shipping_method.php (modified) (5 diffs)
-
core/woocommerce/includes/class-wc-shipping-seur.php (modified) (1 diff)
-
core/woocommerce/includes/seur-woo-functions.php (modified) (2 diffs)
-
data/seur-products.php (modified) (2 diffs)
-
languages/seur-es_ES.mo (modified) (previous)
-
languages/seur-es_ES.po (modified) (2 diffs)
-
loader.php (modified) (2 diffs)
-
readme.txt (modified) (2 diffs)
-
uninstall.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
seur/trunk/classes/class-seur-collections.php
r2847513 r3159775 13 13 class Seur_Collections { 14 14 15 public function __construct() { 15 private string $seur_adr; 16 /** 17 * @var false|mixed 18 */ 19 private mixed $client_secret; 20 /** 21 * @var false|mixed 22 */ 23 private mixed $accountnumber; 24 /** 25 * @var false|mixed 26 */ 27 private mixed $nif; 28 /** 29 * @var false|mixed 30 */ 31 private mixed $phone; 32 private string $name; 33 /** 34 * @var false|mixed 35 */ 36 private mixed $email; 37 private string $streetname; 38 /** 39 * @var false|mixed 40 */ 41 private mixed $cityname; 42 /** 43 * @var false|mixed 44 */ 45 private mixed $postalcode; 46 /** 47 * @var false|mixed 48 */ 49 private mixed $country; 50 private string $token; 51 52 public function __construct() { 16 53 $this->seur_adr = seur()->get_api_addres() . SEUR_COLLECTIONS; 17 54 $this->client_secret = seur()->client_secret(); -
seur/trunk/classes/class-seur-global.php
r3130893 r3159775 12 12 13 13 class Seur_Global { 14 15 /** 16 * @var WC_Logger 17 */ 18 private $log; 14 19 15 20 public function __construct() { … … 947 952 public function is_seur_order($order_id) { 948 953 global $wpdb; 949 $query = "SELECT distinct o.order_id 954 $query = "SELECT distinct o.order_id 950 955 FROM {$wpdb->prefix}woocommerce_order_items o 951 956 inner join {$wpdb->prefix}woocommerce_order_itemmeta om on om.order_item_id = o.order_item_id … … 957 962 public function is_seur_local_method($custom_rate_id) { 958 963 global $wpdb; 959 $query = "SELECT ID 964 $query = "SELECT ID 960 965 FROM {$wpdb->prefix}seur_custom_rates 961 966 where rate like '%2SHOP' and ID = ".$custom_rate_id; -
seur/trunk/classes/class-seur-seguimiento.php
r3130893 r3159775 23 23 'wc-seur-corrected-doc' => 'DOCUMENTACIÓN RECTIFICADA', 24 24 ]; 25 26 public function __construct() { 25 /** 26 * @var false|mixed 27 */ 28 private mixed $client_secret; 29 /** 30 * @var false|mixed 31 */ 32 private mixed $accountnumber; 33 /** 34 * @var false|mixed 35 */ 36 private mixed $nif; 37 /** 38 * @var false|mixed 39 */ 40 private mixed $phone; 41 private string $name; 42 /** 43 * @var false|mixed 44 */ 45 private mixed $email; 46 private string $streetname; 47 /** 48 * @var false|mixed 49 */ 50 private mixed $cityname; 51 /** 52 * @var false|mixed 53 */ 54 private mixed $postalcode; 55 /** 56 * @var false|mixed 57 */ 58 private mixed $country; 59 private string $seur_adr; 60 private string $token; 61 private string $reftype; 62 /** 63 * @var false|mixed 64 */ 65 private mixed $full_account_number; 66 private string $accoun_number; 67 /** 68 * @var false|mixed 69 */ 70 private mixed $business_unit; 71 72 public function __construct() { 27 73 28 74 $this->client_secret = seur()->client_secret(); -
seur/trunk/classes/tcpdf/include/tcpdf_static.php
r3130893 r3159775 141 141 } 142 142 if (PHP_VERSION_ID < 50300) { 143 @set_magic_quotes_runtime($mqr);143 //@set_magic_quotes_runtime($mqr); 144 144 } 145 145 } … … 451 451 return $iv.substr($text, 0, -16); 452 452 } 453 $iv = mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC), MCRYPT_RAND);454 $text = mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $key, $text, MCRYPT_MODE_CBC, $iv);453 $iv = openssl_random_pseudo_bytes(openssl_cipher_iv_length('aes-128-cbc')); 454 $text = openssl_encrypt($text, 'aes-128-cbc', $key, OPENSSL_RAW_DATA, $iv); 455 455 $text = $iv.$text; 456 456 return $text; … … 473 473 return substr($text, 0, -16); 474 474 } 475 $iv = str_repeat("\x00", mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC));476 $text = mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $key, $text, MCRYPT_MODE_CBC, $iv);475 $iv = openssl_random_pseudo_bytes(openssl_cipher_iv_length('aes-128-cbc')); 476 $text = openssl_encrypt($text, 'aes-128-cbc', $key, OPENSSL_RAW_DATA, $iv); 477 477 return $text; 478 478 } … … 491 491 */ 492 492 public static function _RC4($key, $text, &$last_enc_key, &$last_enc_key_c) { 493 if (function_exists('mcrypt_encrypt') AND ($out = @mcrypt_encrypt(MCRYPT_ARCFOUR, $key, $text, MCRYPT_MODE_STREAM, ''))) { 494 // try to use mcrypt function if exist 495 return $out; 496 } 493 if (function_exists('openssl_encrypt')) { 494 $out = openssl_encrypt($text, 'rc4', $key, OPENSSL_RAW_DATA); 495 if ($out !== false) { 496 return $out; 497 } 498 } 497 499 if ($last_enc_key != $key) { 498 500 $k = str_repeat($key, ((256 / strlen($key)) + 1)); … … 1835 1837 curl_setopt($crs, CURLOPT_NOBODY, true); 1836 1838 curl_setopt($crs, CURLOPT_FAILONERROR, true); 1837 if ( (ini_get('open_basedir') == '') && (!ini_get('safe_mode'))) {1838 curl_setopt($crs, CURLOPT_FOLLOWLOCATION, true);1839 }1839 if (ini_get('open_basedir') == '') { 1840 curl_setopt($crs, CURLOPT_FOLLOWLOCATION, true); 1841 } 1840 1842 curl_setopt($crs, CURLOPT_CONNECTTIMEOUT, 5); 1841 1843 curl_setopt($crs, CURLOPT_TIMEOUT, 30); … … 1966 1968 curl_setopt($crs, CURLOPT_FAILONERROR, true); 1967 1969 curl_setopt($crs, CURLOPT_RETURNTRANSFER, true); 1968 if ( (ini_get('open_basedir') == '') && (!ini_get('safe_mode'))) {1969 curl_setopt($crs, CURLOPT_FOLLOWLOCATION, true);1970 }1970 if (ini_get('open_basedir') == '') { 1971 curl_setopt($crs, CURLOPT_FOLLOWLOCATION, true); 1972 } 1971 1973 curl_setopt($crs, CURLOPT_CONNECTTIMEOUT, 5); 1972 1974 curl_setopt($crs, CURLOPT_TIMEOUT, 30); -
seur/trunk/classes/tcpdf/tcpdf.php
r3120329 r3159775 1836 1836 // METHODS 1837 1837 //------------------------------------------------------------ 1838 1839 /** 1838 private XMLParser $parser; 1839 1840 /** 1840 1841 * This is the class constructor. 1841 1842 * It allows to set up the page format, the orientation and the measure unit used in all the methods (except for the font sizes). … … 10929 10930 $this->Error('AES encryption requires openssl/aes-256-cbc cypher.'); 10930 10931 } 10931 if (extension_loaded('mcrypt') && mcrypt_get_cipher_name(MCRYPT_RIJNDAEL_128) === false) {10932 /*if (extension_loaded('mcrypt') && mcrypt_get_cipher_name(MCRYPT_RIJNDAEL_128) === false) { 10932 10933 $this->Error('AES encryption requires MCRYPT_RIJNDAEL_128 cypher.'); 10933 } 10934 }*/ 10934 10935 if (($mode == 3) AND !function_exists('hash')) { 10935 10936 // the Hash extension requires no external libraries and is enabled by default as of PHP 5.1.2. … … 16362 16363 $selfclosingtags = array('area','base','basefont','br','hr','input','img','link','meta'); 16363 16364 // remove all unsupported tags (the line below lists all supported tags) 16364 $html = strip_tags($html, '<marker /><a><b><blockquote><body><br><br/><dd><del><div><dl><dt><em><font><form><h1><h2><h3><h4><h5><h6><hr><hr/><i><img><input><label><li><ol><option><p><pre><s><select><small><span><strike><strong><sub><sup><table><tablehead><tcpdf><td><textarea><th><thead><tr><tt><u><ul>');16365 //replace some blank characters16365 $html = strip_tags($html, '<marker><a><b><blockquote><body><br><dd><del><div><dl><dt><em><font><form><h1><h2><h3><h4><h5><h6><hr><i><img><input><label><li><ol><option><p><pre><s><select><small><span><strike><strong><sub><sup><table><tablehead><tcpdf><td><textarea><th><thead><tr><tt><u><ul>'); 16366 //replace some blank characters 16366 16367 $html = preg_replace('/<pre/', '<xre', $html); // preserve pre tag 16367 16368 $html = preg_replace('/<(table|tr|td|th|tcpdf|blockquote|dd|div|dl|dt|form|h1|h2|h3|h4|h5|h6|br|hr|li|ol|ul|p)([^\>]*)>[\n\r\t]+/', '<\\1\\2>', $html); -
seur/trunk/core/functions/functions.php
r3130893 r3159775 12 12 use Automattic\WooCommerce\Internal\DataStores\Orders\CustomOrdersTableController; 13 13 use Automattic\WooCommerce\Utilities\OrderUtil; 14 require_once ABSPATH . 'wp-content/plugins/woocommerce/includes/admin/wc-admin-functions.php';14 require_once WP_PLUGIN_DIR . '/woocommerce/includes/admin/wc-admin-functions.php'; 15 15 16 16 /** -
seur/trunk/core/labels-cpt/labels-cpt.php
r3130893 r3159775 447 447 $order_manifest['id'] = $id_order; 448 448 $order_manifest['reference'] = $order->get_meta('_seur_shipping_id_number'); 449 $order_manifest['consig_name'] = $order->get_ billing_first_name()." ".$order->get_billing_last_name();449 $order_manifest['consig_name'] = $order->get_shipping_first_name()." ".$order->get_shipping_last_name(); 450 450 $order_manifest['consig_address'] = $order->get_shipping_address_1(); 451 451 $order_manifest['consig_postalcode'] = $order->get_shipping_postcode(); -
seur/trunk/core/pages/rates/seur-edit-form.php
r3119152 r3159775 83 83 } else { 84 84 $countries = array(); 85 $countries = include _once SEUR_PLUGIN_PATH . 'core/places/countries.php';86 $countries =asort( $countries );85 $countries = include(SEUR_PLUGIN_PATH . 'core/places/countries.php'); 86 asort( $countries ); 87 87 echo '<option value="*">' . esc_html__( 'All Countries', 'seur' ) . '</option>'; 88 88 foreach ( $countries as $country => $value ) { … … 123 123 } 124 124 } 125 if ( ! $states ) {125 if ( !$states ) { 126 126 $currentstate = $getrate->state; 127 127 echo '<input title="' . esc_html__( 'State', 'seur' ) . '" type="text" name="state" class="form-control" placeholder="' . esc_html__( 'State', 'seur' ) . '" value="' . esc_html( $currentstate ) . '">'; 128 }129 if ( '*' === $country ) {130 echo '<input title="' . esc_html__( 'No needed', 'seur' ) . '" type="text" name="state" class="form-control" placeholder="' . esc_html__( 'No needed', 'seur' ) . '" value="*" readonly>';131 128 } 132 129 ?> -
seur/trunk/core/pages/seur-settings.php
r2826393 r3159775 42 42 settings_fields( 'seur-user-settings-section' ); 43 43 do_settings_sections( 'seur-user-settings-options' ); 44 wp_kses_post( _e( '(<sup>*</sup>) This data is provided by SEUR', 'seur' ) );44 echo wp_kses_post( __( '(<sup>*</sup>) This data is provided by SEUR', 'seur' ) ); 45 45 } else { 46 46 ?> -
seur/trunk/core/woocommerce/includes/class-seur_local_shipping_method.php
r3119152 r3159775 17 17 class Seur_Local_Shipping_Method extends WC_Shipping_Method { 18 18 19 /** 19 /** 20 * @var WC_Logger 21 */ 22 private $log; 23 24 /** 20 25 * Constructor. The instance ID is passed to this. 21 26 * … … 69 74 $package_price = $package['contents_cost']; 70 75 if ( $rates_type != 'price' ) { 71 $weight = 0 ;76 $weight = 0.0; 72 77 73 78 foreach ( $package['contents'] as $item_id => $values ) { 74 79 $_product = $values['data']; 75 $weight = ( int) $weight + (int) $_product->get_weight() * (int) $values['quantity'];80 $weight = (float)$weight + ((float)$_product->get_weight() * (float)$values['quantity']); 76 81 } 77 82 $package_price = wc_get_weight( $weight, 'kg' ); … … 151 156 $seur_local_shipping_method = new Seur_Local_Shipping_Method(); 152 157 $weightlimit = (int) 20; 153 $weight = 0 ;158 $weight = 0.0; 154 159 foreach ( $package['contents'] as $item_id => $values ) { 155 160 $_product = $values['data']; 156 $weight = $weight + $_product->get_weight() * $values['quantity'];161 $weight = (float)$weight + ((float)$_product->get_weight() * (float)$values['quantity']); 157 162 } 158 163 $weight = wc_get_weight( $weight, 'kg' ); … … 488 493 $order->update_meta_data('_seur_2shop_depot', str_pad( $depot, 2, '0', STR_PAD_LEFT ) ); 489 494 $order->update_meta_data('_seur_2shop_postcode', $postcode ); 490 $order->update_meta_data('_seur_2shop_codCentro', str_pad( $cod_centro, 3, '0', STR_PAD_LEFT ));495 $order->update_meta_data('_seur_2shop_codCentro', $pudoId ); 491 496 $order->update_meta_data('_seur_2shop_title', $title ); 492 497 $order->update_meta_data('_seur_2shop_type', $type ); … … 500 505 $order->update_meta_data('_seur_2shop_timetable', $timetable ); 501 506 $order->save_meta_data(); 507 508 // Set order shipping address to pick-up location address 509 $shipping_address = $order->get_address('shipping'); 510 $shipping_address['address_1'] = __( 'Pickup store', 'seur' ) . ": {$title} - {$pudoId}"; 511 $shipping_address['address_2'] = "{$streettype} {$address} {$numvia}"; 512 $shipping_address['city'] = $city; 513 $shipping_address['postcode'] = $postcode; 514 $order->set_address($shipping_address , 'shipping' ); 515 $order->save(); 502 516 } 503 517 } -
seur/trunk/core/woocommerce/includes/class-wc-shipping-seur.php
r3119152 r3159775 18 18 */ 19 19 class WC_Shipping_SEUR extends WC_Shipping_Method { 20 21 /** 22 * @var WC_Logger 23 */ 24 private $log; 25 26 /** 27 * @var bool 28 */ 29 public $debug; 30 31 /** 32 * @var string 33 */ 34 public $title; 35 36 /** 37 * @var string 38 */ 39 public $simple_advanced; 40 41 /** 42 * @var string 43 */ 44 public $user_id; 45 46 /** 47 * @var string 48 */ 49 public $password; 50 51 /** 52 * @var string 53 */ 54 public $access_key; 55 56 /** 57 * @var string 58 */ 59 public $shipper_number; 60 61 /** 62 * @var bool 63 */ 64 public $origin_addressline; 65 66 /** 67 * @var string 68 */ 69 public $origin_city; 70 71 /** 72 * @var string 73 */ 74 public $origin_postcode; 75 76 /** 77 * @var string 78 */ 79 public $origin_country_state; 80 81 /** 82 * @var string 83 */ 84 public $pickup; 85 86 /** 87 * @var bool 88 */ 89 public $residential; 90 91 /** 92 * @var string 93 */ 94 public $offer_rates; 95 96 /** 97 * @var string 98 */ 99 public $fallback; 100 101 /** 102 * @var string 103 */ 104 public $packing_method; 105 106 /** 107 * @var array 108 */ 109 public $seur_packaging; 110 111 /** 112 * @var array 113 */ 114 public $custom_services; 115 116 /** 117 * @var array 118 */ 119 public $boxes; 120 121 /** 122 * @var bool 123 */ 124 public $insuredvalue; 125 126 /** 127 * @var string|bool 128 */ 129 public $units; 130 131 /** 132 * @var string 133 */ 134 public $weight_unit; 135 136 /** 137 * @var string 138 */ 139 public $dim_unit; 140 141 /** 142 * @var string 143 */ 144 public $origin_country; 145 146 /** 147 * @var string 148 */ 149 public $origin_state; 20 150 21 151 /** -
seur/trunk/core/woocommerce/includes/seur-woo-functions.php
r3130893 r3159775 79 79 } 80 80 81 $items = $order->get_items(); 82 $total_weight = 0; 83 foreach ($items as $item) { 84 $product_quantity = $item->get_quantity(); 85 $product_weight = $item->get_product()->get_weight(); // Obtiene el peso del producto 86 $total_weight += $product_weight * $product_quantity; 87 } 88 89 $order->update_meta_data('_seur_cart_weight', $total_weight ); 81 // Compute total order weight if not computed already (by seur_add_cart_weight()) 82 if ( empty($order->get_meta('_seur_cart_weight')) ) { 83 $items = $order->get_items(); 84 $total_weight = 0.0; 85 foreach ( $items as $item ) { 86 $hidden = $item->get_meta( '_bundled_item_hidden' ); 87 // Do not add the hidden items inside the pack 88 if ( $hidden != 'yes' ) { 89 $product_quantity = $item->get_quantity(); 90 $product_weight = $item->get_product()->get_weight(); // Obtiene el peso del producto 91 $total_weight += (float) $product_weight * (float) $product_quantity; 92 } 93 } 94 95 $order->update_meta_data( '_seur_cart_weight', $total_weight ); 96 } 97 90 98 $order->save_meta_data(); 99 } 100 // When the event woocommerce_checkout_update_order_meta is triggered we can obtain the cart weight 101 // from Woocommerce (which should more accurate that any calculation we can perform). 102 // But the event is not triggered in all versions (see bug), so there is a second point where weight is computed (above). 103 add_action('woocommerce_checkout_update_order_meta', 'seur_add_cart_weight'); 104 function seur_add_cart_weight( $order_id ) { 105 global $woocommerce; 106 107 $weight = $woocommerce->cart->cart_contents_weight; 108 update_post_meta( $order_id, '_seur_cart_weight', $weight ); 91 109 } 92 110 … … 508 526 <select name="_shop_order_seur_shipping_method" id="dropdown_shop_order_seur_shipping_method"> 509 527 <option value=""><?php esc_html_e( 'All', 'seur' ); ?></option> 510 <option value="seur" 528 <option value="seur" 511 529 <?php 512 530 if ( ( esc_attr( isset( $_GET['_shop_order_seur_shipping_method'] ) ) ) && ( esc_attr( $_GET['_shop_order_seur_shipping_method'] ) == 'seur' ) ) { -
seur/trunk/data/seur-products.php
r3120329 r3159775 25 25 * SEUR 72H Estándar -> Servicio = 13, Producto 2 --> ES -> all -> ESTANDAR 26 26 * SEUR 2SHOP -> Servicio = 1, Producto 48 --> AD/ES/PT -> all -> ESTANDAR 27 * SEUR 13:30 Documentos -> Servicio = 9, Producto 54 --> AD/ES/PT -> all -> ESTANDAR 27 28 * 28 29 * Internacional … … 122 123 'field' => 'seur_13f' 123 124 ), 125 'SEUR 13:30 Documentos' => array( 126 'service' => '9', 127 'product' => '54', 128 'tipo' => 'ESTANDAR', 129 'pais' => array( 130 'AD', 131 'ES', 132 'PT' 133 ), 134 'provincia' => array( 135 'all', 136 ), 137 'field' => 'seur_13d' 138 ), 124 139 'SEUR 24H Estándar' => array( 125 140 'service' => '1', -
seur/trunk/languages/seur-es_ES.po
r3120329 r3159775 704 704 msgid "https://www.joseconti.com/" 705 705 msgstr "https://www.joseconti.com/" 706 707 #. Author of the plugin708 msgid "SEUR"709 msgstr "SEUR"710 706 711 707 #. Plugin URI of the plugin … … 2257 2253 msgid "Activate Change Service" 2258 2254 msgstr "Activar el servicio 'cambio'" 2255 2256 msgid "Pickup store" 2257 msgstr "Punto de recogida" -
seur/trunk/loader.php
r3130893 r3159775 4 4 * Plugin URI: http://www.seur.com/ 5 5 * Description: Add SEUR shipping method to WooCommerce. The SEUR plugin for WooCommerce allows you to manage your order dispatches in a fast and easy way 6 * Version: 2.2.1 16 * Version: 2.2.12 7 7 * Author: SEUR Oficial 8 8 * Author URI: http://www.seur.com/ … … 18 18 **/ 19 19 20 define( 'SEUR_OFFICIAL_VERSION', '2.2.1 1' );20 define( 'SEUR_OFFICIAL_VERSION', '2.2.12' ); 21 21 define( 'SEUR_DB_VERSION', '1.0.4' ); 22 22 define( 'SEUR_TABLE_VERSION', '1.0.4' ); -
seur/trunk/readme.txt
r3130893 r3159775 4 4 Requires at least: 4.0 5 5 Tested up to: 6.2 6 Stable tag: 2.2.1 16 Stable tag: 2.2.12 7 7 WC requires at least: 3.0 8 8 WC tested up to: 7.4 … … 93 93 94 94 == Changelog == 95 96 == 2.2.12 == 97 98 * ADDED: Add new service 13:30 Documentos 99 * ADDED: PHP8.2 compatibility 100 * CHANGED: Change _seur_2shop_codCentro value 101 * FIXED: Fix manifest consig_name 102 * FIXED: Fix plugins path include 103 * FIXED: Set shipping address to pick-up location address for pick-up orders 104 * FIXED: Order weight is computed in excess when the order contains product packs 105 * FIXED: Cannot select country when editing custom rate 106 * FIXED: Erroneous rate calculation for local service SEUR 2SHOP 95 107 96 108 == 2.2.11 == -
seur/trunk/uninstall.php
r3119152 r3159775 79 79 'seur_13e_max_price_field', 80 80 'seur_13f_max_price_field', 81 'seur_13d_max_price_field', 81 82 'seur_48h_max_price_field', 82 83 'seur_72h_max_price_field', … … 88 89 'seur_13e_custom_name_field', 89 90 'seur_13f_custom_name_field', 91 'seur_13d_custom_name_field', 90 92 'seur_48h_custom_name_field', 91 93 'seur_72h_custom_name_field',
Note: See TracChangeset
for help on using the changeset viewer.