Changeset 3488363
- Timestamp:
- 03/22/2026 06:40:45 PM (10 days ago)
- Location:
- myd-delivery
- Files:
-
- 12 edited
- 1 copied
-
tags/1.6.2 (copied) (copied from myd-delivery/trunk)
-
tags/1.6.2/README.txt (modified) (2 diffs)
-
tags/1.6.2/includes/class-create-draft-order.php (modified) (2 diffs)
-
tags/1.6.2/includes/class-price-calculator.php (modified) (2 diffs)
-
tags/1.6.2/includes/class-store-data.php (modified) (1 diff)
-
tags/1.6.2/myd-delivery.php (modified) (2 diffs)
-
tags/1.6.2/vendor/composer/installed.php (modified) (2 diffs)
-
trunk/README.txt (modified) (2 diffs)
-
trunk/includes/class-create-draft-order.php (modified) (2 diffs)
-
trunk/includes/class-price-calculator.php (modified) (2 diffs)
-
trunk/includes/class-store-data.php (modified) (1 diff)
-
trunk/myd-delivery.php (modified) (2 diffs)
-
trunk/vendor/composer/installed.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
myd-delivery/tags/1.6.2/README.txt
r3488360 r3488363 5 5 Requires at least: 5.5 6 6 Tested up to: 6.9 7 Stable tag: 1.6. 17 Stable tag: 1.6.2 8 8 Requires PHP: 7.4 9 9 License: GPL-3.0+ … … 75 75 76 76 == Changelog == 77 78 = 1.6.2 = 79 * Changed: code improvements in shipping method per cep range. 77 80 78 81 = 1.6.1 = -
myd-delivery/tags/1.6.2/includes/class-create-draft-order.php
r3487445 r3488363 193 193 } 194 194 195 $this->calculate_total(); 195 $result = $this->calculate_total(); 196 if ( \is_wp_error( $result ) ) { 197 return $result; 198 } 196 199 197 200 $order_items = array(); … … 240 243 /** 241 244 * Calculate order total 242 */ 243 private function calculate_total(): void { 245 * 246 * @return \WP_Error|void 247 */ 248 private function calculate_total() { 244 249 $this->subtotal = $this->cart->total; 245 250 $shipping_price = (float) ( $this->shipping['price'] ?? 0 ); 246 251 252 $shipping_data = $this->shipping; 253 $shipping_data['zipcode'] = $this->customer['address']['zipcode'] ?? ''; 254 247 255 $validated_shipping = Price_Calculator::validate_shipping_price( 248 256 $shipping_price, 249 $ this->shipping257 $shipping_data 250 258 ); 251 259 if ( $validated_shipping === false ) { 260 if ( $this->type === 'delivery' ) { 261 return new \WP_Error( 'invalid_shipping', __( 'Invalid delivery price. Please try again.', 'myd-delivery' ) ); 262 } 252 263 $validated_shipping = 0.0; 253 264 } -
myd-delivery/tags/1.6.2/includes/class-price-calculator.php
r3488360 r3488363 137 137 $options = get_option( 'myddelivery-operation-mode-options' ); 138 138 139 if ( ! is set( $options[ $method ] ) ) {139 if ( ! is_array( $options ) || ! isset( $options[ $method ] ) ) { 140 140 return 0.0; 141 141 } … … 165 165 case 'per-cep': 166 166 $ranges = $config['options'] ?? $config; 167 $zipcode = (int) ( $shipping_data['zipcode'] ?? 0);167 $zipcode = (int) preg_replace( '/\D/', '', $shipping_data['zipcode'] ?? '' ); 168 168 foreach ( $ranges as $range ) { 169 169 $from = (int) ( $range['from'] ?? 0 ); -
myd-delivery/tags/1.6.2/includes/class-store-data.php
r3478512 r3488363 76 76 } 77 77 78 if ( array_key_exists( $data, self::$store_data ) ) { 79 return self::$store_data[ $data ]; 80 } 78 return self::$store_data[ $data ] ?? null; 81 79 } 82 80 } -
myd-delivery/tags/1.6.2/myd-delivery.php
r3488360 r3488363 6 6 * Author: EduardoVillao.me 7 7 * Author URI: https://eduardovillao.me/ 8 * Version: 1.6. 18 * Version: 1.6.2 9 9 * Requires PHP: 7.4 10 10 * Requires at least: 5.5 … … 26 26 define( 'MYDDELIVERY_BASENAME', plugin_basename( __FILE__ ) ); 27 27 define( 'MYDDELIVERY_DIRNAME', plugin_basename( __DIR__ ) ); 28 define( 'MYDDELIVERY_VERSION', '1.6. 1' );28 define( 'MYDDELIVERY_VERSION', '1.6.2' ); 29 29 define( 'MYDDELIVERY_MIN_PHP_VERSION', '7.4' ); 30 30 define( 'MYDDELIVERY_MIN_WP_VERSION', '5.5' ); -
myd-delivery/tags/1.6.2/vendor/composer/installed.php
r3488360 r3488363 2 2 'root' => array( 3 3 'name' => 'eduardovillao/myd-delivery', 4 'pretty_version' => 'v1.6. 1',5 'version' => '1.6. 1.0',6 'reference' => ' 5cdf7b4df0a190c74d2c87596790542fc26f04ac',4 'pretty_version' => 'v1.6.2', 5 'version' => '1.6.2.0', 6 'reference' => 'f5b72be95efee9f39493d4beed49bde6970c5ea2', 7 7 'type' => 'project', 8 8 'install_path' => __DIR__ . '/../../', … … 12 12 'versions' => array( 13 13 'eduardovillao/myd-delivery' => array( 14 'pretty_version' => 'v1.6. 1',15 'version' => '1.6. 1.0',16 'reference' => ' 5cdf7b4df0a190c74d2c87596790542fc26f04ac',14 'pretty_version' => 'v1.6.2', 15 'version' => '1.6.2.0', 16 'reference' => 'f5b72be95efee9f39493d4beed49bde6970c5ea2', 17 17 'type' => 'project', 18 18 'install_path' => __DIR__ . '/../../', -
myd-delivery/trunk/README.txt
r3488360 r3488363 5 5 Requires at least: 5.5 6 6 Tested up to: 6.9 7 Stable tag: 1.6. 17 Stable tag: 1.6.2 8 8 Requires PHP: 7.4 9 9 License: GPL-3.0+ … … 75 75 76 76 == Changelog == 77 78 = 1.6.2 = 79 * Changed: code improvements in shipping method per cep range. 77 80 78 81 = 1.6.1 = -
myd-delivery/trunk/includes/class-create-draft-order.php
r3487445 r3488363 193 193 } 194 194 195 $this->calculate_total(); 195 $result = $this->calculate_total(); 196 if ( \is_wp_error( $result ) ) { 197 return $result; 198 } 196 199 197 200 $order_items = array(); … … 240 243 /** 241 244 * Calculate order total 242 */ 243 private function calculate_total(): void { 245 * 246 * @return \WP_Error|void 247 */ 248 private function calculate_total() { 244 249 $this->subtotal = $this->cart->total; 245 250 $shipping_price = (float) ( $this->shipping['price'] ?? 0 ); 246 251 252 $shipping_data = $this->shipping; 253 $shipping_data['zipcode'] = $this->customer['address']['zipcode'] ?? ''; 254 247 255 $validated_shipping = Price_Calculator::validate_shipping_price( 248 256 $shipping_price, 249 $ this->shipping257 $shipping_data 250 258 ); 251 259 if ( $validated_shipping === false ) { 260 if ( $this->type === 'delivery' ) { 261 return new \WP_Error( 'invalid_shipping', __( 'Invalid delivery price. Please try again.', 'myd-delivery' ) ); 262 } 252 263 $validated_shipping = 0.0; 253 264 } -
myd-delivery/trunk/includes/class-price-calculator.php
r3488360 r3488363 137 137 $options = get_option( 'myddelivery-operation-mode-options' ); 138 138 139 if ( ! is set( $options[ $method ] ) ) {139 if ( ! is_array( $options ) || ! isset( $options[ $method ] ) ) { 140 140 return 0.0; 141 141 } … … 165 165 case 'per-cep': 166 166 $ranges = $config['options'] ?? $config; 167 $zipcode = (int) ( $shipping_data['zipcode'] ?? 0);167 $zipcode = (int) preg_replace( '/\D/', '', $shipping_data['zipcode'] ?? '' ); 168 168 foreach ( $ranges as $range ) { 169 169 $from = (int) ( $range['from'] ?? 0 ); -
myd-delivery/trunk/includes/class-store-data.php
r3478512 r3488363 76 76 } 77 77 78 if ( array_key_exists( $data, self::$store_data ) ) { 79 return self::$store_data[ $data ]; 80 } 78 return self::$store_data[ $data ] ?? null; 81 79 } 82 80 } -
myd-delivery/trunk/myd-delivery.php
r3488360 r3488363 6 6 * Author: EduardoVillao.me 7 7 * Author URI: https://eduardovillao.me/ 8 * Version: 1.6. 18 * Version: 1.6.2 9 9 * Requires PHP: 7.4 10 10 * Requires at least: 5.5 … … 26 26 define( 'MYDDELIVERY_BASENAME', plugin_basename( __FILE__ ) ); 27 27 define( 'MYDDELIVERY_DIRNAME', plugin_basename( __DIR__ ) ); 28 define( 'MYDDELIVERY_VERSION', '1.6. 1' );28 define( 'MYDDELIVERY_VERSION', '1.6.2' ); 29 29 define( 'MYDDELIVERY_MIN_PHP_VERSION', '7.4' ); 30 30 define( 'MYDDELIVERY_MIN_WP_VERSION', '5.5' ); -
myd-delivery/trunk/vendor/composer/installed.php
r3488360 r3488363 2 2 'root' => array( 3 3 'name' => 'eduardovillao/myd-delivery', 4 'pretty_version' => 'v1.6. 1',5 'version' => '1.6. 1.0',6 'reference' => ' 5cdf7b4df0a190c74d2c87596790542fc26f04ac',4 'pretty_version' => 'v1.6.2', 5 'version' => '1.6.2.0', 6 'reference' => 'f5b72be95efee9f39493d4beed49bde6970c5ea2', 7 7 'type' => 'project', 8 8 'install_path' => __DIR__ . '/../../', … … 12 12 'versions' => array( 13 13 'eduardovillao/myd-delivery' => array( 14 'pretty_version' => 'v1.6. 1',15 'version' => '1.6. 1.0',16 'reference' => ' 5cdf7b4df0a190c74d2c87596790542fc26f04ac',14 'pretty_version' => 'v1.6.2', 15 'version' => '1.6.2.0', 16 'reference' => 'f5b72be95efee9f39493d4beed49bde6970c5ea2', 17 17 'type' => 'project', 18 18 'install_path' => __DIR__ . '/../../',
Note: See TracChangeset
for help on using the changeset viewer.