Changeset 3095681
- Timestamp:
- 05/31/2024 01:25:38 PM (22 months ago)
- Location:
- dhlpwc
- Files:
-
- 8 edited
- 1 copied
-
tags/2.1.4 (copied) (copied from dhlpwc/trunk)
-
tags/2.1.4/README.md (modified) (1 diff)
-
tags/2.1.4/dhlpwoocommerce.php (modified) (2 diffs)
-
tags/2.1.4/includes/model/woocommerce/settings/class-dhlpwc-model-woocommerce-settings-shipping-method.php (modified) (4 diffs)
-
tags/2.1.4/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) (4 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
dhlpwc/tags/2.1.4/README.md
r3095647 r3095681 1 1 # DHL eCommerce (Benelux) for WooCommerce 2 3 v2.1.4 4 ## Changes 5 - Fixed fallback shipping method not using alternative text 6 - Fixed fallback shipping method not applying the correct cost 7 - Fixed fallback shipping method not using tax included input cost calculation 2 8 3 9 v2.1.3 -
dhlpwc/tags/2.1.4/dhlpwoocommerce.php
r3095647 r3095681 5 5 * Description: This is the official DHL eCommerce (Benelux) for WooCommerce plugin. 6 6 * Author: DHL eCommerce 7 * Version: 2.1. 37 * Version: 2.1.4 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. 3');54 $this->define('DHLPWC_PLUGIN_VERSION', '2.1.4'); 55 55 $this->define('DHLPWC_PLUGIN_FILE', __FILE__); 56 56 $this->define('DHLPWC_PLUGIN_BASENAME', plugin_basename(__FILE__)); -
dhlpwc/tags/2.1.4/includes/model/woocommerce/settings/class-dhlpwc-model-woocommerce-settings-shipping-method.php
r3095647 r3095681 1034 1034 } 1035 1035 1036 $domain = $this->get_option(self::PRESET_TRANSLATION_DOMAIN);1037 1038 1036 $service = DHLPWC_Model_Service_Shipping_Preset::instance(); 1039 1037 $presets = $service->get_presets(); … … 1133 1131 } 1134 1132 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); 1139 } else { 1140 $title = $alternate_text; 1141 } 1142 } else { 1143 $title = __($preset->title, 'dhlpwc'); 1144 } 1145 1133 $title = $this->get_preset_title($preset); 1146 1134 $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; 1152 } 1153 } 1135 $cost = $this->get_tax_adjusted_cost($cost); 1154 1136 1155 1137 // Pass sort position meta data if available … … 1171 1153 1172 1154 if (!$added_rate && $fallbackPreset !== false) { 1155 $title = $this->get_preset_title($fallbackPreset); 1156 $cost = $this->calculate_cost($package, $fallbackPreset->setting_id); 1157 $cost = $this->get_tax_adjusted_cost($cost); 1158 1173 1159 $meta_data = array(); 1174 1160 if ($sort_position = $this->get_option('sort_position_' . $fallbackPreset->setting_id)) { … … 1179 1165 $this->add_rate(array( 1180 1166 'id' => 'dhlpwc-' . $fallbackPreset->frontend_id, 1181 'label' => __($fallbackPreset->title, 'dhlpwc'),1182 'cost' => $ this->calculate_cost($package, $preset->setting_id),1167 'label' => $title, 1168 'cost' => $cost, 1183 1169 'meta_data' => $meta_data, 1184 1170 )); 1185 1171 } 1186 1172 } 1173 } 1174 1175 protected function get_preset_title($preset) 1176 { 1177 $alternate_text = $this->get_option('alternative_option_text_' . $preset->setting_id); 1178 $domain = $this->get_option(self::PRESET_TRANSLATION_DOMAIN); 1179 1180 if (!empty($alternate_text)) { 1181 if (!empty($domain)) { 1182 return __($alternate_text, $domain); 1183 } else { 1184 return $alternate_text; 1185 } 1186 } 1187 return __($preset->title, 'dhlpwc'); 1188 } 1189 1190 protected function get_tax_adjusted_cost($cost) 1191 { 1192 // Apply negative tax if tax assistance is turned on (so WooCommerce can apply tax on it properly) 1193 if ($this->get_option(self::ENABLE_TAX_ASSISTANCE) !== 'yes') { 1194 return $cost; 1195 } 1196 1197 $taxes = WC_Tax::calc_inclusive_tax($cost, WC_Tax::get_shipping_tax_rates()); 1198 foreach($taxes as $tax) { 1199 $cost -= $tax; 1200 } 1201 1202 return $cost; 1187 1203 } 1188 1204 -
dhlpwc/tags/2.1.4/readme.txt
r3095647 r3095681 5 5 Requires PHP: 5.6 6 6 Tested up to: 6.5.2 7 Stable tag: 2.1. 37 Stable tag: 2.1.4 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.4 = 60 - Fixed fallback shipping method not using alternative text 61 - Fixed fallback shipping method not applying the correct cost 62 - Fixed fallback shipping method not using tax included input cost calculation 58 63 59 64 = 2.1.3 = -
dhlpwc/trunk/README.md
r3095647 r3095681 1 1 # DHL eCommerce (Benelux) for WooCommerce 2 3 v2.1.4 4 ## Changes 5 - Fixed fallback shipping method not using alternative text 6 - Fixed fallback shipping method not applying the correct cost 7 - Fixed fallback shipping method not using tax included input cost calculation 2 8 3 9 v2.1.3 -
dhlpwc/trunk/dhlpwoocommerce.php
r3095647 r3095681 5 5 * Description: This is the official DHL eCommerce (Benelux) for WooCommerce plugin. 6 6 * Author: DHL eCommerce 7 * Version: 2.1. 37 * Version: 2.1.4 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. 3');54 $this->define('DHLPWC_PLUGIN_VERSION', '2.1.4'); 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
r3095647 r3095681 1034 1034 } 1035 1035 1036 $domain = $this->get_option(self::PRESET_TRANSLATION_DOMAIN);1037 1038 1036 $service = DHLPWC_Model_Service_Shipping_Preset::instance(); 1039 1037 $presets = $service->get_presets(); … … 1133 1131 } 1134 1132 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); 1139 } else { 1140 $title = $alternate_text; 1141 } 1142 } else { 1143 $title = __($preset->title, 'dhlpwc'); 1144 } 1145 1133 $title = $this->get_preset_title($preset); 1146 1134 $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; 1152 } 1153 } 1135 $cost = $this->get_tax_adjusted_cost($cost); 1154 1136 1155 1137 // Pass sort position meta data if available … … 1171 1153 1172 1154 if (!$added_rate && $fallbackPreset !== false) { 1155 $title = $this->get_preset_title($fallbackPreset); 1156 $cost = $this->calculate_cost($package, $fallbackPreset->setting_id); 1157 $cost = $this->get_tax_adjusted_cost($cost); 1158 1173 1159 $meta_data = array(); 1174 1160 if ($sort_position = $this->get_option('sort_position_' . $fallbackPreset->setting_id)) { … … 1179 1165 $this->add_rate(array( 1180 1166 'id' => 'dhlpwc-' . $fallbackPreset->frontend_id, 1181 'label' => __($fallbackPreset->title, 'dhlpwc'),1182 'cost' => $ this->calculate_cost($package, $preset->setting_id),1167 'label' => $title, 1168 'cost' => $cost, 1183 1169 'meta_data' => $meta_data, 1184 1170 )); 1185 1171 } 1186 1172 } 1173 } 1174 1175 protected function get_preset_title($preset) 1176 { 1177 $alternate_text = $this->get_option('alternative_option_text_' . $preset->setting_id); 1178 $domain = $this->get_option(self::PRESET_TRANSLATION_DOMAIN); 1179 1180 if (!empty($alternate_text)) { 1181 if (!empty($domain)) { 1182 return __($alternate_text, $domain); 1183 } else { 1184 return $alternate_text; 1185 } 1186 } 1187 return __($preset->title, 'dhlpwc'); 1188 } 1189 1190 protected function get_tax_adjusted_cost($cost) 1191 { 1192 // Apply negative tax if tax assistance is turned on (so WooCommerce can apply tax on it properly) 1193 if ($this->get_option(self::ENABLE_TAX_ASSISTANCE) !== 'yes') { 1194 return $cost; 1195 } 1196 1197 $taxes = WC_Tax::calc_inclusive_tax($cost, WC_Tax::get_shipping_tax_rates()); 1198 foreach($taxes as $tax) { 1199 $cost -= $tax; 1200 } 1201 1202 return $cost; 1187 1203 } 1188 1204 -
dhlpwc/trunk/readme.txt
r3095647 r3095681 5 5 Requires PHP: 5.6 6 6 Tested up to: 6.5.2 7 Stable tag: 2.1. 37 Stable tag: 2.1.4 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.4 = 60 - Fixed fallback shipping method not using alternative text 61 - Fixed fallback shipping method not applying the correct cost 62 - Fixed fallback shipping method not using tax included input cost calculation 58 63 59 64 = 2.1.3 =
Note: See TracChangeset
for help on using the changeset viewer.