Changeset 3095647
- Timestamp:
- 05/31/2024 12:32:28 PM (22 months ago)
- Location:
- dhlpwc
- Files:
-
- 8 edited
- 1 copied
-
tags/2.1.3 (copied) (copied from dhlpwc/trunk)
-
tags/2.1.3/README.md (modified) (1 diff)
-
tags/2.1.3/dhlpwoocommerce.php (modified) (2 diffs)
-
tags/2.1.3/includes/model/woocommerce/settings/class-dhlpwc-model-woocommerce-settings-shipping-method.php (modified) (3 diffs)
-
tags/2.1.3/readme.txt (modified) (2 diffs)
-
trunk/README.md (modified) (1 diff)
-
trunk/dhlpwoocommerce.php (modified) (2 diffs)
-
trunk/includes/model/woocommerce/settings/class-dhlpwc-model-woocommerce-settings-shipping-method.php (modified) (3 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
dhlpwc/tags/2.1.3/README.md
r3093985 r3095647 1 1 # DHL eCommerce (Benelux) for WooCommerce 2 3 v2.1.3 4 ## Changes 5 - Fixed fallback shipping method not checking on enabled setting 6 - Fixed fallback shipping method not applying conditions 2 7 3 8 v2.1.2 -
dhlpwc/tags/2.1.3/dhlpwoocommerce.php
r3093985 r3095647 5 5 * Description: This is the official DHL eCommerce (Benelux) for WooCommerce plugin. 6 6 * Author: DHL eCommerce 7 * Version: 2.1. 27 * Version: 2.1.3 8 8 * Requires at least: 4.7.16 9 9 * Tested up to: 6.3 … … 52 52 53 53 // Set constants 54 $this->define('DHLPWC_PLUGIN_VERSION', '2.1. 2');54 $this->define('DHLPWC_PLUGIN_VERSION', '2.1.3'); 55 55 $this->define('DHLPWC_PLUGIN_FILE', __FILE__); 56 56 $this->define('DHLPWC_PLUGIN_BASENAME', plugin_basename(__FILE__)); -
dhlpwc/tags/2.1.3/includes/model/woocommerce/settings/class-dhlpwc-model-woocommerce-settings-shipping-method.php
r3093985 r3095647 1091 1091 foreach ($presets as $data) { 1092 1092 $preset = new DHLPWC_Model_Meta_Shipping_Preset($data); 1093 if ($data['frontend_id'] === 'fallback') { 1093 if ($this->get_option('enable_option_' . $preset->setting_id) !== 'yes') { 1094 continue; 1095 } 1096 1097 if ($preset->setting_id === 'fallback') { 1094 1098 $fallbackPreset = $preset; 1095 1099 continue; … … 1125 1129 } 1126 1130 1127 if ($this->get_option('enable_option_' . $preset->setting_id) === 'yes' && $check_allowed_options === true) { 1128 1129 $alternate_text = $this->get_option('alternative_option_text_' . $preset->setting_id); 1130 if (!empty($alternate_text)) { 1131 if (!empty($domain)) { 1132 $title = __($alternate_text, $domain); 1133 } else { 1134 $title = $alternate_text; 1135 } 1131 if ($check_allowed_options !== true) { 1132 continue; 1133 } 1134 1135 $alternate_text = $this->get_option('alternative_option_text_' . $preset->setting_id); 1136 if (!empty($alternate_text)) { 1137 if (!empty($domain)) { 1138 $title = __($alternate_text, $domain); 1136 1139 } else { 1137 $title = __($preset->title, 'dhlpwc');1140 $title = $alternate_text; 1138 1141 } 1139 1140 $cost = $this->calculate_cost($package, $preset->setting_id); 1141 // Apply negative tax if tax assistance is turned on (so WooCommerce can apply tax on it properly) 1142 if ($this->get_option(self::ENABLE_TAX_ASSISTANCE) === 'yes') { 1143 $taxes = WC_Tax::calc_inclusive_tax($cost, WC_Tax::get_shipping_tax_rates()); 1144 foreach($taxes as $tax) { 1145 $cost -= $tax; 1146 } 1142 } else { 1143 $title = __($preset->title, 'dhlpwc'); 1144 } 1145 1146 $cost = $this->calculate_cost($package, $preset->setting_id); 1147 // Apply negative tax if tax assistance is turned on (so WooCommerce can apply tax on it properly) 1148 if ($this->get_option(self::ENABLE_TAX_ASSISTANCE) === 'yes') { 1149 $taxes = WC_Tax::calc_inclusive_tax($cost, WC_Tax::get_shipping_tax_rates()); 1150 foreach($taxes as $tax) { 1151 $cost -= $tax; 1147 1152 } 1148 1149 // Pass sort position meta data if available 1150 $meta_data = array(); 1151 if ($sort_position = $this->get_option('sort_position_' . $preset->setting_id)) { 1152 $meta_data = array('sort_position' => $sort_position); 1153 } 1154 1155 if (!$this->disable_condition($preset->setting_id, $package)) { 1156 $added_rate = true; 1157 $this->add_rate(array( 1158 'id' => 'dhlpwc-' . $preset->frontend_id, 1159 'label' => $title, 1160 'cost' => $cost, 1161 'meta_data' => $meta_data, 1162 )); 1163 } 1164 } 1165 } 1166 1167 if (!$added_rate && $fallbackPreset) { 1153 } 1154 1155 // Pass sort position meta data if available 1168 1156 $meta_data = array(); 1169 1157 if ($sort_position = $this->get_option('sort_position_' . $preset->setting_id)) { … … 1171 1159 } 1172 1160 1173 $this->add_rate(array( 1174 'id' => 'dhlpwc-' . $fallbackPreset->frontend_id, 1175 'label' => __($fallbackPreset->title, 'dhlpwc'), 1176 'cost' => $this->calculate_cost($package, $preset->setting_id), 1177 'meta_data' => $meta_data, 1178 )); 1161 if (!$this->disable_condition($preset->setting_id, $package)) { 1162 $added_rate = true; 1163 $this->add_rate(array( 1164 'id' => 'dhlpwc-' . $preset->frontend_id, 1165 'label' => $title, 1166 'cost' => $cost, 1167 'meta_data' => $meta_data, 1168 )); 1169 } 1170 } 1171 1172 if (!$added_rate && $fallbackPreset !== false) { 1173 $meta_data = array(); 1174 if ($sort_position = $this->get_option('sort_position_' . $fallbackPreset->setting_id)) { 1175 $meta_data = array('sort_position' => $sort_position); 1176 } 1177 1178 if (!$this->disable_condition($fallbackPreset->setting_id, $package)) { 1179 $this->add_rate(array( 1180 'id' => 'dhlpwc-' . $fallbackPreset->frontend_id, 1181 'label' => __($fallbackPreset->title, 'dhlpwc'), 1182 'cost' => $this->calculate_cost($package, $preset->setting_id), 1183 'meta_data' => $meta_data, 1184 )); 1185 } 1179 1186 } 1180 1187 } -
dhlpwc/tags/2.1.3/readme.txt
r3093985 r3095647 5 5 Requires PHP: 5.6 6 6 Tested up to: 6.5.2 7 Stable tag: 2.1. 27 Stable tag: 2.1.3 8 8 WC requires at least: 3.0.0 9 9 WC tested up to: 8.6.1 … … 56 56 57 57 == Changelog == 58 59 = 2.1.3 = 60 - Fixed fallback shipping method not checking on enabled setting 61 - Fixed fallback shipping method not applying conditions 58 62 59 63 = 2.1.2 = -
dhlpwc/trunk/README.md
r3093985 r3095647 1 1 # DHL eCommerce (Benelux) for WooCommerce 2 3 v2.1.3 4 ## Changes 5 - Fixed fallback shipping method not checking on enabled setting 6 - Fixed fallback shipping method not applying conditions 2 7 3 8 v2.1.2 -
dhlpwc/trunk/dhlpwoocommerce.php
r3093985 r3095647 5 5 * Description: This is the official DHL eCommerce (Benelux) for WooCommerce plugin. 6 6 * Author: DHL eCommerce 7 * Version: 2.1. 27 * Version: 2.1.3 8 8 * Requires at least: 4.7.16 9 9 * Tested up to: 6.3 … … 52 52 53 53 // Set constants 54 $this->define('DHLPWC_PLUGIN_VERSION', '2.1. 2');54 $this->define('DHLPWC_PLUGIN_VERSION', '2.1.3'); 55 55 $this->define('DHLPWC_PLUGIN_FILE', __FILE__); 56 56 $this->define('DHLPWC_PLUGIN_BASENAME', plugin_basename(__FILE__)); -
dhlpwc/trunk/includes/model/woocommerce/settings/class-dhlpwc-model-woocommerce-settings-shipping-method.php
r3093985 r3095647 1091 1091 foreach ($presets as $data) { 1092 1092 $preset = new DHLPWC_Model_Meta_Shipping_Preset($data); 1093 if ($data['frontend_id'] === 'fallback') { 1093 if ($this->get_option('enable_option_' . $preset->setting_id) !== 'yes') { 1094 continue; 1095 } 1096 1097 if ($preset->setting_id === 'fallback') { 1094 1098 $fallbackPreset = $preset; 1095 1099 continue; … … 1125 1129 } 1126 1130 1127 if ($this->get_option('enable_option_' . $preset->setting_id) === 'yes' && $check_allowed_options === true) { 1128 1129 $alternate_text = $this->get_option('alternative_option_text_' . $preset->setting_id); 1130 if (!empty($alternate_text)) { 1131 if (!empty($domain)) { 1132 $title = __($alternate_text, $domain); 1133 } else { 1134 $title = $alternate_text; 1135 } 1131 if ($check_allowed_options !== true) { 1132 continue; 1133 } 1134 1135 $alternate_text = $this->get_option('alternative_option_text_' . $preset->setting_id); 1136 if (!empty($alternate_text)) { 1137 if (!empty($domain)) { 1138 $title = __($alternate_text, $domain); 1136 1139 } else { 1137 $title = __($preset->title, 'dhlpwc');1140 $title = $alternate_text; 1138 1141 } 1139 1140 $cost = $this->calculate_cost($package, $preset->setting_id); 1141 // Apply negative tax if tax assistance is turned on (so WooCommerce can apply tax on it properly) 1142 if ($this->get_option(self::ENABLE_TAX_ASSISTANCE) === 'yes') { 1143 $taxes = WC_Tax::calc_inclusive_tax($cost, WC_Tax::get_shipping_tax_rates()); 1144 foreach($taxes as $tax) { 1145 $cost -= $tax; 1146 } 1142 } else { 1143 $title = __($preset->title, 'dhlpwc'); 1144 } 1145 1146 $cost = $this->calculate_cost($package, $preset->setting_id); 1147 // Apply negative tax if tax assistance is turned on (so WooCommerce can apply tax on it properly) 1148 if ($this->get_option(self::ENABLE_TAX_ASSISTANCE) === 'yes') { 1149 $taxes = WC_Tax::calc_inclusive_tax($cost, WC_Tax::get_shipping_tax_rates()); 1150 foreach($taxes as $tax) { 1151 $cost -= $tax; 1147 1152 } 1148 1149 // Pass sort position meta data if available 1150 $meta_data = array(); 1151 if ($sort_position = $this->get_option('sort_position_' . $preset->setting_id)) { 1152 $meta_data = array('sort_position' => $sort_position); 1153 } 1154 1155 if (!$this->disable_condition($preset->setting_id, $package)) { 1156 $added_rate = true; 1157 $this->add_rate(array( 1158 'id' => 'dhlpwc-' . $preset->frontend_id, 1159 'label' => $title, 1160 'cost' => $cost, 1161 'meta_data' => $meta_data, 1162 )); 1163 } 1164 } 1165 } 1166 1167 if (!$added_rate && $fallbackPreset) { 1153 } 1154 1155 // Pass sort position meta data if available 1168 1156 $meta_data = array(); 1169 1157 if ($sort_position = $this->get_option('sort_position_' . $preset->setting_id)) { … … 1171 1159 } 1172 1160 1173 $this->add_rate(array( 1174 'id' => 'dhlpwc-' . $fallbackPreset->frontend_id, 1175 'label' => __($fallbackPreset->title, 'dhlpwc'), 1176 'cost' => $this->calculate_cost($package, $preset->setting_id), 1177 'meta_data' => $meta_data, 1178 )); 1161 if (!$this->disable_condition($preset->setting_id, $package)) { 1162 $added_rate = true; 1163 $this->add_rate(array( 1164 'id' => 'dhlpwc-' . $preset->frontend_id, 1165 'label' => $title, 1166 'cost' => $cost, 1167 'meta_data' => $meta_data, 1168 )); 1169 } 1170 } 1171 1172 if (!$added_rate && $fallbackPreset !== false) { 1173 $meta_data = array(); 1174 if ($sort_position = $this->get_option('sort_position_' . $fallbackPreset->setting_id)) { 1175 $meta_data = array('sort_position' => $sort_position); 1176 } 1177 1178 if (!$this->disable_condition($fallbackPreset->setting_id, $package)) { 1179 $this->add_rate(array( 1180 'id' => 'dhlpwc-' . $fallbackPreset->frontend_id, 1181 'label' => __($fallbackPreset->title, 'dhlpwc'), 1182 'cost' => $this->calculate_cost($package, $preset->setting_id), 1183 'meta_data' => $meta_data, 1184 )); 1185 } 1179 1186 } 1180 1187 } -
dhlpwc/trunk/readme.txt
r3093985 r3095647 5 5 Requires PHP: 5.6 6 6 Tested up to: 6.5.2 7 Stable tag: 2.1. 27 Stable tag: 2.1.3 8 8 WC requires at least: 3.0.0 9 9 WC tested up to: 8.6.1 … … 56 56 57 57 == Changelog == 58 59 = 2.1.3 = 60 - Fixed fallback shipping method not checking on enabled setting 61 - Fixed fallback shipping method not applying conditions 58 62 59 63 = 2.1.2 =
Note: See TracChangeset
for help on using the changeset viewer.