diff --git a/i18n/languages/woocommerce-extra-product-sorting-options-pl_PL.mo b/i18n/languages/woocommerce-extra-product-sorting-options-pl_PL.mo
new file mode 100644
index 0000000..02785d2
Binary files /dev/null and b/i18n/languages/woocommerce-extra-product-sorting-options-pl_PL.mo differ
diff --git a/i18n/languages/woocommerce-extra-product-sorting-options-pl_PL.po b/i18n/languages/woocommerce-extra-product-sorting-options-pl_PL.po
new file mode 100644
index 0000000..e9b14e4
--- /dev/null
+++ b/i18n/languages/woocommerce-extra-product-sorting-options-pl_PL.po
@@ -0,0 +1,208 @@
+# Copyright (C) 2022 SkyVerge
+# This file is distributed under the GNU General Public License v3.0.
+msgid ""
+msgstr ""
+"Project-Id-Version: Extra Product Sorting Options for WooCommerce 2.9.1\n"
+"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/woocommerce-extra-"
+"product-sorting-options\n"
+"POT-Creation-Date: 2022-10-31T15:51:32+01:00\n"
+"PO-Revision-Date: 2022-10-31 16:01+0100\n"
+"Last-Translator: \n"
+"Language-Team: \n"
+"Language: pl_PL\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 "
+"|| n%100>14) ? 1 : 2);\n"
+"X-Generator: Poedit 3.2\n"
+"X-Domain: woocommerce-extra-product-sorting-options\n"
+
+#. Plugin Name of the plugin
+msgid "Extra Product Sorting Options for WooCommerce"
+msgstr "Dodatkowe opcje sortowania produktów dla WooCommerce"
+
+#. Plugin URI of the plugin
+msgid ""
+"http://www.skyverge.com/product/woocommerce-extra-product-sorting-options/"
+msgstr ""
+
+#. Description of the plugin
+msgid "Rename default sorting and optionally extra product sorting options."
+msgstr ""
+"Zmień nazwę domyślnego sortowania i opcjonalnie dodatkowe opcje sortowania "
+"produktów."
+
+#. Author of the plugin
+msgid "SkyVerge"
+msgstr ""
+
+#. Author URI of the plugin
+msgid "http://www.skyverge.com/"
+msgstr ""
+
+#: woocommerce-extra-product-sorting-options.php:149
+msgid "New Default Sorting Label"
+msgstr "Nowa domyślna etykieta sortowania"
+
+#: woocommerce-extra-product-sorting-options.php:150
+msgid ""
+"If desired, enter a new name for the default sorting option, e.g., "Our "
+"Sorting""
+msgstr ""
+"W razie potrzeby wprowadź nową nazwę domyślnej opcji sortowania, np. ""
+"Nasze sortowanie""
+
+#: woocommerce-extra-product-sorting-options.php:172
+msgid "Add Product Sorting:"
+msgstr "Dodaj sortowanie produktów:"
+
+#. translators: Placeholders: %1$s - , %2$s -
+#: woocommerce-extra-product-sorting-options.php:175
+msgid ""
+"Select sorting options to add to your shop. %1$ssee documentation%2$s for "
+"more details."
+msgstr ""
+"Wybierz opcje sortowania, które chcesz dodać do swojego sklepu. Więcej "
+"szczegółów znajdziesz w %1$sdokumentacji%2$s."
+
+#: woocommerce-extra-product-sorting-options.php:200
+msgid "Remove Product Sorting:"
+msgstr "Usuń sortowanie produktów:"
+
+#. translators: Placeholders: %1$s - , %2$s -
+#: woocommerce-extra-product-sorting-options.php:203
+msgid ""
+"Select default sorting options to remove from your shop. %1$ssee "
+"documentation%2$s for more details."
+msgstr ""
+"Wybierz domyślne opcje sortowania, które chcesz usunąć ze swojego sklepu. "
+"Więcej szczegółów znajdziesz w %1$sdokumentacji%2$s."
+
+#: woocommerce-extra-product-sorting-options.php:263
+msgid "Name: A to Z"
+msgstr "Nazwa: A do Z"
+
+#: woocommerce-extra-product-sorting-options.php:264
+msgid "Name: Z to A"
+msgstr "Nazwa: Z do A"
+
+#: woocommerce-extra-product-sorting-options.php:265
+msgid "Available Stock"
+msgstr "Dostępność"
+
+#: woocommerce-extra-product-sorting-options.php:266
+msgid "Review Count"
+msgstr "Liczba recenzji"
+
+#: woocommerce-extra-product-sorting-options.php:267
+msgid "On-sale First"
+msgstr "Wyprzedaż"
+
+#: woocommerce-extra-product-sorting-options.php:268
+msgid "Weight ascending"
+msgstr "Waga rosnąco"
+
+#: woocommerce-extra-product-sorting-options.php:269
+msgid "Weight descending"
+msgstr "Waga malejąco"
+
+#: woocommerce-extra-product-sorting-options.php:270
+msgid "Height ascending"
+msgstr "Wysokość rosnąco"
+
+#: woocommerce-extra-product-sorting-options.php:271
+msgid "Height descending"
+msgstr "Wysokość malejąco"
+
+#: woocommerce-extra-product-sorting-options.php:368
+msgid "Sort by name: A to Z"
+msgstr "Sortuj według nazwy: A do Z"
+
+#: woocommerce-extra-product-sorting-options.php:371
+msgid "Sort by name: Z to A"
+msgstr "Sortuj według nazwy: Z do A"
+
+#: woocommerce-extra-product-sorting-options.php:374
+msgid "Sort by availability"
+msgstr "Sortuj według dostępności"
+
+#: woocommerce-extra-product-sorting-options.php:377
+msgid "Sort by review count"
+msgstr "Sortuj według liczby recenzji"
+
+#: woocommerce-extra-product-sorting-options.php:380
+msgid "Show sale items first"
+msgstr "Pokaż przedmioty z wyprzedaży jako pierwsze"
+
+#: woocommerce-extra-product-sorting-options.php:383
+msgid "Sort by weight ascending"
+msgstr "Sortuj według wagi rosnąco"
+
+#: woocommerce-extra-product-sorting-options.php:386
+msgid "Sort by weight descending"
+msgstr "Sortuj według wagi malejąco"
+
+#: woocommerce-extra-product-sorting-options.php:389
+msgid "Sort by height ascending"
+msgstr "Sortuj według wysokości rosnąco"
+
+#: woocommerce-extra-product-sorting-options.php:392
+msgid "Sort by height descending"
+msgstr "Sortuj według wysokości malejąco"
+
+#. translators: Placeholders: %s - plugin name
+#: woocommerce-extra-product-sorting-options.php:601
+msgid "You cannot clone instances of %s."
+msgstr "Nie możesz klonować instancji %s."
+
+#. translators: Placeholders: %s - plugin name
+#: woocommerce-extra-product-sorting-options.php:612
+msgid "You cannot unserialize instances of %s."
+msgstr "Nie można zdeserializować instancji %s."
+
+#: woocommerce-extra-product-sorting-options.php:630
+msgid "Configure"
+msgstr "Konfiguruj"
+
+#: woocommerce-extra-product-sorting-options.php:631
+msgid "FAQ"
+msgstr ""
+
+#: woocommerce-extra-product-sorting-options.php:632
+msgid "Support"
+msgstr "Wsparcie"
+
+#. translators: Placeholders: %1$s , %2$s - , %3$s - version number, %4$s - opening HTML link tag, %5$s - closing HTML link tag, %6$s - opening HTML link tag, %7$s - closing HTML link tag
+#: woocommerce-extra-product-sorting-options.php:704
+msgid ""
+"%1$sExtra Product Sorting Options for WooCommerce is inactive.%2$s This "
+"plugin requires WooCommerce %3$s or newer. Please %4$supdate WooCommerce%5$s "
+"or %6$srun the WooCommerce database upgrade%7$s."
+msgstr ""
+"%1$sDodatkowe opcje sortowania produktów dla WooCommerce są nieaktywne.%2$s "
+"Ta wtyczka wymaga WooCommerce %3$s lub nowszej. %4$zaktualizuj WooCommerce"
+"%5$s lub %6$suruchom aktualizację bazy danych WooCommerce%7$s."
+
+#. translators: Placeholders: %1$s - , %2$s - , %3$s - , %4$s -
+#: woocommerce-extra-product-sorting-options.php:888
+msgid ""
+"%1$sExtra Product Sorting Options for WooCommerce settings have changed.%2$s "
+"Random sorting is now disabled. If you need to re-add this option, please "
+"%3$sview our plugin notes%4$s."
+msgstr ""
+"%1$sDodatkowe opcje sortowania produktów w ustawieniach WooCommerce uległy "
+"zmianie.%2$s Sortowanie losowe jest teraz wyłączone. Jeśli chcesz ponownie "
+"dodać tę opcję, %3$sprzejrzyj nasze uwagi dotyczące wtyczek%4$s."
+
+#. translators: Placeholders: %1$s - , %2$s - , %3$s - , %4$s -
+#: woocommerce-extra-product-sorting-options.php:912
+msgid ""
+"%1$sExtra Product Sorting Options for WooCommerce settings have changed.%2$s "
+"Featured sorting is no longer possible with WooCommerce 3.0+ as this product "
+"data has changed. Please %3$sview our plugin notes%4$s for more details."
+msgstr ""
+"%1$sDodatkowe opcje sortowania produktów w ustawieniach WooCommerce uległy "
+"zmianie.%2$s Wybrane sortowanie nie jest już możliwe w WooCommerce 3.0+, "
+"ponieważ te dane produktu uległy zmianie. Aby uzyskać więcej informacji, "
+"%3$sprzejrzyj nasze uwagi dotyczące wtyczki%4$s."
diff --git a/i18n/languages/woocommerce-extra-product-sorting-options.pot b/i18n/languages/woocommerce-extra-product-sorting-options.pot
index 292fb87..29ad9c7 100644
--- a/i18n/languages/woocommerce-extra-product-sorting-options.pot
+++ b/i18n/languages/woocommerce-extra-product-sorting-options.pot
@@ -3,47 +3,61 @@
msgid ""
msgstr ""
"Project-Id-Version: Extra Product Sorting Options for WooCommerce 2.9.1\n"
-"Report-Msgid-Bugs-To: "
-"https://wordpress.org/support/plugin/woocommerce-extra-product-sorting-"
-"options\n"
-"POT-Creation-Date: 2022-08-01 03:31:54+00:00\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=utf-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"PO-Revision-Date: 2022-MO-DA HO:MI+ZONE\n"
+"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/woocommerce-extra-product-sorting-options\n"
"Last-Translator: FULL NAME \n"
"Language-Team: LANGUAGE \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"POT-Creation-Date: 2022-10-31T15:51:32+01:00\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"X-Generator: WP-CLI 2.7.1\n"
+"X-Domain: woocommerce-extra-product-sorting-options\n"
+
+#. Plugin Name of the plugin
+msgid "Extra Product Sorting Options for WooCommerce"
+msgstr ""
+
+#. Plugin URI of the plugin
+msgid "http://www.skyverge.com/product/woocommerce-extra-product-sorting-options/"
+msgstr ""
+
+#. Description of the plugin
+msgid "Rename default sorting and optionally extra product sorting options."
+msgstr ""
+
+#. Author of the plugin
+msgid "SkyVerge"
+msgstr ""
+
+#. Author URI of the plugin
+msgid "http://www.skyverge.com/"
+msgstr ""
#: woocommerce-extra-product-sorting-options.php:149
msgid "New Default Sorting Label"
msgstr ""
#: woocommerce-extra-product-sorting-options.php:150
-msgid ""
-"If desired, enter a new name for the default sorting option, e.g., "
-""Our Sorting""
+msgid "If desired, enter a new name for the default sorting option, e.g., "Our Sorting""
msgstr ""
#: woocommerce-extra-product-sorting-options.php:172
msgid "Add Product Sorting:"
msgstr ""
-#: woocommerce-extra-product-sorting-options.php:175
#. translators: Placeholders: %1$s - , %2$s -
-msgid ""
-"Select sorting options to add to your shop. %1$ssee documentation%2$s for "
-"more details."
+#: woocommerce-extra-product-sorting-options.php:175
+msgid "Select sorting options to add to your shop. %1$ssee documentation%2$s for more details."
msgstr ""
#: woocommerce-extra-product-sorting-options.php:200
msgid "Remove Product Sorting:"
msgstr ""
-#: woocommerce-extra-product-sorting-options.php:203
#. translators: Placeholders: %1$s - , %2$s -
-msgid ""
-"Select default sorting options to remove from your shop. %1$ssee "
-"documentation%2$s for more details."
+#: woocommerce-extra-product-sorting-options.php:203
+msgid "Select default sorting options to remove from your shop. %1$ssee documentation%2$s for more details."
msgstr ""
#: woocommerce-extra-product-sorting-options.php:263
@@ -66,117 +80,91 @@ msgstr ""
msgid "On-sale First"
msgstr ""
-#: woocommerce-extra-product-sorting-options.php:286
-msgid "Default sorting"
+#: woocommerce-extra-product-sorting-options.php:268
+msgid "Weight ascending"
msgstr ""
-#: woocommerce-extra-product-sorting-options.php:287
-msgid "Sort by popularity"
+#: woocommerce-extra-product-sorting-options.php:269
+msgid "Weight descending"
msgstr ""
-#: woocommerce-extra-product-sorting-options.php:288
-msgid "Sort by average rating"
+#: woocommerce-extra-product-sorting-options.php:270
+msgid "Height ascending"
msgstr ""
-#: woocommerce-extra-product-sorting-options.php:289
-msgid "Sort by latest"
+#: woocommerce-extra-product-sorting-options.php:271
+msgid "Height descending"
msgstr ""
-#: woocommerce-extra-product-sorting-options.php:290
-msgid "Sort by price: low to high"
-msgstr ""
-
-#: woocommerce-extra-product-sorting-options.php:291
-msgid "Sort by price: high to low"
-msgstr ""
-
-#: woocommerce-extra-product-sorting-options.php:364
+#: woocommerce-extra-product-sorting-options.php:368
msgid "Sort by name: A to Z"
msgstr ""
-#: woocommerce-extra-product-sorting-options.php:367
+#: woocommerce-extra-product-sorting-options.php:371
msgid "Sort by name: Z to A"
msgstr ""
-#: woocommerce-extra-product-sorting-options.php:370
+#: woocommerce-extra-product-sorting-options.php:374
msgid "Sort by availability"
msgstr ""
-#: woocommerce-extra-product-sorting-options.php:373
+#: woocommerce-extra-product-sorting-options.php:377
msgid "Sort by review count"
msgstr ""
-#: woocommerce-extra-product-sorting-options.php:376
+#: woocommerce-extra-product-sorting-options.php:380
msgid "Show sale items first"
msgstr ""
-#: woocommerce-extra-product-sorting-options.php:557
-#. translators: Placeholders: %s - plugin name
-msgid "You cannot clone instances of %s."
+#: woocommerce-extra-product-sorting-options.php:383
+msgid "Sort by weight ascending"
msgstr ""
-#: woocommerce-extra-product-sorting-options.php:568
-#. translators: Placeholders: %s - plugin name
-msgid "You cannot unserialize instances of %s."
+#: woocommerce-extra-product-sorting-options.php:386
+msgid "Sort by weight descending"
msgstr ""
-#: woocommerce-extra-product-sorting-options.php:586
-msgid "Configure"
+#: woocommerce-extra-product-sorting-options.php:389
+msgid "Sort by height ascending"
msgstr ""
-#: woocommerce-extra-product-sorting-options.php:587
-msgid "FAQ"
+#: woocommerce-extra-product-sorting-options.php:392
+msgid "Sort by height descending"
msgstr ""
-#: woocommerce-extra-product-sorting-options.php:588
-msgid "Support"
+#. translators: Placeholders: %s - plugin name
+#: woocommerce-extra-product-sorting-options.php:601
+msgid "You cannot clone instances of %s."
msgstr ""
-#: woocommerce-extra-product-sorting-options.php:660
-#. translators: Placeholders: %1$s , %2$s - , %3$s - version
-#. number, %4$s - opening HTML link tag, %5$s - closing HTML link tag,
-#. %6$s - opening HTML link tag, %7$s - closing HTML link tag
-msgid ""
-"%1$sExtra Product Sorting Options for WooCommerce is inactive.%2$s This "
-"plugin requires WooCommerce %3$s or newer. Please %4$supdate "
-"WooCommerce%5$s or %6$srun the WooCommerce database upgrade%7$s."
+#. translators: Placeholders: %s - plugin name
+#: woocommerce-extra-product-sorting-options.php:612
+msgid "You cannot unserialize instances of %s."
msgstr ""
-#: woocommerce-extra-product-sorting-options.php:844
-#. translators: Placeholders: %1$s - , %2$s - , %3$s - ,
-#. %4$s -
-msgid ""
-"%1$sExtra Product Sorting Options for WooCommerce settings have "
-"changed.%2$s Random sorting is now disabled. If you need to re-add this "
-"option, please %3$sview our plugin notes%4$s."
+#: woocommerce-extra-product-sorting-options.php:630
+msgid "Configure"
msgstr ""
-#: woocommerce-extra-product-sorting-options.php:868
-#. translators: Placeholders: %1$s - , %2$s - , %3$s - ,
-#. %4$s -
-msgid ""
-"%1$sExtra Product Sorting Options for WooCommerce settings have "
-"changed.%2$s Featured sorting is no longer possible with WooCommerce 3.0+ "
-"as this product data has changed. Please %3$sview our plugin notes%4$s for "
-"more details."
+#: woocommerce-extra-product-sorting-options.php:631
+msgid "FAQ"
msgstr ""
-#. Plugin Name of the plugin/theme
-msgid "Extra Product Sorting Options for WooCommerce"
+#: woocommerce-extra-product-sorting-options.php:632
+msgid "Support"
msgstr ""
-#. Plugin URI of the plugin/theme
-msgid "http://www.skyverge.com/product/woocommerce-extra-product-sorting-options/"
+#. translators: Placeholders: %1$s , %2$s - , %3$s - version number, %4$s - opening HTML link tag, %5$s - closing HTML link tag, %6$s - opening HTML link tag, %7$s - closing HTML link tag
+#: woocommerce-extra-product-sorting-options.php:704
+msgid "%1$sExtra Product Sorting Options for WooCommerce is inactive.%2$s This plugin requires WooCommerce %3$s or newer. Please %4$supdate WooCommerce%5$s or %6$srun the WooCommerce database upgrade%7$s."
msgstr ""
-#. Description of the plugin/theme
-msgid "Rename default sorting and optionally extra product sorting options."
+#. translators: Placeholders: %1$s - , %2$s - , %3$s - , %4$s -
+#: woocommerce-extra-product-sorting-options.php:888
+msgid "%1$sExtra Product Sorting Options for WooCommerce settings have changed.%2$s Random sorting is now disabled. If you need to re-add this option, please %3$sview our plugin notes%4$s."
msgstr ""
-#. Author of the plugin/theme
-msgid "SkyVerge"
+#. translators: Placeholders: %1$s - , %2$s - , %3$s - , %4$s -
+#: woocommerce-extra-product-sorting-options.php:912
+msgid "%1$sExtra Product Sorting Options for WooCommerce settings have changed.%2$s Featured sorting is no longer possible with WooCommerce 3.0+ as this product data has changed. Please %3$sview our plugin notes%4$s for more details."
msgstr ""
-
-#. Author URI of the plugin/theme
-msgid "http://www.skyverge.com/"
-msgstr ""
\ No newline at end of file
diff --git a/woocommerce-extra-product-sorting-options.php b/woocommerce-extra-product-sorting-options.php
index 128b0a9..8726bfc 100644
--- a/woocommerce-extra-product-sorting-options.php
+++ b/woocommerce-extra-product-sorting-options.php
@@ -260,11 +260,15 @@ protected function get_settings_options() {
private function get_extra_sorting_setting_options() {
return [
- 'alphabetical' => __( 'Name: A to Z', 'woocommerce-extra-product-sorting-options' ),
- 'reverse_alpha' => __( 'Name: Z to A', 'woocommerce-extra-product-sorting-options' ),
- 'by_stock' => __( 'Available Stock', 'woocommerce-extra-product-sorting-options' ),
- 'review_count' => __( 'Review Count', 'woocommerce-extra-product-sorting-options' ),
- 'on_sale_first' => __( 'On-sale First', 'woocommerce-extra-product-sorting-options' ),
+ 'alphabetical' => __( 'Name: A to Z', 'woocommerce-extra-product-sorting-options' ),
+ 'reverse_alpha' => __( 'Name: Z to A', 'woocommerce-extra-product-sorting-options' ),
+ 'by_stock' => __( 'Available Stock', 'woocommerce-extra-product-sorting-options' ),
+ 'review_count' => __( 'Review Count', 'woocommerce-extra-product-sorting-options' ),
+ 'on_sale_first' => __( 'On-sale First', 'woocommerce-extra-product-sorting-options' ),
+ 'weight_asc' => __( 'Weight ascending', 'woocommerce-extra-product-sorting-options' ),
+ 'weight_desc' => __( 'Weight descending', 'woocommerce-extra-product-sorting-options' ),
+ 'height_asc' => __( 'Height ascending', 'woocommerce-extra-product-sorting-options' ),
+ 'height_desc' => __( 'Height descending', 'woocommerce-extra-product-sorting-options' ),
];
}
@@ -375,6 +379,18 @@ public function modify_sorting_settings( $order_by ) {
case 'on_sale_first':
$order_by['on_sale_first'] = __( 'Show sale items first', 'woocommerce-extra-product-sorting-options' );
break;
+ case 'weight_asc':
+ $order_by['weight_asc'] = __( 'Sort by weight ascending', 'woocommerce-extra-product-sorting-options' );
+ break;
+ case 'weight_desc':
+ $order_by['weight_desc'] = __( 'Sort by weight descending', 'woocommerce-extra-product-sorting-options' );
+ break;
+ case 'height_asc':
+ $order_by['height_asc'] = __( 'Sort by height ascending', 'woocommerce-extra-product-sorting-options' );
+ break;
+ case 'height_desc':
+ $order_by['height_desc'] = __( 'Sort by height descending', 'woocommerce-extra-product-sorting-options' );
+ break;
}
}
@@ -472,6 +488,34 @@ public function add_new_shop_ordering_args( $sort_args ) {
$sort_args['meta_key'] = '_sale_price';
break;
+
+ case 'weight_asc':
+
+ $sort_args['orderby'] = [ 'meta_value_num' => 'ASC', $fallback => $fallback_order ];
+ $sort_args['meta_key'] = '_weight';
+
+ break;
+
+ case 'weight_desc':
+
+ $sort_args['orderby'] = [ 'meta_value_num' => 'DESC', $fallback => $fallback_order ];
+ $sort_args['meta_key'] = '_weight';
+
+ break;
+
+ case 'height_asc':
+
+ $sort_args['orderby'] = [ 'meta_value_num' => 'ASC', $fallback => $fallback_order ];
+ $sort_args['meta_key'] = '_height';
+
+ break;
+
+ case 'height_desc':
+
+ $sort_args['orderby'] = [ 'meta_value_num' => 'DESC', $fallback => $fallback_order ];
+ $sort_args['meta_key'] = '_height';
+
+ break;
}
return $sort_args;