Changeset 3050178
- Timestamp:
- 03/13/2024 05:00:17 AM (2 years ago)
- Location:
- woocommerce-iran-post-shipping
- Files:
-
- 19 added
- 6 edited
-
tags/5.0.3 (added)
-
tags/5.0.3/assets (added)
-
tags/5.0.3/assets/post-arm.png (added)
-
tags/5.0.3/includes (added)
-
tags/5.0.3/includes/DediData (added)
-
tags/5.0.3/includes/DediData/class-plugin-autoloader.php (added)
-
tags/5.0.3/includes/DediData/class-singleton.php (added)
-
tags/5.0.3/includes/IranPostShipping (added)
-
tags/5.0.3/includes/IranPostShipping/class-admin-menu.php (added)
-
tags/5.0.3/includes/IranPostShipping/class-iran-post-shipping.php (added)
-
tags/5.0.3/includes/IranPostShipping/class-wc-shipping-bike.php (added)
-
tags/5.0.3/includes/IranPostShipping/class-wc-shipping-certified.php (added)
-
tags/5.0.3/includes/IranPostShipping/class-wc-shipping-cod.php (added)
-
tags/5.0.3/includes/IranPostShipping/class-wc-shipping-express.php (added)
-
tags/5.0.3/iran-post-shipping.php (added)
-
tags/5.0.3/languages (added)
-
tags/5.0.3/languages/readme.txt (added)
-
tags/5.0.3/license.txt (added)
-
tags/5.0.3/readme.txt (added)
-
trunk/includes/IranPostShipping/class-wc-shipping-bike.php (modified) (1 diff)
-
trunk/includes/IranPostShipping/class-wc-shipping-certified.php (modified) (2 diffs)
-
trunk/includes/IranPostShipping/class-wc-shipping-cod.php (modified) (6 diffs)
-
trunk/includes/IranPostShipping/class-wc-shipping-express.php (modified) (2 diffs)
-
trunk/iran-post-shipping.php (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
woocommerce-iran-post-shipping/trunk/includes/IranPostShipping/class-wc-shipping-bike.php
r3049844 r3050178 213 213 $this->title .= sprintf( esc_html_x( ' (Only for the province of %s)', 'The source province', 'woocommerce-iran-post-shipping' ), $this->form_fields['source_state']['options'][ $this->source_state ] ); 214 214 } 215 216 $package_cost = $package['contents_cost']; 217 // Convert current currency to rial 218 if ( 'IRT' === $this->current_currency ) { 219 $package_cost = $package['contents_cost'] * 10; 220 } elseif ( 'IRHT' === $this->current_currency ) { 221 $package_cost = $package['contents_cost'] * 10000; 222 } 223 224 $this->free_for_price = '' !== $this->free_for_price ? intval( $this->free_for_price ) : ''; 225 if ( '' !== $this->free_for_price && $package_cost >= $this->free_for_price ) { 226 $shipping_total = 0; 227 } 228 215 229 // Register the rate 216 230 $rate = array( -
woocommerce-iran-post-shipping/trunk/includes/IranPostShipping/class-wc-shipping-certified.php
r3045170 r3050178 355 355 } 356 356 357 $package_cost = $package['contents_cost']; 357 358 // Convert current currency to rial 358 359 if ( 'IRT' === $this->current_currency ) { … … 362 363 } 363 364 364 $this->free_for_price = isset( $this->free_for_price )? intval( $this->free_for_price ) : '';365 $this->free_for_price = '' !== $this->free_for_price ? intval( $this->free_for_price ) : ''; 365 366 if ( '' === $this->free_for_price || $package_cost < $this->free_for_price ) { 366 367 $rate_price = array(); -
woocommerce-iran-post-shipping/trunk/includes/IranPostShipping/class-wc-shipping-cod.php
r3045170 r3050178 56 56 57 57 // Define user set variables 58 $this->enabled = $this->get_option( 'enabled' ); 59 $this->title = $this->get_option( 'title' ); 60 $this->minimum_weight = $this->get_option( 'minimum_weight' ); 58 $this->enabled = $this->get_option( 'enabled' ); 59 $this->title = $this->get_option( 'title' ); 60 $this->extra_cost = intval( $this->get_option( 'extra_cost' ) ); 61 $this->extra_cost_percent = intval( $this->get_option( 'extra_cost_percent' ) ); 62 // IRR or IRT or IRHT 63 $this->current_currency = get_woocommerce_currency(); 64 $this->minimum_weight = $this->get_option( 'minimum_weight' ); 61 65 // g or kg 62 66 $this->current_weight_unit = get_option( 'woocommerce_weight_unit' ); 63 64 67 // Save settings in admin if you have any defined 65 68 add_action( 'woocommerce_update_options_shipping_' . $this->id, array( $this, 'process_admin_options' ) ); … … 73 76 public function init_form_fields() { 74 77 $this->form_fields = array( 75 'enabled' => array(78 'enabled' => array( 76 79 'title' => esc_html__( 'Active/Inactive', 'woocommerce-iran-post-shipping' ), 77 80 'type' => 'checkbox', … … 79 82 'default' => 'no', 80 83 ), 81 'title' => array(84 'title' => array( 82 85 'title' => esc_html__( 'Method Title', 'woocommerce-iran-post-shipping' ), 83 86 'type' => 'text', … … 86 89 'desc_tip' => true, 87 90 ), 88 'minimum_weight' => array( 91 'extra_cost' => array( 92 'title' => esc_html__( 'Additional costs in Iranian Rial', 'woocommerce-iran-post-shipping' ), 93 'type' => 'text', 94 'description' => esc_html__( 'In this section, you can enter additional costs in addition to the postage rate, such as packaging costs, etc. Enter the fixed amount in Iranian Rial.', 'woocommerce-iran-post-shipping' ), 95 'default' => '', 96 'desc_tip' => true, 97 ), 98 'extra_cost_percent' => array( 99 'title' => esc_html__( 'Additional costs as a percentage', 'woocommerce-iran-post-shipping' ), 100 'type' => 'text', 101 'description' => esc_html__( 'In this section, you can enter additional costs as a percentage in addition to the postage rate. Enter only the numeric value in this section. For example, for 2%, enter the number 2.', 'woocommerce-iran-post-shipping' ), 102 'default' => '', 103 'desc_tip' => true, 104 ), 105 'minimum_weight' => array( 89 106 'title' => esc_html__( 'Active only for a weight greater than or equal to this amount (in grams)', 'woocommerce-iran-post-shipping' ), 90 107 'type' => 'text', … … 112 129 $cart_weight *= 1000; 113 130 } 114 131 115 132 // Detect the weight plan 116 133 if ( '' === $this->minimum_weight ) { … … 120 137 if ( $cart_weight < $this->minimum_weight ) { 121 138 return; 139 } 140 141 $package_cost = $package['contents_cost']; 142 // Convert current currency to rial 143 if ( 'IRT' === $this->current_currency ) { 144 $package_cost = $package['contents_cost'] * 10; 145 } elseif ( 'IRHT' === $this->current_currency ) { 146 $package_cost = $package['contents_cost'] * 10000; 147 } 148 149 $shipping_total += ceil( $package_cost * $this->extra_cost_percent / 100 ); 150 $this->extra_cost = intval( $this->extra_cost ); 151 $shipping_total += $this->extra_cost; 152 153 // convert currency to current selected currency 154 if ( 'IRT' === $this->current_currency ) { 155 $shipping_total = ceil( $shipping_total / 10 ); 156 } elseif ( 'IRHT' === $this->current_currency ) { 157 $shipping_total = ceil( $shipping_total / 10000 ); 122 158 } 123 159 -
woocommerce-iran-post-shipping/trunk/includes/IranPostShipping/class-wc-shipping-express.php
r3045170 r3050178 355 355 } 356 356 357 $package_cost = $package['contents_cost']; 357 358 // Convert current currency to rial 358 359 if ( 'IRT' === $this->current_currency ) { … … 362 363 } 363 364 364 $this->free_for_price = isset( $this->free_for_price )? intval( $this->free_for_price ) : '';365 $this->free_for_price = '' !== $this->free_for_price ? intval( $this->free_for_price ) : ''; 365 366 if ( '' === $this->free_for_price || $package_cost < $this->free_for_price ) { 366 367 $rate_price = array(); -
woocommerce-iran-post-shipping/trunk/iran-post-shipping.php
r3049844 r3050178 1 1 <?php 2 2 /** 3 * Plugin Name: Express &Certified Post, Bike Delivery and Iranian Postal Companies for WooCommerce3 * Plugin Name: Express, Certified Post, Bike Delivery and Iranian Postal Companies for WooCommerce 4 4 * Description: Calculates and adds Express & Certified Post shipping methods, Bike Delivery, and other Iranian Postal Companies 5 5 * Plugin URI: https://parsmizban.com/%D9%88%D9%88%DA%A9%D8%A7%D9%85%D8%B1%D8%B3-%D9%BE%D8%B3%D8%AA 6 6 * Author: DediData 7 7 * Author URI: https://dedidata.com 8 * Version: 5.0. 28 * Version: 5.0.3 9 9 * Requires at least: 6.0 10 10 * Tested up to: 6.4 -
woocommerce-iran-post-shipping/trunk/readme.txt
r3049844 r3050178 1 === Express &Certified Post, Bike Delivery and Iranian Postal Companies for WooCommerce ===1 === Express, Certified Post, Bike Delivery and Iranian Postal Companies for WooCommerce === 2 2 Contributors: dedidata, parsmizban, farhad0 3 3 Tags: woocommerce, shipping, order, weight based shipping, woocommerce shipping … … 5 5 Tested up to: 6.4 6 6 Requires PHP: 7.0 7 Stable tag: 5.0. 27 Stable tag: 5.0.3 8 8 License: GPLv3 9 9 License URI: https://www.gnu.org/licenses/gpl-3.0.html
Note: See TracChangeset
for help on using the changeset viewer.