Version Description
- 2022-08-02 =
- Added extended data (matched items) in debug mode
Download this release
Release Info
Developer | octolize |
Plugin | Flexible Shipping for WooCommerce |
Version | 4.13.3 |
Comparing to | |
See all releases |
Code changes from version 4.13.2 to 4.13.3
- flexible-shipping.php +3 -3
- lang/flexible-shipping.pot +74 -25
- readme.txt +30 -18
- src/WPDesk/FS/TableRate/Rule/Condition/ConditionsFactory.php +9 -0
- src/WPDesk/FS/TableRate/Rule/Condition/Price.php +2 -5
- src/WPDesk/FS/TableRate/Rule/Condition/Pro/MaxDimension.php +1 -0
- src/WPDesk/FS/TableRate/Rule/Condition/Pro/ProductDimensionHeight.php +29 -0
- src/WPDesk/FS/TableRate/Rule/Condition/Pro/ProductDimensionLength.php +29 -0
- src/WPDesk/FS/TableRate/Rule/Condition/Pro/ProductDimensionWidth.php +29 -0
- src/WPDesk/FS/TableRate/Rule/Condition/Weight.php +2 -5
- src/WPDesk/FS/TableRate/Rule/Rule.php +21 -1
- src/WPDesk/FS/TableRate/Rule/Settings/SettingsProcessor.php +11 -12
- src/WPDesk/FS/TableRate/ShippingMethod/RateCalculator.php +2 -2
- vendor/composer/autoload_classmap.php +3 -0
- vendor/composer/autoload_static.php +3 -0
flexible-shipping.php
CHANGED
@@ -3,12 +3,12 @@
|
|
3 |
* Plugin Name: Flexible Shipping
|
4 |
* Plugin URI: https://wordpress.org/plugins/flexible-shipping/
|
5 |
* Description: Create additional shipment methods in WooCommerce and enable pricing based on cart weight or total.
|
6 |
-
* Version: 4.13.
|
7 |
* Author: Octolize
|
8 |
* Author URI: https://octol.io/fs-author
|
9 |
* Text Domain: flexible-shipping
|
10 |
* Domain Path: /lang/
|
11 |
-
* Requires at least: 5.
|
12 |
* Tested up to: 6.0
|
13 |
* WC requires at least: 6.4
|
14 |
* WC tested up to: 6.8
|
@@ -38,7 +38,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
38 |
} // Exit if accessed directly
|
39 |
|
40 |
/* THIS VARIABLE CAN BE CHANGED AUTOMATICALLY */
|
41 |
-
$plugin_version = '4.13.
|
42 |
|
43 |
$plugin_name = 'Flexible Shipping';
|
44 |
$product_id = 'Flexible Shipping';
|
3 |
* Plugin Name: Flexible Shipping
|
4 |
* Plugin URI: https://wordpress.org/plugins/flexible-shipping/
|
5 |
* Description: Create additional shipment methods in WooCommerce and enable pricing based on cart weight or total.
|
6 |
+
* Version: 4.13.3
|
7 |
* Author: Octolize
|
8 |
* Author URI: https://octol.io/fs-author
|
9 |
* Text Domain: flexible-shipping
|
10 |
* Domain Path: /lang/
|
11 |
+
* Requires at least: 5.7
|
12 |
* Tested up to: 6.0
|
13 |
* WC requires at least: 6.4
|
14 |
* WC tested up to: 6.8
|
38 |
} // Exit if accessed directly
|
39 |
|
40 |
/* THIS VARIABLE CAN BE CHANGED AUTOMATICALLY */
|
41 |
+
$plugin_version = '4.13.3';
|
42 |
|
43 |
$plugin_name = 'Flexible Shipping';
|
44 |
$product_id = 'Flexible Shipping';
|
lang/flexible-shipping.pot
CHANGED
@@ -2,14 +2,14 @@
|
|
2 |
# This file is distributed under the same license as the Flexible Shipping plugin.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
-
"Project-Id-Version: Flexible Shipping 4.13.
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/flexible-shipping\n"
|
7 |
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
8 |
"Language-Team: LANGUAGE <LL@li.org>\n"
|
9 |
"MIME-Version: 1.0\n"
|
10 |
"Content-Type: text/plain; charset=UTF-8\n"
|
11 |
"Content-Transfer-Encoding: 8bit\n"
|
12 |
-
"POT-Creation-Date: 2022-
|
13 |
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
14 |
"X-Generator: WP-CLI 2.4.0\n"
|
15 |
"X-Domain: flexible-shipping\n"
|
@@ -1064,46 +1064,46 @@ msgstr ""
|
|
1064 |
msgid "Fixed shipping cost"
|
1065 |
msgstr ""
|
1066 |
|
1067 |
-
#: src/WPDesk/FS/TableRate/Rule/Condition/Price.php:
|
1068 |
#: src/WPDesk/FS/TableRate/Rule/PreconfiguredScenarios/PreconfiguredScenariosFactory.php:55
|
1069 |
msgid "Price"
|
1070 |
msgstr ""
|
1071 |
|
1072 |
-
#: src/WPDesk/FS/TableRate/Rule/Condition/Price.php:
|
1073 |
msgid "Shipping cost based on the cart total or package value"
|
1074 |
msgstr ""
|
1075 |
|
1076 |
-
#: src/WPDesk/FS/TableRate/Rule/Condition/Price.php:
|
1077 |
#: src/WPDesk/FS/TableRate/Rule/Condition/Pro/CartLineItem.php:27
|
1078 |
#: src/WPDesk/FS/TableRate/Rule/Condition/Pro/Item.php:25
|
1079 |
msgid "Cart"
|
1080 |
msgstr ""
|
1081 |
|
1082 |
-
#: src/WPDesk/FS/TableRate/Rule/Condition/Price.php:
|
1083 |
msgid "price is from"
|
1084 |
msgstr ""
|
1085 |
|
1086 |
-
#: src/WPDesk/FS/TableRate/Rule/Condition/Price.php:
|
1087 |
msgid "min"
|
1088 |
msgstr ""
|
1089 |
|
1090 |
-
#: src/WPDesk/FS/TableRate/Rule/Condition/Price.php:
|
1091 |
-
#: src/WPDesk/FS/TableRate/Rule/Condition/Weight.php:
|
1092 |
-
#: src/WPDesk/FS/TableRate/Rule/Condition/Weight.php:
|
1093 |
msgid "is from"
|
1094 |
msgstr ""
|
1095 |
|
1096 |
-
#: src/WPDesk/FS/TableRate/Rule/Condition/Price.php:
|
1097 |
msgid "price to"
|
1098 |
msgstr ""
|
1099 |
|
1100 |
-
#: src/WPDesk/FS/TableRate/Rule/Condition/Price.php:
|
1101 |
msgid "max"
|
1102 |
msgstr ""
|
1103 |
|
1104 |
-
#: src/WPDesk/FS/TableRate/Rule/Condition/Price.php:
|
1105 |
-
#: src/WPDesk/FS/TableRate/Rule/Condition/Weight.php:
|
1106 |
-
#: src/WPDesk/FS/TableRate/Rule/Condition/Weight.php:
|
1107 |
msgid "to"
|
1108 |
msgstr ""
|
1109 |
|
@@ -1115,9 +1115,12 @@ msgstr ""
|
|
1115 |
#: src/WPDesk/FS/TableRate/Rule/Condition/Pro/DayOfTheWeek.php:29
|
1116 |
#: src/WPDesk/FS/TableRate/Rule/Condition/Pro/DimensionalWeight.php:29
|
1117 |
#: src/WPDesk/FS/TableRate/Rule/Condition/Pro/Item.php:29
|
1118 |
-
#: src/WPDesk/FS/TableRate/Rule/Condition/Pro/MaxDimension.php:
|
1119 |
#: src/WPDesk/FS/TableRate/Rule/Condition/Pro/Product.php:31
|
1120 |
#: src/WPDesk/FS/TableRate/Rule/Condition/Pro/ProductCategory.php:31
|
|
|
|
|
|
|
1121 |
#: src/WPDesk/FS/TableRate/Rule/Condition/Pro/ProductTag.php:31
|
1122 |
#: src/WPDesk/FS/TableRate/Rule/Condition/Pro/ShippingClass.php:29
|
1123 |
#: src/WPDesk/FS/TableRate/Rule/Condition/Pro/TimeOfTheDay.php:29
|
@@ -1141,10 +1144,13 @@ msgid "Dimensional weight"
|
|
1141 |
msgstr ""
|
1142 |
|
1143 |
#: src/WPDesk/FS/TableRate/Rule/Condition/Pro/DimensionalWeight.php:25
|
1144 |
-
#: src/WPDesk/FS/TableRate/Rule/Condition/Pro/MaxDimension.php:
|
|
|
|
|
|
|
1145 |
#: src/WPDesk/FS/TableRate/Rule/Condition/Pro/TotalOverallDimensions.php:27
|
1146 |
#: src/WPDesk/FS/TableRate/Rule/Condition/Pro/Volume.php:25
|
1147 |
-
#: src/WPDesk/FS/TableRate/Rule/Condition/Weight.php:
|
1148 |
msgid "Weight & Dimensions"
|
1149 |
msgstr ""
|
1150 |
|
@@ -1156,6 +1162,10 @@ msgstr ""
|
|
1156 |
msgid "Max dimension"
|
1157 |
msgstr ""
|
1158 |
|
|
|
|
|
|
|
|
|
1159 |
#: src/WPDesk/FS/TableRate/Rule/Condition/Pro/Product.php:26
|
1160 |
#: src/WPDesk/FS/TableRate/Rule/Condition/Pro/Product.php:27
|
1161 |
#: src/WPDesk/FS/TableRate/Rule/Condition/Pro/ProductCategory.php:27
|
@@ -1168,6 +1178,30 @@ msgstr ""
|
|
1168 |
msgid "Product category"
|
1169 |
msgstr ""
|
1170 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1171 |
#: src/WPDesk/FS/TableRate/Rule/Condition/Pro/ProductTag.php:26
|
1172 |
msgid "Product tag"
|
1173 |
msgstr ""
|
@@ -1196,20 +1230,20 @@ msgstr ""
|
|
1196 |
msgid "Volume"
|
1197 |
msgstr ""
|
1198 |
|
1199 |
-
#: src/WPDesk/FS/TableRate/Rule/Condition/Weight.php:
|
1200 |
#: src/WPDesk/FS/TableRate/Rule/PreconfiguredScenarios/PreconfiguredScenariosFactory.php:36
|
1201 |
msgid "Weight"
|
1202 |
msgstr ""
|
1203 |
|
1204 |
-
#: src/WPDesk/FS/TableRate/Rule/Condition/Weight.php:
|
1205 |
msgid "Shipping cost based on the weight of the cart or package"
|
1206 |
msgstr ""
|
1207 |
|
1208 |
-
#: src/WPDesk/FS/TableRate/Rule/Condition/Weight.php:
|
1209 |
msgid "weight is from"
|
1210 |
msgstr ""
|
1211 |
|
1212 |
-
#: src/WPDesk/FS/TableRate/Rule/Condition/Weight.php:
|
1213 |
msgid "weight to"
|
1214 |
msgstr ""
|
1215 |
|
@@ -1289,12 +1323,27 @@ msgstr ""
|
|
1289 |
msgid "Shipping cost decreases in line with the cart total. Free shipping once $300 threshold is reached."
|
1290 |
msgstr ""
|
1291 |
|
1292 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1293 |
msgid "Rule costs:"
|
1294 |
msgstr ""
|
1295 |
|
1296 |
#. Translators: rule number.
|
1297 |
-
#: src/WPDesk/FS/TableRate/Rule/Rule.php:
|
1298 |
msgid "Rule %1$s:"
|
1299 |
msgstr ""
|
1300 |
|
@@ -1460,7 +1509,7 @@ msgstr ""
|
|
1460 |
|
1461 |
#. Translators: contents value.
|
1462 |
#: src/WPDesk/FS/TableRate/ShippingMethod/RateCalculator.php:215
|
1463 |
-
msgid "Contents value: %1$s"
|
1464 |
msgstr ""
|
1465 |
|
1466 |
#. Translators: contents weight.
|
2 |
# This file is distributed under the same license as the Flexible Shipping plugin.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
+
"Project-Id-Version: Flexible Shipping 4.13.3\n"
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/flexible-shipping\n"
|
7 |
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
8 |
"Language-Team: LANGUAGE <LL@li.org>\n"
|
9 |
"MIME-Version: 1.0\n"
|
10 |
"Content-Type: text/plain; charset=UTF-8\n"
|
11 |
"Content-Transfer-Encoding: 8bit\n"
|
12 |
+
"POT-Creation-Date: 2022-08-16T13:47:06+00:00\n"
|
13 |
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
14 |
"X-Generator: WP-CLI 2.4.0\n"
|
15 |
"X-Domain: flexible-shipping\n"
|
1064 |
msgid "Fixed shipping cost"
|
1065 |
msgstr ""
|
1066 |
|
1067 |
+
#: src/WPDesk/FS/TableRate/Rule/Condition/Price.php:31
|
1068 |
#: src/WPDesk/FS/TableRate/Rule/PreconfiguredScenarios/PreconfiguredScenariosFactory.php:55
|
1069 |
msgid "Price"
|
1070 |
msgstr ""
|
1071 |
|
1072 |
+
#: src/WPDesk/FS/TableRate/Rule/Condition/Price.php:32
|
1073 |
msgid "Shipping cost based on the cart total or package value"
|
1074 |
msgstr ""
|
1075 |
|
1076 |
+
#: src/WPDesk/FS/TableRate/Rule/Condition/Price.php:33
|
1077 |
#: src/WPDesk/FS/TableRate/Rule/Condition/Pro/CartLineItem.php:27
|
1078 |
#: src/WPDesk/FS/TableRate/Rule/Condition/Pro/Item.php:25
|
1079 |
msgid "Cart"
|
1080 |
msgstr ""
|
1081 |
|
1082 |
+
#: src/WPDesk/FS/TableRate/Rule/Condition/Price.php:88
|
1083 |
msgid "price is from"
|
1084 |
msgstr ""
|
1085 |
|
1086 |
+
#: src/WPDesk/FS/TableRate/Rule/Condition/Price.php:89
|
1087 |
msgid "min"
|
1088 |
msgstr ""
|
1089 |
|
1090 |
+
#: src/WPDesk/FS/TableRate/Rule/Condition/Price.php:90
|
1091 |
+
#: src/WPDesk/FS/TableRate/Rule/Condition/Weight.php:78
|
1092 |
+
#: src/WPDesk/FS/TableRate/Rule/Condition/Weight.php:79
|
1093 |
msgid "is from"
|
1094 |
msgstr ""
|
1095 |
|
1096 |
+
#: src/WPDesk/FS/TableRate/Rule/Condition/Price.php:96
|
1097 |
msgid "price to"
|
1098 |
msgstr ""
|
1099 |
|
1100 |
+
#: src/WPDesk/FS/TableRate/Rule/Condition/Price.php:97
|
1101 |
msgid "max"
|
1102 |
msgstr ""
|
1103 |
|
1104 |
+
#: src/WPDesk/FS/TableRate/Rule/Condition/Price.php:98
|
1105 |
+
#: src/WPDesk/FS/TableRate/Rule/Condition/Weight.php:86
|
1106 |
+
#: src/WPDesk/FS/TableRate/Rule/Condition/Weight.php:87
|
1107 |
msgid "to"
|
1108 |
msgstr ""
|
1109 |
|
1115 |
#: src/WPDesk/FS/TableRate/Rule/Condition/Pro/DayOfTheWeek.php:29
|
1116 |
#: src/WPDesk/FS/TableRate/Rule/Condition/Pro/DimensionalWeight.php:29
|
1117 |
#: src/WPDesk/FS/TableRate/Rule/Condition/Pro/Item.php:29
|
1118 |
+
#: src/WPDesk/FS/TableRate/Rule/Condition/Pro/MaxDimension.php:30
|
1119 |
#: src/WPDesk/FS/TableRate/Rule/Condition/Pro/Product.php:31
|
1120 |
#: src/WPDesk/FS/TableRate/Rule/Condition/Pro/ProductCategory.php:31
|
1121 |
+
#: src/WPDesk/FS/TableRate/Rule/Condition/Pro/ProductDimensionHeight.php:27
|
1122 |
+
#: src/WPDesk/FS/TableRate/Rule/Condition/Pro/ProductDimensionLength.php:27
|
1123 |
+
#: src/WPDesk/FS/TableRate/Rule/Condition/Pro/ProductDimensionWidth.php:27
|
1124 |
#: src/WPDesk/FS/TableRate/Rule/Condition/Pro/ProductTag.php:31
|
1125 |
#: src/WPDesk/FS/TableRate/Rule/Condition/Pro/ShippingClass.php:29
|
1126 |
#: src/WPDesk/FS/TableRate/Rule/Condition/Pro/TimeOfTheDay.php:29
|
1144 |
msgstr ""
|
1145 |
|
1146 |
#: src/WPDesk/FS/TableRate/Rule/Condition/Pro/DimensionalWeight.php:25
|
1147 |
+
#: src/WPDesk/FS/TableRate/Rule/Condition/Pro/MaxDimension.php:26
|
1148 |
+
#: src/WPDesk/FS/TableRate/Rule/Condition/Pro/ProductDimensionHeight.php:23
|
1149 |
+
#: src/WPDesk/FS/TableRate/Rule/Condition/Pro/ProductDimensionLength.php:23
|
1150 |
+
#: src/WPDesk/FS/TableRate/Rule/Condition/Pro/ProductDimensionWidth.php:23
|
1151 |
#: src/WPDesk/FS/TableRate/Rule/Condition/Pro/TotalOverallDimensions.php:27
|
1152 |
#: src/WPDesk/FS/TableRate/Rule/Condition/Pro/Volume.php:25
|
1153 |
+
#: src/WPDesk/FS/TableRate/Rule/Condition/Weight.php:33
|
1154 |
msgid "Weight & Dimensions"
|
1155 |
msgstr ""
|
1156 |
|
1162 |
msgid "Max dimension"
|
1163 |
msgstr ""
|
1164 |
|
1165 |
+
#: src/WPDesk/FS/TableRate/Rule/Condition/Pro/MaxDimension.php:25
|
1166 |
+
msgid "Shipping cost based on the product's maximum dimension"
|
1167 |
+
msgstr ""
|
1168 |
+
|
1169 |
#: src/WPDesk/FS/TableRate/Rule/Condition/Pro/Product.php:26
|
1170 |
#: src/WPDesk/FS/TableRate/Rule/Condition/Pro/Product.php:27
|
1171 |
#: src/WPDesk/FS/TableRate/Rule/Condition/Pro/ProductCategory.php:27
|
1178 |
msgid "Product category"
|
1179 |
msgstr ""
|
1180 |
|
1181 |
+
#: src/WPDesk/FS/TableRate/Rule/Condition/Pro/ProductDimensionHeight.php:21
|
1182 |
+
msgid "Height"
|
1183 |
+
msgstr ""
|
1184 |
+
|
1185 |
+
#: src/WPDesk/FS/TableRate/Rule/Condition/Pro/ProductDimensionHeight.php:22
|
1186 |
+
msgid "Shipping cost based on the product's height"
|
1187 |
+
msgstr ""
|
1188 |
+
|
1189 |
+
#: src/WPDesk/FS/TableRate/Rule/Condition/Pro/ProductDimensionLength.php:21
|
1190 |
+
msgid "Length"
|
1191 |
+
msgstr ""
|
1192 |
+
|
1193 |
+
#: src/WPDesk/FS/TableRate/Rule/Condition/Pro/ProductDimensionLength.php:22
|
1194 |
+
msgid "Shipping cost based on the product's length"
|
1195 |
+
msgstr ""
|
1196 |
+
|
1197 |
+
#: src/WPDesk/FS/TableRate/Rule/Condition/Pro/ProductDimensionWidth.php:21
|
1198 |
+
msgid "Width"
|
1199 |
+
msgstr ""
|
1200 |
+
|
1201 |
+
#: src/WPDesk/FS/TableRate/Rule/Condition/Pro/ProductDimensionWidth.php:22
|
1202 |
+
msgid "Shipping cost based on the product's width"
|
1203 |
+
msgstr ""
|
1204 |
+
|
1205 |
#: src/WPDesk/FS/TableRate/Rule/Condition/Pro/ProductTag.php:26
|
1206 |
msgid "Product tag"
|
1207 |
msgstr ""
|
1230 |
msgid "Volume"
|
1231 |
msgstr ""
|
1232 |
|
1233 |
+
#: src/WPDesk/FS/TableRate/Rule/Condition/Weight.php:31
|
1234 |
#: src/WPDesk/FS/TableRate/Rule/PreconfiguredScenarios/PreconfiguredScenariosFactory.php:36
|
1235 |
msgid "Weight"
|
1236 |
msgstr ""
|
1237 |
|
1238 |
+
#: src/WPDesk/FS/TableRate/Rule/Condition/Weight.php:32
|
1239 |
msgid "Shipping cost based on the weight of the cart or package"
|
1240 |
msgstr ""
|
1241 |
|
1242 |
+
#: src/WPDesk/FS/TableRate/Rule/Condition/Weight.php:77
|
1243 |
msgid "weight is from"
|
1244 |
msgstr ""
|
1245 |
|
1246 |
+
#: src/WPDesk/FS/TableRate/Rule/Condition/Weight.php:85
|
1247 |
msgid "weight to"
|
1248 |
msgstr ""
|
1249 |
|
1323 |
msgid "Shipping cost decreases in line with the cart total. Free shipping once $300 threshold is reached."
|
1324 |
msgstr ""
|
1325 |
|
1326 |
+
#. Translators: items.
|
1327 |
+
#: src/WPDesk/FS/TableRate/Rule/Rule.php:154
|
1328 |
+
msgid " Matched items: %1$s"
|
1329 |
+
msgstr ""
|
1330 |
+
|
1331 |
+
#. Translators: items costs.
|
1332 |
+
#: src/WPDesk/FS/TableRate/Rule/Rule.php:156
|
1333 |
+
msgid " Matched items cost: %1$d %2$s"
|
1334 |
+
msgstr ""
|
1335 |
+
|
1336 |
+
#. Translators: items weight.
|
1337 |
+
#: src/WPDesk/FS/TableRate/Rule/Rule.php:158
|
1338 |
+
msgid " Matched items weight: %1$s"
|
1339 |
+
msgstr ""
|
1340 |
+
|
1341 |
+
#: src/WPDesk/FS/TableRate/Rule/Rule.php:159
|
1342 |
msgid "Rule costs:"
|
1343 |
msgstr ""
|
1344 |
|
1345 |
#. Translators: rule number.
|
1346 |
+
#: src/WPDesk/FS/TableRate/Rule/Rule.php:230
|
1347 |
msgid "Rule %1$s:"
|
1348 |
msgstr ""
|
1349 |
|
1509 |
|
1510 |
#. Translators: contents value.
|
1511 |
#: src/WPDesk/FS/TableRate/ShippingMethod/RateCalculator.php:215
|
1512 |
+
msgid "Contents value: %1$s %2$s"
|
1513 |
msgstr ""
|
1514 |
|
1515 |
#. Translators: contents weight.
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: https://octol.io/fs-repo-up
|
|
4 |
Tags: table rate, table rate shipping, conditional shipping, free shipping, woocommerce shipping, woocommerce table rate shipping, cart based shipping, weight based shipping, totals based shipping, order based shipping, advanced shipping
|
5 |
Requires at least: 5.7
|
6 |
Tested up to: 6.0
|
7 |
-
Stable tag: 4.13.
|
8 |
Requires PHP: 7.0
|
9 |
License: GPLv3 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
@@ -29,12 +29,12 @@ Flexible Shipping is the most advanced shipping plugin for WooCommerce stores, a
|
|
29 |
* Adding handling fee or an insurance cost after reaching a certain order value
|
30 |
* Creating COD (Cash On Delivery) shipping method with additional costs
|
31 |
* Different shipping costs for different shipping classes, products or product categories (PRO)
|
32 |
-
*
|
33 |
-
*
|
34 |
-
*
|
35 |
-
*
|
36 |
|
37 |
-
These are only a few examples of the Flexible Shipping usage
|
38 |
|
39 |
= Features =
|
40 |
|
@@ -43,9 +43,9 @@ These are only a few examples of the Flexible Shipping usage; however, its possi
|
|
43 |
* Shipping cost based on cart total and/or weight
|
44 |
* Minimum and maximum values for cart total and/or weight
|
45 |
* Summing up the costs of e.g. two different rules at the same time e.g. one based on cart total and the second based on weight
|
46 |
-
* Free shipping over amount
|
47 |
* Option to display the selected shipping methods only for logged-in users
|
48 |
-
* Further shipping companies integrations (see the info below for details)
|
49 |
* WPML and Polylang compatibility
|
50 |
* Built-in ready to use scenarios
|
51 |
* Automatic notification about shipping zone configuration conflict
|
@@ -57,22 +57,21 @@ These are only a few examples of the Flexible Shipping usage; however, its possi
|
|
57 |
* All free features
|
58 |
* **Shipping classes support**
|
59 |
* Shipping costs based on products' quantity and/or cart line item count
|
60 |
-
* Shipping cost based on the product
|
61 |
* Shipping cost based on the volume of the products in the cart
|
62 |
* Shipping cost based on dimensional weight (with custom DIM Factor)
|
63 |
* Shipping cost based on products (products, product categories, product tags)
|
64 |
* Shipping cost based on user role
|
65 |
-
*
|
66 |
-
* Additional costs
|
67 |
* Stopping a rule (if the rule is matched the following rules will not be calculated)
|
68 |
-
*
|
69 |
* Conditional logic for conditions with selection (e.g. shipping class) - matches any/all/none
|
70 |
* Conditional logic for conditions with ranges (e.g. weight) - is/is not
|
71 |
* Additional calculation methods (sum, lowest cost, highest cost)
|
72 |
* Maximum shipping cost per shipping method
|
73 |
* Free shipping coupons support
|
74 |
|
75 |
-
|
76 |
[Upgrade to PRO Now →](https://octol.io/fs-repo-up)
|
77 |
|
78 |
= Flexible Shipping Locations Add-On =
|
@@ -104,7 +103,8 @@ You might also be interested in other...
|
|
104 |
* [Shipping Live Rates for Australia Post for WooCommerce](https://octol.io/ap-repo) – Australia Post WooCommerce shipping methods with real-time calculated shipping rates
|
105 |
* [Shipping Live Rates for Canada Post for WooCommerce](https://octol.io/cp-repo) - Canada Post WooCommerce shipping methods with real-time calculated shipping rates
|
106 |
* [Shipping Live Rates for Royal Mail for WooCommerce](https://octol.io/rm-repo) - Royal Mail WooCommerce shipping methods with real-time calculated shipping rates
|
107 |
-
* [Shipping Notices](https://octol.io/notices-repo) -
|
|
|
108 |
|
109 |
= Docs =
|
110 |
|
@@ -154,13 +154,22 @@ We have verified and tested the Flexible Shipping compatibility with the followi
|
|
154 |
* Spanish by [Jose Luis](https://profiles.wordpress.org/jose64/), [Javier Esteban](https://profiles.wordpress.org/nobnob/), [lacasitadecadera](https://profiles.wordpress.org/lacasitadecera/)
|
155 |
* Dutch by [Vernum](https://profiles.wordpress.org/vernum/), [Peter Smits](https://profiles.wordpress.org/psmits1567/), [Pjeterjan Deneys](https://profiles.wordpress.org/nekojonez/)
|
156 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
157 |
= Flexible Shipping in a nutshell =
|
158 |
|
159 |
Key features:
|
160 |
|
161 |
-
*
|
162 |
-
*
|
163 |
-
*
|
164 |
* cost based shipping cost
|
165 |
* weight based shipping cost
|
166 |
* total order based shipping cost,
|
@@ -170,7 +179,7 @@ Key features:
|
|
170 |
* WooCommerce shipping plugin,
|
171 |
* WooCommerce table rate shipping.
|
172 |
|
173 |
-
Give it a try and
|
174 |
|
175 |
== Installation ==
|
176 |
|
@@ -207,6 +216,9 @@ If you are upgrading from the old Flexible Shipping version (1.3.2, woo-flexible
|
|
207 |
|
208 |
== Changelog ==
|
209 |
|
|
|
|
|
|
|
210 |
= 4.13.2 - 2022-07-25 =
|
211 |
* Added support for WooCommerce 6.8
|
212 |
* Changed texts in meta boxes
|
4 |
Tags: table rate, table rate shipping, conditional shipping, free shipping, woocommerce shipping, woocommerce table rate shipping, cart based shipping, weight based shipping, totals based shipping, order based shipping, advanced shipping
|
5 |
Requires at least: 5.7
|
6 |
Tested up to: 6.0
|
7 |
+
Stable tag: 4.13.3
|
8 |
Requires PHP: 7.0
|
9 |
License: GPLv3 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
29 |
* Adding handling fee or an insurance cost after reaching a certain order value
|
30 |
* Creating COD (Cash On Delivery) shipping method with additional costs
|
31 |
* Different shipping costs for different shipping classes, products or product categories (PRO)
|
32 |
+
* Disabling/hiding the shipping method if the configured rule has been matched in the cart (PRO)
|
33 |
+
* Additional cost added to whole order and/or per each one product in the cart (PRO)
|
34 |
+
* Enabling/disabling the shipping method based on the Time of the Day and Day of the week (PRO)
|
35 |
+
* Hiding the shipping method for certain products
|
36 |
|
37 |
+
These are only a few examples of the Flexible Shipping usage, however, sky is the limit. We have described the most popular use cases in the comprehensive and detailed plugin documentation and [Ready to use scenarios →](https://octol.io/fs-repo-docs).
|
38 |
|
39 |
= Features =
|
40 |
|
43 |
* Shipping cost based on cart total and/or weight
|
44 |
* Minimum and maximum values for cart total and/or weight
|
45 |
* Summing up the costs of e.g. two different rules at the same time e.g. one based on cart total and the second based on weight
|
46 |
+
* Free shipping over amount threshold
|
47 |
* Option to display the selected shipping methods only for logged-in users
|
48 |
+
* Further shipping companies integrations (see the info below for more details)
|
49 |
* WPML and Polylang compatibility
|
50 |
* Built-in ready to use scenarios
|
51 |
* Automatic notification about shipping zone configuration conflict
|
57 |
* All free features
|
58 |
* **Shipping classes support**
|
59 |
* Shipping costs based on products' quantity and/or cart line item count
|
60 |
+
* Shipping cost based on the product’s length, width, height and/or maximal dimension
|
61 |
* Shipping cost based on the volume of the products in the cart
|
62 |
* Shipping cost based on dimensional weight (with custom DIM Factor)
|
63 |
* Shipping cost based on products (products, product categories, product tags)
|
64 |
* Shipping cost based on user role
|
65 |
+
* Enabling/disabling the shipping method based on the Time of the Day and Day of the week
|
66 |
+
* Additional costs based on price, weight, dimensional weight, item quantity, cart line item, volume
|
67 |
* Stopping a rule (if the rule is matched the following rules will not be calculated)
|
68 |
+
* Hiding a shipping method (if the rule is matched, the related shipping method will remain hidden and will not be displayed in the cart and checkout)
|
69 |
* Conditional logic for conditions with selection (e.g. shipping class) - matches any/all/none
|
70 |
* Conditional logic for conditions with ranges (e.g. weight) - is/is not
|
71 |
* Additional calculation methods (sum, lowest cost, highest cost)
|
72 |
* Maximum shipping cost per shipping method
|
73 |
* Free shipping coupons support
|
74 |
|
|
|
75 |
[Upgrade to PRO Now →](https://octol.io/fs-repo-up)
|
76 |
|
77 |
= Flexible Shipping Locations Add-On =
|
103 |
* [Shipping Live Rates for Australia Post for WooCommerce](https://octol.io/ap-repo) – Australia Post WooCommerce shipping methods with real-time calculated shipping rates
|
104 |
* [Shipping Live Rates for Canada Post for WooCommerce](https://octol.io/cp-repo) - Canada Post WooCommerce shipping methods with real-time calculated shipping rates
|
105 |
* [Shipping Live Rates for Royal Mail for WooCommerce](https://octol.io/rm-repo) - Royal Mail WooCommerce shipping methods with real-time calculated shipping rates
|
106 |
+
* [Shipping Notices](https://octol.io/notices-repo) - your own custom WooCommerce shipping notices instead of the default "No shipping options were found" info
|
107 |
+
* [Shipping Cost on Product Page](https://octol.io/scopp-repo) - displaying the shipping cost calculator to your customers directly on the product page, before reaching the cart or checkout
|
108 |
|
109 |
= Docs =
|
110 |
|
154 |
* Spanish by [Jose Luis](https://profiles.wordpress.org/jose64/), [Javier Esteban](https://profiles.wordpress.org/nobnob/), [lacasitadecadera](https://profiles.wordpress.org/lacasitadecera/)
|
155 |
* Dutch by [Vernum](https://profiles.wordpress.org/vernum/), [Peter Smits](https://profiles.wordpress.org/psmits1567/), [Pjeterjan Deneys](https://profiles.wordpress.org/nekojonez/)
|
156 |
|
157 |
+
= Interested in plugin translations? =
|
158 |
+
|
159 |
+
We are actively looking for contributors to translate this and [other Octolize plugins](https://profiles.wordpress.org/octolize/#content-plugins). Each supported language tremendously help store owners to conveniently manage shipping operations.
|
160 |
+
|
161 |
+
Your translations contribute to the WordPress community at large. Moreover, we're glad to offer you discounts for our PRO plugins and establish long-term collaboration. If you have any translation related questions, please email us at [translations@octolize.com](mailto:translations@octolize.com).
|
162 |
+
|
163 |
+
Head over here and help us to translate this plugin:
|
164 |
+
[https://translate.wordpress.org/projects/wp-plugins/flexible-shipping](https://translate.wordpress.org/projects/wp-plugins/flexible-shipping)
|
165 |
+
|
166 |
= Flexible Shipping in a nutshell =
|
167 |
|
168 |
Key features:
|
169 |
|
170 |
+
* improved shipping-related user experience,
|
171 |
+
* custom shipping rules,
|
172 |
+
* free shipping based on the price or products' in the cart quantity,
|
173 |
* cost based shipping cost
|
174 |
* weight based shipping cost
|
175 |
* total order based shipping cost,
|
179 |
* WooCommerce shipping plugin,
|
180 |
* WooCommerce table rate shipping.
|
181 |
|
182 |
+
Give it a try and see for yourself that our Flexible Shipping is the only one Table Rate Shipping plugin you need!
|
183 |
|
184 |
== Installation ==
|
185 |
|
216 |
|
217 |
== Changelog ==
|
218 |
|
219 |
+
= 4.13.3 - 2022-08-02 =
|
220 |
+
* Added extended data (matched items) in debug mode
|
221 |
+
|
222 |
= 4.13.2 - 2022-07-25 =
|
223 |
* Added support for WooCommerce 6.8
|
224 |
* Changed texts in meta boxes
|
src/WPDesk/FS/TableRate/Rule/Condition/ConditionsFactory.php
CHANGED
@@ -14,6 +14,9 @@ use WPDesk\FS\TableRate\Rule\Condition\Pro\Item;
|
|
14 |
use WPDesk\FS\TableRate\Rule\Condition\Pro\MaxDimension;
|
15 |
use WPDesk\FS\TableRate\Rule\Condition\Pro\Product;
|
16 |
use WPDesk\FS\TableRate\Rule\Condition\Pro\ProductCategory;
|
|
|
|
|
|
|
17 |
use WPDesk\FS\TableRate\Rule\Condition\Pro\ProductTag;
|
18 |
use WPDesk\FS\TableRate\Rule\Condition\Pro\ShippingClass;
|
19 |
use WPDesk\FS\TableRate\Rule\Condition\Pro\TimeOfTheDay;
|
@@ -42,6 +45,9 @@ class ConditionsFactory {
|
|
42 |
$product_category = new ProductCategory( 50 );
|
43 |
$time_of_the_day = new TimeOfTheDay( 70 );
|
44 |
$max_dimension = new MaxDimension( 40 );
|
|
|
|
|
|
|
45 |
$cart_line_item = new CartLineItem( 20 );
|
46 |
$shipping_class = new ShippingClass( 60 );
|
47 |
$day_of_the_week = new DayOfTheWeek( 75 );
|
@@ -60,6 +66,9 @@ class ConditionsFactory {
|
|
60 |
$product_category->get_condition_id() => $product_category,
|
61 |
$time_of_the_day->get_condition_id() => $time_of_the_day,
|
62 |
$max_dimension->get_condition_id() => $max_dimension,
|
|
|
|
|
|
|
63 |
$cart_line_item->get_condition_id() => $cart_line_item,
|
64 |
$shipping_class->get_condition_id() => $shipping_class,
|
65 |
$day_of_the_week->get_condition_id() => $day_of_the_week,
|
14 |
use WPDesk\FS\TableRate\Rule\Condition\Pro\MaxDimension;
|
15 |
use WPDesk\FS\TableRate\Rule\Condition\Pro\Product;
|
16 |
use WPDesk\FS\TableRate\Rule\Condition\Pro\ProductCategory;
|
17 |
+
use WPDesk\FS\TableRate\Rule\Condition\Pro\ProductDimensionHeight;
|
18 |
+
use WPDesk\FS\TableRate\Rule\Condition\Pro\ProductDimensionLength;
|
19 |
+
use WPDesk\FS\TableRate\Rule\Condition\Pro\ProductDimensionWidth;
|
20 |
use WPDesk\FS\TableRate\Rule\Condition\Pro\ProductTag;
|
21 |
use WPDesk\FS\TableRate\Rule\Condition\Pro\ShippingClass;
|
22 |
use WPDesk\FS\TableRate\Rule\Condition\Pro\TimeOfTheDay;
|
45 |
$product_category = new ProductCategory( 50 );
|
46 |
$time_of_the_day = new TimeOfTheDay( 70 );
|
47 |
$max_dimension = new MaxDimension( 40 );
|
48 |
+
$product_length = new ProductDimensionLength( 41 );
|
49 |
+
$product_width = new ProductDimensionWidth( 42 );
|
50 |
+
$product_height = new ProductDimensionHeight( 43 );
|
51 |
$cart_line_item = new CartLineItem( 20 );
|
52 |
$shipping_class = new ShippingClass( 60 );
|
53 |
$day_of_the_week = new DayOfTheWeek( 75 );
|
66 |
$product_category->get_condition_id() => $product_category,
|
67 |
$time_of_the_day->get_condition_id() => $time_of_the_day,
|
68 |
$max_dimension->get_condition_id() => $max_dimension,
|
69 |
+
$product_length->get_condition_id() => $product_length,
|
70 |
+
$product_width->get_condition_id() => $product_width,
|
71 |
+
$product_height->get_condition_id() => $product_height,
|
72 |
$cart_line_item->get_condition_id() => $cart_line_item,
|
73 |
$shipping_class->get_condition_id() => $shipping_class,
|
74 |
$day_of_the_week->get_condition_id() => $day_of_the_week,
|
src/WPDesk/FS/TableRate/Rule/Condition/Price.php
CHANGED
@@ -8,10 +8,7 @@
|
|
8 |
namespace WPDesk\FS\TableRate\Rule\Condition;
|
9 |
|
10 |
use FSVendor\WPDesk\Forms\Field;
|
11 |
-
use FSVendor\WPDesk\Forms\Field\InputTextField;
|
12 |
use Psr\Log\LoggerInterface;
|
13 |
-
use WPDesk\FS\TableRate\Exception\ConditionInvalidNumberValue;
|
14 |
-
use WPDesk\FS\TableRate\Exception\ConditionRequiredField;
|
15 |
use WPDesk\FS\TableRate\Rule\ShippingContents\ShippingContents;
|
16 |
|
17 |
/**
|
@@ -82,7 +79,7 @@ class Price extends AbstractCondition {
|
|
82 |
* @return Field[]
|
83 |
*/
|
84 |
public function get_fields() {
|
85 |
-
return
|
86 |
( new Field\InputNumberField() )
|
87 |
->set_name( self::MIN )
|
88 |
->add_class( 'wc_input_decimal' )
|
@@ -100,7 +97,7 @@ class Price extends AbstractCondition {
|
|
100 |
->set_placeholder( __( 'max', 'flexible-shipping' ) )
|
101 |
->set_label( __( 'to', 'flexible-shipping' ) )
|
102 |
->add_data( 'suffix', get_woocommerce_currency_symbol() ),
|
103 |
-
|
104 |
}
|
105 |
|
106 |
}
|
8 |
namespace WPDesk\FS\TableRate\Rule\Condition;
|
9 |
|
10 |
use FSVendor\WPDesk\Forms\Field;
|
|
|
11 |
use Psr\Log\LoggerInterface;
|
|
|
|
|
12 |
use WPDesk\FS\TableRate\Rule\ShippingContents\ShippingContents;
|
13 |
|
14 |
/**
|
79 |
* @return Field[]
|
80 |
*/
|
81 |
public function get_fields() {
|
82 |
+
return [
|
83 |
( new Field\InputNumberField() )
|
84 |
->set_name( self::MIN )
|
85 |
->add_class( 'wc_input_decimal' )
|
97 |
->set_placeholder( __( 'max', 'flexible-shipping' ) )
|
98 |
->set_label( __( 'to', 'flexible-shipping' ) )
|
99 |
->add_data( 'suffix', get_woocommerce_currency_symbol() ),
|
100 |
+
];
|
101 |
}
|
102 |
|
103 |
}
|
src/WPDesk/FS/TableRate/Rule/Condition/Pro/MaxDimension.php
CHANGED
@@ -22,6 +22,7 @@ class MaxDimension extends AbstractCondition {
|
|
22 |
public function __construct( int $priority = 10 ) {
|
23 |
$this->condition_id = self::CONDITION_ID;
|
24 |
$this->name = __( 'Max dimension', 'flexible-shipping' );
|
|
|
25 |
$this->group = __( 'Weight & Dimensions', 'flexible-shipping' );
|
26 |
$this->priority = $priority;
|
27 |
$this->is_disabled = true;
|
22 |
public function __construct( int $priority = 10 ) {
|
23 |
$this->condition_id = self::CONDITION_ID;
|
24 |
$this->name = __( 'Max dimension', 'flexible-shipping' );
|
25 |
+
$this->description = __( 'Shipping cost based on the product\'s maximum dimension', 'flexible-shipping' );
|
26 |
$this->group = __( 'Weight & Dimensions', 'flexible-shipping' );
|
27 |
$this->priority = $priority;
|
28 |
$this->is_disabled = true;
|
src/WPDesk/FS/TableRate/Rule/Condition/Pro/ProductDimensionHeight.php
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace WPDesk\FS\TableRate\Rule\Condition\Pro;
|
4 |
+
|
5 |
+
use WPDesk\FS\TableRate\Rule\Condition\AbstractCondition;
|
6 |
+
|
7 |
+
/**
|
8 |
+
* Product height condition.
|
9 |
+
*/
|
10 |
+
class ProductDimensionHeight extends AbstractCondition {
|
11 |
+
|
12 |
+
const CONDITION_ID = 'product_height';
|
13 |
+
|
14 |
+
/**
|
15 |
+
* Product constructor.
|
16 |
+
*
|
17 |
+
* @param int $priority .
|
18 |
+
*/
|
19 |
+
public function __construct( int $priority = 10 ) {
|
20 |
+
$this->condition_id = self::CONDITION_ID;
|
21 |
+
$this->name = __( 'Height', 'flexible-shipping' );
|
22 |
+
$this->description = __( 'Shipping cost based on the product\'s height', 'flexible-shipping' );
|
23 |
+
$this->group = __( 'Weight & Dimensions', 'flexible-shipping' );
|
24 |
+
$this->priority = $priority;
|
25 |
+
$this->is_disabled = true;
|
26 |
+
|
27 |
+
$this->name .= ' ' . __( '(PRO feature)', 'flexible-shipping' );
|
28 |
+
}
|
29 |
+
}
|
src/WPDesk/FS/TableRate/Rule/Condition/Pro/ProductDimensionLength.php
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace WPDesk\FS\TableRate\Rule\Condition\Pro;
|
4 |
+
|
5 |
+
use WPDesk\FS\TableRate\Rule\Condition\AbstractCondition;
|
6 |
+
|
7 |
+
/**
|
8 |
+
* Product length condition.
|
9 |
+
*/
|
10 |
+
class ProductDimensionLength extends AbstractCondition {
|
11 |
+
|
12 |
+
const CONDITION_ID = 'product_length';
|
13 |
+
|
14 |
+
/**
|
15 |
+
* Product constructor.
|
16 |
+
*
|
17 |
+
* @param int $priority .
|
18 |
+
*/
|
19 |
+
public function __construct( int $priority = 10 ) {
|
20 |
+
$this->condition_id = self::CONDITION_ID;
|
21 |
+
$this->name = __( 'Length', 'flexible-shipping' );
|
22 |
+
$this->description = __( 'Shipping cost based on the product\'s length', 'flexible-shipping' );
|
23 |
+
$this->group = __( 'Weight & Dimensions', 'flexible-shipping' );
|
24 |
+
$this->priority = $priority;
|
25 |
+
$this->is_disabled = true;
|
26 |
+
|
27 |
+
$this->name .= ' ' . __( '(PRO feature)', 'flexible-shipping' );
|
28 |
+
}
|
29 |
+
}
|
src/WPDesk/FS/TableRate/Rule/Condition/Pro/ProductDimensionWidth.php
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace WPDesk\FS\TableRate\Rule\Condition\Pro;
|
4 |
+
|
5 |
+
use WPDesk\FS\TableRate\Rule\Condition\AbstractCondition;
|
6 |
+
|
7 |
+
/**
|
8 |
+
* Product width condition.
|
9 |
+
*/
|
10 |
+
class ProductDimensionWidth extends AbstractCondition {
|
11 |
+
|
12 |
+
const CONDITION_ID = 'product_width';
|
13 |
+
|
14 |
+
/**
|
15 |
+
* Product constructor.
|
16 |
+
*
|
17 |
+
* @param int $priority .
|
18 |
+
*/
|
19 |
+
public function __construct( int $priority = 10 ) {
|
20 |
+
$this->condition_id = self::CONDITION_ID;
|
21 |
+
$this->name = __( 'Width', 'flexible-shipping' );
|
22 |
+
$this->description = __( 'Shipping cost based on the product\'s width', 'flexible-shipping' );
|
23 |
+
$this->group = __( 'Weight & Dimensions', 'flexible-shipping' );
|
24 |
+
$this->priority = $priority;
|
25 |
+
$this->is_disabled = true;
|
26 |
+
|
27 |
+
$this->name .= ' ' . __( '(PRO feature)', 'flexible-shipping' );
|
28 |
+
}
|
29 |
+
}
|
src/WPDesk/FS/TableRate/Rule/Condition/Weight.php
CHANGED
@@ -8,10 +8,7 @@
|
|
8 |
namespace WPDesk\FS\TableRate\Rule\Condition;
|
9 |
|
10 |
use FSVendor\WPDesk\Forms\Field;
|
11 |
-
use FSVendor\WPDesk\Forms\Field\InputTextField;
|
12 |
use Psr\Log\LoggerInterface;
|
13 |
-
use WPDesk\FS\TableRate\Exception\ConditionInvalidNumberValue;
|
14 |
-
use WPDesk\FS\TableRate\Exception\ConditionRequiredField;
|
15 |
use WPDesk\FS\TableRate\Rule\ShippingContents\ShippingContents;
|
16 |
|
17 |
/**
|
@@ -71,7 +68,7 @@ class Weight extends AbstractCondition {
|
|
71 |
* @return Field[]
|
72 |
*/
|
73 |
public function get_fields() {
|
74 |
-
return
|
75 |
( new Field\InputNumberField() )
|
76 |
->set_name( self::MIN )
|
77 |
->add_class( 'wc_input_decimal' )
|
@@ -89,7 +86,7 @@ class Weight extends AbstractCondition {
|
|
89 |
->set_placeholder( __( 'to', 'flexible-shipping' ) )
|
90 |
->set_label( __( 'to', 'flexible-shipping' ) )
|
91 |
->add_data( 'suffix', get_option( 'woocommerce_weight_unit' ) ),
|
92 |
-
|
93 |
}
|
94 |
|
95 |
}
|
8 |
namespace WPDesk\FS\TableRate\Rule\Condition;
|
9 |
|
10 |
use FSVendor\WPDesk\Forms\Field;
|
|
|
11 |
use Psr\Log\LoggerInterface;
|
|
|
|
|
12 |
use WPDesk\FS\TableRate\Rule\ShippingContents\ShippingContents;
|
13 |
|
14 |
/**
|
68 |
* @return Field[]
|
69 |
*/
|
70 |
public function get_fields() {
|
71 |
+
return [
|
72 |
( new Field\InputNumberField() )
|
73 |
->set_name( self::MIN )
|
74 |
->add_class( 'wc_input_decimal' )
|
86 |
->set_placeholder( __( 'to', 'flexible-shipping' ) )
|
87 |
->set_label( __( 'to', 'flexible-shipping' ) )
|
88 |
->add_data( 'suffix', get_option( 'woocommerce_weight_unit' ) ),
|
89 |
+
];
|
90 |
}
|
91 |
|
92 |
}
|
src/WPDesk/FS/TableRate/Rule/Rule.php
CHANGED
@@ -150,6 +150,12 @@ class Rule {
|
|
150 |
* @return float
|
151 |
*/
|
152 |
public function get_rule_cost( ShippingContents $shipping_contents, LoggerInterface $logger ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
153 |
$logger->debug( sprintf( ' %1$s', __( 'Rule costs:', 'flexible-shipping' ) ) );
|
154 |
$cost = 0.0;
|
155 |
foreach ( $this->cost_fields as $cost_field ) {
|
@@ -164,6 +170,20 @@ class Rule {
|
|
164 |
return $cost;
|
165 |
}
|
166 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
167 |
/**
|
168 |
* @return SpecialAction
|
169 |
*/
|
@@ -183,7 +203,7 @@ class Rule {
|
|
183 |
*/
|
184 |
private function get_additional_costs( ShippingContents $shipping_contents, LoggerInterface $logger ) {
|
185 |
$additional_costs = 0.0;
|
186 |
-
$additional_costs_settings =
|
187 |
foreach ( $additional_costs_settings as $additional_cost_setting ) {
|
188 |
if ( isset( $this->available_additional_costs[ $additional_cost_setting['based_on'] ] ) ) {
|
189 |
$additional_costs += $this->available_additional_costs[ $additional_cost_setting['based_on'] ]->calculate_cost_with_method_settings( $shipping_contents, $additional_cost_setting, $logger, $this->method_settings );
|
150 |
* @return float
|
151 |
*/
|
152 |
public function get_rule_cost( ShippingContents $shipping_contents, LoggerInterface $logger ) {
|
153 |
+
// Translators: items.
|
154 |
+
$logger->debug( sprintf( __( ' Matched items: %1$s', 'flexible-shipping' ), $this->format_contents_for_log( $shipping_contents ) ) );
|
155 |
+
// Translators: items costs.
|
156 |
+
$logger->debug( sprintf( __( ' Matched items cost: %1$d %2$s', 'flexible-shipping' ), $shipping_contents->get_contents_cost(), $shipping_contents->get_currency() ) );
|
157 |
+
// Translators: items weight.
|
158 |
+
$logger->debug( sprintf( __( ' Matched items weight: %1$s', 'flexible-shipping' ), wc_format_weight( $shipping_contents->get_contents_weight() ) ) );
|
159 |
$logger->debug( sprintf( ' %1$s', __( 'Rule costs:', 'flexible-shipping' ) ) );
|
160 |
$cost = 0.0;
|
161 |
foreach ( $this->cost_fields as $cost_field ) {
|
170 |
return $cost;
|
171 |
}
|
172 |
|
173 |
+
/**
|
174 |
+
* @param ShippingContents $shipping_contents
|
175 |
+
*
|
176 |
+
* @return string
|
177 |
+
*/
|
178 |
+
private function format_contents_for_log( ShippingContents $shipping_contents ): string {
|
179 |
+
$formatted_contents = [];
|
180 |
+
foreach ( $shipping_contents->get_contents() as $item ) {
|
181 |
+
$formatted_contents[] = sprintf( '%1$s (qty: %2$d)', $item['data']->get_name(), $item['quantity'] );
|
182 |
+
}
|
183 |
+
|
184 |
+
return implode( ', ', $formatted_contents );
|
185 |
+
}
|
186 |
+
|
187 |
/**
|
188 |
* @return SpecialAction
|
189 |
*/
|
203 |
*/
|
204 |
private function get_additional_costs( ShippingContents $shipping_contents, LoggerInterface $logger ) {
|
205 |
$additional_costs = 0.0;
|
206 |
+
$additional_costs_settings = $this->rule_settings[ self::ADDITIONAL_COSTS ] ?? [];
|
207 |
foreach ( $additional_costs_settings as $additional_cost_setting ) {
|
208 |
if ( isset( $this->available_additional_costs[ $additional_cost_setting['based_on'] ] ) ) {
|
209 |
$additional_costs += $this->available_additional_costs[ $additional_cost_setting['based_on'] ]->calculate_cost_with_method_settings( $shipping_contents, $additional_cost_setting, $logger, $this->method_settings );
|
src/WPDesk/FS/TableRate/Rule/Settings/SettingsProcessor.php
CHANGED
@@ -73,12 +73,12 @@ class SettingsProcessor {
|
|
73 |
* @return array
|
74 |
*/
|
75 |
public function prepare_settings() {
|
76 |
-
$settings =
|
77 |
|
78 |
foreach ( $this->posted_settings as $rule_id => $rule_posted_settings ) {
|
79 |
-
$rule_settings =
|
80 |
-
'conditions' => $this->prepare_conditions( $rule_posted_settings['conditions'] ),
|
81 |
-
|
82 |
$rule_settings = $this->prepare_costs( $rule_settings, $rule_posted_settings );
|
83 |
$rule_settings = $this->prepare_costs_additional( $rule_settings, $rule_posted_settings );
|
84 |
$rule_settings = $this->prepare_special_action( $rule_settings, $rule_posted_settings );
|
@@ -86,7 +86,6 @@ class SettingsProcessor {
|
|
86 |
}
|
87 |
|
88 |
return $settings;
|
89 |
-
|
90 |
}
|
91 |
|
92 |
/**
|
@@ -110,10 +109,10 @@ class SettingsProcessor {
|
|
110 |
* @return array
|
111 |
*/
|
112 |
private function prepare_costs_additional( array $rule_settings, array $rule_posted_settings ) {
|
113 |
-
$rule_settings['additional_costs'] =
|
114 |
if ( isset( $rule_posted_settings['additional_costs'] ) && is_array( $rule_posted_settings['additional_costs'] ) ) {
|
115 |
foreach ( $rule_posted_settings['additional_costs'] as $posted_additional_cost ) {
|
116 |
-
$additional_cost =
|
117 |
foreach ( $this->additional_costs_fields as $field ) {
|
118 |
$additional_cost_value = isset( $posted_additional_cost[ $field->get_name() ] ) ? $posted_additional_cost[ $field->get_name() ] : '';
|
119 |
$additional_cost[ $field->get_name() ] = $this->sanitize_and_format_field( $additional_cost_value, $field );
|
@@ -145,10 +144,10 @@ class SettingsProcessor {
|
|
145 |
* @return array
|
146 |
*/
|
147 |
private function prepare_conditions( array $rule_conditions ) {
|
148 |
-
$conditions =
|
149 |
foreach ( $rule_conditions as $rule_condition ) {
|
150 |
-
$sanitized_condition = sanitize_key( $rule_condition['condition_id'] );
|
151 |
-
$condition_normalized =
|
152 |
if ( isset( $this->conditions[ $sanitized_condition ] ) ) {
|
153 |
list( $rule_condition, $condition_normalized ) = $this->prepare_condition_fields( $sanitized_condition, $rule_condition, $condition_normalized );
|
154 |
$conditions[] = $condition_normalized;
|
@@ -171,7 +170,7 @@ class SettingsProcessor {
|
|
171 |
$condition_normalized[ $field->get_name() ] = $this->sanitize_and_format_field( $rule_condition_value, $field );
|
172 |
}
|
173 |
|
174 |
-
return
|
175 |
}
|
176 |
|
177 |
/**
|
@@ -182,7 +181,7 @@ class SettingsProcessor {
|
|
182 |
if ( $field instanceof Field\InputNumberField ) {
|
183 |
return $this->format_number_field( sanitize_text_field( $value ) );
|
184 |
} else {
|
185 |
-
return $field->is_multiple() ? array_map( 'sanitize_text_field', is_array( $value ) ? $value :
|
186 |
}
|
187 |
}
|
188 |
|
73 |
* @return array
|
74 |
*/
|
75 |
public function prepare_settings() {
|
76 |
+
$settings = [];
|
77 |
|
78 |
foreach ( $this->posted_settings as $rule_id => $rule_posted_settings ) {
|
79 |
+
$rule_settings = [
|
80 |
+
'conditions' => $this->prepare_conditions( $rule_posted_settings['conditions'] ?? [] ),
|
81 |
+
];
|
82 |
$rule_settings = $this->prepare_costs( $rule_settings, $rule_posted_settings );
|
83 |
$rule_settings = $this->prepare_costs_additional( $rule_settings, $rule_posted_settings );
|
84 |
$rule_settings = $this->prepare_special_action( $rule_settings, $rule_posted_settings );
|
86 |
}
|
87 |
|
88 |
return $settings;
|
|
|
89 |
}
|
90 |
|
91 |
/**
|
109 |
* @return array
|
110 |
*/
|
111 |
private function prepare_costs_additional( array $rule_settings, array $rule_posted_settings ) {
|
112 |
+
$rule_settings['additional_costs'] = [];
|
113 |
if ( isset( $rule_posted_settings['additional_costs'] ) && is_array( $rule_posted_settings['additional_costs'] ) ) {
|
114 |
foreach ( $rule_posted_settings['additional_costs'] as $posted_additional_cost ) {
|
115 |
+
$additional_cost = [];
|
116 |
foreach ( $this->additional_costs_fields as $field ) {
|
117 |
$additional_cost_value = isset( $posted_additional_cost[ $field->get_name() ] ) ? $posted_additional_cost[ $field->get_name() ] : '';
|
118 |
$additional_cost[ $field->get_name() ] = $this->sanitize_and_format_field( $additional_cost_value, $field );
|
144 |
* @return array
|
145 |
*/
|
146 |
private function prepare_conditions( array $rule_conditions ) {
|
147 |
+
$conditions = [];
|
148 |
foreach ( $rule_conditions as $rule_condition ) {
|
149 |
+
$sanitized_condition = sanitize_key( $rule_condition['condition_id'] ?? [] );
|
150 |
+
$condition_normalized = [ 'condition_id' => $sanitized_condition ];
|
151 |
if ( isset( $this->conditions[ $sanitized_condition ] ) ) {
|
152 |
list( $rule_condition, $condition_normalized ) = $this->prepare_condition_fields( $sanitized_condition, $rule_condition, $condition_normalized );
|
153 |
$conditions[] = $condition_normalized;
|
170 |
$condition_normalized[ $field->get_name() ] = $this->sanitize_and_format_field( $rule_condition_value, $field );
|
171 |
}
|
172 |
|
173 |
+
return [ $rule_condition, $condition_normalized ];
|
174 |
}
|
175 |
|
176 |
/**
|
181 |
if ( $field instanceof Field\InputNumberField ) {
|
182 |
return $this->format_number_field( sanitize_text_field( $value ) );
|
183 |
} else {
|
184 |
+
return $field->is_multiple() ? array_map( 'sanitize_text_field', is_array( $value ) ? $value : [] ) : sanitize_text_field( $value );
|
185 |
}
|
186 |
}
|
187 |
|
src/WPDesk/FS/TableRate/ShippingMethod/RateCalculator.php
CHANGED
@@ -212,9 +212,9 @@ class RateCalculator {
|
|
212 |
$shipping_contents = apply_filters( 'flexible_shipping_shipping_contents', $shipping_contents, $method_settings->get_raw_settings(), $this->cart, $this->package );
|
213 |
|
214 |
// Translators: contents value.
|
215 |
-
$logger->debug( sprintf( __( 'Contents value: %1$s', 'flexible-shipping' ), $shipping_contents->get_contents_cost() ), $logger->get_input_data_context() );
|
216 |
// Translators: contents weight.
|
217 |
-
$logger->debug( sprintf( __( 'Contents weight: %1$s', 'flexible-shipping' ), $shipping_contents->get_contents_weight() ), $logger->get_input_data_context() );
|
218 |
|
219 |
$rate = $this->calculate_rate_for_rates( $method_settings, $shipping_contents, $rate_id, $logger );
|
220 |
} else {
|
212 |
$shipping_contents = apply_filters( 'flexible_shipping_shipping_contents', $shipping_contents, $method_settings->get_raw_settings(), $this->cart, $this->package );
|
213 |
|
214 |
// Translators: contents value.
|
215 |
+
$logger->debug( sprintf( __( 'Contents value: %1$s %2$s', 'flexible-shipping' ), $shipping_contents->get_contents_cost(), $shipping_contents->get_currency() ), $logger->get_input_data_context() );
|
216 |
// Translators: contents weight.
|
217 |
+
$logger->debug( sprintf( __( 'Contents weight: %1$s', 'flexible-shipping' ), wc_format_weight( $shipping_contents->get_contents_weight() ) ), $logger->get_input_data_context() );
|
218 |
|
219 |
$rate = $this->calculate_rate_for_rates( $method_settings, $shipping_contents, $rate_id, $logger );
|
220 |
} else {
|
vendor/composer/autoload_classmap.php
CHANGED
@@ -471,6 +471,9 @@ return array(
|
|
471 |
'WPDesk\\FS\\TableRate\\Rule\\Condition\\Pro\\MaxDimension' => $baseDir . '/src/WPDesk/FS/TableRate/Rule/Condition/Pro/MaxDimension.php',
|
472 |
'WPDesk\\FS\\TableRate\\Rule\\Condition\\Pro\\Product' => $baseDir . '/src/WPDesk/FS/TableRate/Rule/Condition/Pro/Product.php',
|
473 |
'WPDesk\\FS\\TableRate\\Rule\\Condition\\Pro\\ProductCategory' => $baseDir . '/src/WPDesk/FS/TableRate/Rule/Condition/Pro/ProductCategory.php',
|
|
|
|
|
|
|
474 |
'WPDesk\\FS\\TableRate\\Rule\\Condition\\Pro\\ProductTag' => $baseDir . '/src/WPDesk/FS/TableRate/Rule/Condition/Pro/ProductTag.php',
|
475 |
'WPDesk\\FS\\TableRate\\Rule\\Condition\\Pro\\ShippingClass' => $baseDir . '/src/WPDesk/FS/TableRate/Rule/Condition/Pro/ShippingClass.php',
|
476 |
'WPDesk\\FS\\TableRate\\Rule\\Condition\\Pro\\TimeOfTheDay' => $baseDir . '/src/WPDesk/FS/TableRate/Rule/Condition/Pro/TimeOfTheDay.php',
|
471 |
'WPDesk\\FS\\TableRate\\Rule\\Condition\\Pro\\MaxDimension' => $baseDir . '/src/WPDesk/FS/TableRate/Rule/Condition/Pro/MaxDimension.php',
|
472 |
'WPDesk\\FS\\TableRate\\Rule\\Condition\\Pro\\Product' => $baseDir . '/src/WPDesk/FS/TableRate/Rule/Condition/Pro/Product.php',
|
473 |
'WPDesk\\FS\\TableRate\\Rule\\Condition\\Pro\\ProductCategory' => $baseDir . '/src/WPDesk/FS/TableRate/Rule/Condition/Pro/ProductCategory.php',
|
474 |
+
'WPDesk\\FS\\TableRate\\Rule\\Condition\\Pro\\ProductDimensionHeight' => $baseDir . '/src/WPDesk/FS/TableRate/Rule/Condition/Pro/ProductDimensionHeight.php',
|
475 |
+
'WPDesk\\FS\\TableRate\\Rule\\Condition\\Pro\\ProductDimensionLength' => $baseDir . '/src/WPDesk/FS/TableRate/Rule/Condition/Pro/ProductDimensionLength.php',
|
476 |
+
'WPDesk\\FS\\TableRate\\Rule\\Condition\\Pro\\ProductDimensionWidth' => $baseDir . '/src/WPDesk/FS/TableRate/Rule/Condition/Pro/ProductDimensionWidth.php',
|
477 |
'WPDesk\\FS\\TableRate\\Rule\\Condition\\Pro\\ProductTag' => $baseDir . '/src/WPDesk/FS/TableRate/Rule/Condition/Pro/ProductTag.php',
|
478 |
'WPDesk\\FS\\TableRate\\Rule\\Condition\\Pro\\ShippingClass' => $baseDir . '/src/WPDesk/FS/TableRate/Rule/Condition/Pro/ShippingClass.php',
|
479 |
'WPDesk\\FS\\TableRate\\Rule\\Condition\\Pro\\TimeOfTheDay' => $baseDir . '/src/WPDesk/FS/TableRate/Rule/Condition/Pro/TimeOfTheDay.php',
|
vendor/composer/autoload_static.php
CHANGED
@@ -494,6 +494,9 @@ class ComposerStaticInitFlexibleShipping
|
|
494 |
'WPDesk\\FS\\TableRate\\Rule\\Condition\\Pro\\MaxDimension' => __DIR__ . '/../..' . '/src/WPDesk/FS/TableRate/Rule/Condition/Pro/MaxDimension.php',
|
495 |
'WPDesk\\FS\\TableRate\\Rule\\Condition\\Pro\\Product' => __DIR__ . '/../..' . '/src/WPDesk/FS/TableRate/Rule/Condition/Pro/Product.php',
|
496 |
'WPDesk\\FS\\TableRate\\Rule\\Condition\\Pro\\ProductCategory' => __DIR__ . '/../..' . '/src/WPDesk/FS/TableRate/Rule/Condition/Pro/ProductCategory.php',
|
|
|
|
|
|
|
497 |
'WPDesk\\FS\\TableRate\\Rule\\Condition\\Pro\\ProductTag' => __DIR__ . '/../..' . '/src/WPDesk/FS/TableRate/Rule/Condition/Pro/ProductTag.php',
|
498 |
'WPDesk\\FS\\TableRate\\Rule\\Condition\\Pro\\ShippingClass' => __DIR__ . '/../..' . '/src/WPDesk/FS/TableRate/Rule/Condition/Pro/ShippingClass.php',
|
499 |
'WPDesk\\FS\\TableRate\\Rule\\Condition\\Pro\\TimeOfTheDay' => __DIR__ . '/../..' . '/src/WPDesk/FS/TableRate/Rule/Condition/Pro/TimeOfTheDay.php',
|
494 |
'WPDesk\\FS\\TableRate\\Rule\\Condition\\Pro\\MaxDimension' => __DIR__ . '/../..' . '/src/WPDesk/FS/TableRate/Rule/Condition/Pro/MaxDimension.php',
|
495 |
'WPDesk\\FS\\TableRate\\Rule\\Condition\\Pro\\Product' => __DIR__ . '/../..' . '/src/WPDesk/FS/TableRate/Rule/Condition/Pro/Product.php',
|
496 |
'WPDesk\\FS\\TableRate\\Rule\\Condition\\Pro\\ProductCategory' => __DIR__ . '/../..' . '/src/WPDesk/FS/TableRate/Rule/Condition/Pro/ProductCategory.php',
|
497 |
+
'WPDesk\\FS\\TableRate\\Rule\\Condition\\Pro\\ProductDimensionHeight' => __DIR__ . '/../..' . '/src/WPDesk/FS/TableRate/Rule/Condition/Pro/ProductDimensionHeight.php',
|
498 |
+
'WPDesk\\FS\\TableRate\\Rule\\Condition\\Pro\\ProductDimensionLength' => __DIR__ . '/../..' . '/src/WPDesk/FS/TableRate/Rule/Condition/Pro/ProductDimensionLength.php',
|
499 |
+
'WPDesk\\FS\\TableRate\\Rule\\Condition\\Pro\\ProductDimensionWidth' => __DIR__ . '/../..' . '/src/WPDesk/FS/TableRate/Rule/Condition/Pro/ProductDimensionWidth.php',
|
500 |
'WPDesk\\FS\\TableRate\\Rule\\Condition\\Pro\\ProductTag' => __DIR__ . '/../..' . '/src/WPDesk/FS/TableRate/Rule/Condition/Pro/ProductTag.php',
|
501 |
'WPDesk\\FS\\TableRate\\Rule\\Condition\\Pro\\ShippingClass' => __DIR__ . '/../..' . '/src/WPDesk/FS/TableRate/Rule/Condition/Pro/ShippingClass.php',
|
502 |
'WPDesk\\FS\\TableRate\\Rule\\Condition\\Pro\\TimeOfTheDay' => __DIR__ . '/../..' . '/src/WPDesk/FS/TableRate/Rule/Condition/Pro/TimeOfTheDay.php',
|