Hi,
Is this plugin compatible with gutenberg Templates?
Regards
Yves
]]>Hi there,
I am using version 1.2.8 and when I check in Loco Translate plugin the German translation is complete and correct. However it’s not showing, neither in the admin area nor on the front end for the customer. The default WordPress language is set to German and translations showed up correctly before updating.
Any help is appreciated.
Thanks, Jenny
]]>Dear author,
currently you can set any number of posts per page via a request and/or cookie which can be used to overload big sites with the parameter set to -1. The solution would be to check if $per_page in loop_shop_per_page is in $products_per_page_options array.
Example solution (needs testing & review):
public function loop_shop_per_page( $per_page ) {
$per_page_default = intval( get_option( 'wppp_default_ppp', '12' ) );
$products_per_page_options = explode( ' ', apply_filters( 'wppp_products_per_page', get_option( 'wppp_dropdown_options' ) ) );
if ( isset( $_REQUEST['wppp_ppp'] ) ) :
$per_page = intval( $_REQUEST['wppp_ppp'] );
elseif ( isset( $_REQUEST['ppp'] ) ) :
$per_page = intval( $_REQUEST['ppp'] );
elseif ( isset( $_COOKIE['woocommerce_products_per_page'] ) ) :
$per_page = intval( $_COOKIE['woocommerce_products_per_page'] );
else :
$per_page = $per_page_default;
endif;
if (!in_array($per_page, $products_per_page_options) ) :
$per_page = $per_page_default;
endif;
return $per_page;
}
Please consider implementing this limitation.
Best regards,
Andrej
The text in the box is partly cut off. Would you know how I can fix this?
Thank you.
]]>Hello, thanks for this great plugin.
I have the ‘products per page’ dropdown menu sitting at the top right of my product archives (shop) page. Next to it, on the left, I also have a ‘sort by’ dropdown menu (CSS: float: right).
I would like these two menus to switch places. I have no idea how to achieve this with coding.
Could you please advise?
When using the GET method, if you set the products per page, it works as expected by adding ?ppp=#
That behavior only lasts so long as they stay in the current category.
If the user navigates to a different category, the ppp param is no longer in the URL but the products per page that was originally requested is still applied.
This breaks caching.
Is there anyway, or plan in the future to enable, setting a different number of products for mobile vs desktop?
Desktop can handle so much more and providing a super fast experience on mobile is critical so I really hope there is (or will be) a way.
]]>Hi there,
Is there a snippet I could use to add text before the Products Per Page dropdown?
I’d like to use your Changing the text in the dropdown guide so the dropdown just has the numbers, and add the text ‘Products per page’ infront of the dropdown.
Thank you for your help!
]]>Having problems where when I was using the Elementor Pro Product Grid, I was able to get your product filter to work. However, I had to switch to WooCommerce’s own shortcode to display a grid and in that case, I cannot get your filters to work anymore. No matter what, I only get 20 products per page
]]>Deactivating and reactivating the plugin loses its settings. That’s inconvenient as it in my case it also messes up the layout and the other customizations are lost. The expected behavior is for the settings to not be touched, and to get deleted only upon deletion of the plugin. Deactivation is an usual step when testing for buggy plugins.
]]>Hi!
I installed your plugin on my website with Xtra Theme by Codevz. Unfortunately I see that it does not want to work. Xtra Theme has an option in the settings to set how many products to display on the shop page, and it is probably this option that blocks the functions of your plugin. I’ve contacted Xtra Theme support about this issue, but unfortunately they don’t want to help with blocking this option, so I’m asking for help on this forum.
The german translation shipped with the current Version 1.2.7 of the plugin did not work for me. I opened in PoEdit, actualize from sourcecode and add some messages to make it work for me.
Patch from wp-content dir, made with
diff -u plugins/woocommerce-products-per-page/languages/woocommerce-products-per-page-de_DE.po languages/plugins/woocommerce-products-per-page-de_DE.po > woo-ppp.patch
--- plugins/woocommerce-products-per-page/languages/woocommerce-products-per-page-de_DE.po 2023-02-28 14:36:15.000000000 +0100
+++ languages/plugins/woocommerce-products-per-page-de_DE.po 2023-02-28 14:35:57.000000000 +0100
@@ -1,82 +1,105 @@
-msgid ""
-msgstr ""
-"Project-Id-Version: WooCommerce Products Per Page 1.0.1\n"
-"POT-Creation-Date: 2014-03-15 14:13+0100\n"
+"Project-Id-Version: WooCommerce Products Per Page 1.2.7\n"
+"POT-Creation-Date: 2023-02-28 13:54+0100\n"
"PO-Revision-Date: \n"
"Last-Translator: E. Eigner <[email protected]>\n"
"Language-Team: Jeroen Sormani <[email protected]>\n"
-"Language: fr\n"
+"Language: de\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n == 1 ? 0 : 1;\n"
"X-Generator: Poedit 3.1.1\n"
"X-Poedit-KeywordsList: __;_e\n"
-"X-Poedit-Basepath: /Users/Jeroen/plugins/woocommerce-products-per-page/trunk\n"
+"X-Poedit-Basepath: ..\n"
"X-Poedit-SourceCharset: UTF-8\n"
-"X-Poedit-SearchPath-0: /Users/Jeroen/plugins/woocommerce-products-per-page/trunk\n"
-
-#: /Users/Jeroen/plugins/woocommerce-products-per-page/trunk/admin/options-page.php:27
-msgid "Dropdown location"
-msgstr "Position des Dropdown"
+"X-Poedit-SearchPath-0: .\n"
-#: /Users/Jeroen/plugins/woocommerce-products-per-page/trunk/admin/options-page.php:35
-msgid "List of dropdown options"
-msgstr "Liste der Dropdown-Eintr?ge"
+#: includes/admin/class-wppp-admin-settings.php:64
+msgid "Drop-down location"
+msgstr "Dropdown Position"
-#: /Users/Jeroen/plugins/woocommerce-products-per-page/trunk/admin/options-page.php:43
-msgid "Default products per page"
-msgstr "Standardwert 'Produkte pro Seite'"
-
-#: /Users/Jeroen/plugins/woocommerce-products-per-page/trunk/admin/options-page.php:51
-msgid "Shop columns"
-msgstr "Anzahl Spalten im Shop"
-
-#: /Users/Jeroen/plugins/woocommerce-products-per-page/trunk/admin/options-page.php:59
-msgid "First category page"
-msgstr "Erste Seite der Produktkategorie"
-
-#: /Users/Jeroen/plugins/woocommerce-products-per-page/trunk/admin/options-page.php:73
-msgid "WooCommerce Products Per Page"
-msgstr "WooCommerce Products Per Page"
-
-#: /Users/Jeroen/plugins/woocommerce-products-per-page/trunk/admin/options-page.php:92
+#: includes/admin/class-wppp-admin-settings.php:72
msgid "Top"
-msgstr "Beginn"
+msgstr "Beginn (oben)"
-#: /Users/Jeroen/plugins/woocommerce-products-per-page/trunk/admin/options-page.php:93
+#: includes/admin/class-wppp-admin-settings.php:73
msgid "Bottom"
-msgstr "Ende"
+msgstr "Ende (unten)"
-#: /Users/Jeroen/plugins/woocommerce-products-per-page/trunk/admin/options-page.php:94
+#: includes/admin/class-wppp-admin-settings.php:74
msgid "Top/Bottom"
-msgstr "Beginn/Ende"
+msgstr "Beginn (oben)/Ende (unten)"
-#: /Users/Jeroen/plugins/woocommerce-products-per-page/trunk/admin/options-page.php:95
+#: includes/admin/class-wppp-admin-settings.php:75
msgid "None"
msgstr "Keine"
-#: /Users/Jeroen/plugins/woocommerce-products-per-page/trunk/admin/options-page.php:107
+#: includes/admin/class-wppp-admin-settings.php:81
+msgid "List of dropdown options"
+msgstr "Liste der Dropdown-Eintr?ge"
+
+#: includes/admin/class-wppp-admin-settings.php:82
msgid "Seperated by spaces <em>(-1 for all products)</em>"
msgstr "Mit Leerzeichen trennen <em>(-1 für alle Produkte)</em>"
-#: /Users/Jeroen/plugins/woocommerce-products-per-page/trunk/admin/options-page.php:118
+#: includes/admin/class-wppp-admin-settings.php:89
+msgid "Default products per page"
+msgstr "Standardwert 'Produkte pro Seite'"
+
+#: includes/admin/class-wppp-admin-settings.php:90
msgid "-1 for all products"
msgstr "-1 für 'Alle Produkte anzeigen'"
-#: /Users/Jeroen/plugins/woocommerce-products-per-page/trunk/admin/options-page.php:140
-msgid "When checked and a new number of PPP is selected, the visitor will be send to the first page of the product category"
-msgstr "Wenn die Option aktiviert ist, und der Nutzer einen anderen Eintrag 'Produkte pro Seite' w?hlt, wird er zur ersten Seite der Produktkategorie weitergeleitet"
-
-#: /Users/Jeroen/plugins/woocommerce-products-per-page/trunk/admin/options-page.php:187
-msgid "Configure the WooCommerce Product Per Page settings here."
-msgstr "Hier kannst du die Einstellungen von WooCommerce Product Per Page ?ndern."
+#: includes/admin/class-wppp-admin-settings.php:98
+msgid "Shop columns"
+msgstr "Anzahl Spalten im Shop"
+
+#: includes/admin/class-wppp-admin-settings.php:111
+msgid "First category page"
+msgstr "Erste Seite der Produktkategorie"
+
+#: includes/admin/class-wppp-admin-settings.php:112
+msgid ""
+"When checked and a new number of PPP is selected, the visitor will be send "
+"to the first page of the product category"
+msgstr ""
+"Wenn die Option aktiviert ist, und der Nutzer einen anderen Eintrag "
+"'Produkte pro Seite' w?hlt, wird er zur ersten Seite der Produktkategorie "
+"weitergeleitet"
+
+#: includes/admin/class-wppp-admin-settings.php:119
+msgid "HTTP method"
+msgstr "HTTP Methode"
+
+#: includes/admin/class-wppp-admin-settings.php:120
+msgid ""
+"GET sends the products per page via the url, POST does this on the background"
+msgstr "GET sendet die Anfrage via Url, POST im Hintergrund"
+
+#: includes/admin/class-wppp-admin-settings.php:126
+msgid "POST"
+msgstr "POST"
+
+#: includes/admin/class-wppp-admin-settings.php:127
+msgid "GET"
+msgstr "Cet"
-#: /Users/Jeroen/plugins/woocommerce-products-per-page/trunk/objects/wppp-dropdown.php:49
+#: includes/class-wppp-front-end.php:92
#, php-format
msgid "%s products per page"
msgstr "%s Produkte pro Seite"
-#: /Users/Jeroen/plugins/woocommerce-products-per-page/trunk/objects/wppp-dropdown.php:50
+#: includes/class-wppp-front-end.php:93
msgid "All"
msgstr "Alle"
+
+#: woocommerce-products-per-page.php:226
+msgid "Settings"
+msgstr "Einstellungen"
+
+#~ msgid "WooCommerce Products Per Page"
+#~ msgstr "WooCommerce Products Per Page"
+
+#~ msgid "Configure the WooCommerce Product Per Page settings here."
+#~ msgstr ""
+#~ "Hier kannst du die Einstellungen von WooCommerce Product Per Page ?ndern."
]]>
Firstly, thanks for the plugin.
I wrote this custom code to make it work with the [products] shortcode. Hopefully someone finds this useful.
/**
* 2023-02-17: user-selectable page-size for Woo products when using [products] shortcode and the 'Woocommerce Products Per Page' plugin
* The [products] shortcode has to set paginate='true', e.g. [products paginate='true']
*/
add_filter( 'woocommerce_shortcode_products_query', function($query_args, $attributes, $type){
// error_log("SLW: In woocommerce_shortcode_products_query. query_args: " . print_r($query_args, true));
$ppp = 36; // Default
if (isset($query_args['posts_per_page'])) { $ppp = $query_args['posts_per_page']; }
if ( function_exists( 'Woocommerce_Products_Per_Page' ) ) {
$ppp = Woocommerce_Products_Per_Page()->front_end->loop_shop_per_page($ppp);
if (!empty($ppp)) {
$query_args['posts_per_page'] = $ppp;
}
}
return $query_args;
}, 10, 3);
]]>
Hi!
I have some problem with plugin. I have in shop 24 products. Default view on shop page show 12 products per page, when i am on second page and change to view 36 products, give me 404 error page on second page.
Maybe some has any idea how to fix this?
It appears that the plugin is compatible with new WooCommerce high performance order storage system. Would it be possible to declare the compatibility and bump the plugin version?
Thanks!
]]>What would i need to do in order to translate the plugin to my language (Greek)
]]>Hello,
so the Plugin is showing up, but when position is set to top/begin I’m not able to click the dropdown.
Thank you very much,
Philipp
Hi, here comes a fix for the plugin. The Swedish Language file has uppercase endings and it will not load on updated prodution servers. Please can you update the plugin with lowercase file endings.
In production I have an Unbuntu Server with PHP 7.4.
This took me some time to figure out since it worked on the local development server, but not in production.
Otherwise this plugin works well even on the latest WP.
All the best,
Oskar
Hi
I have a line height issue, which I can’t seem to solve with CSS on default sort order drop down. Could you point me in the right direction to increase sort order on your drop down?
See here: https://www.screencast.com/t/ctoeLrYPiqI5
Many thanks in advance
]]>Hi there.
I have the same issue, as described in that topic:
https://www.ads-software.com/support/topic/divi-website-builder-and-products-per-page-dropdown-select/
And here is the answer of Divi support:
`I have checked that 3rd party plugin and it seems it cannot work with Woocommerce Shortcodes. The Shop Module is rendering the products on the front end using the Woo Shortcodes, which you can find them here.
The plugin you are using, only works with the default Shop Page, that Woocommerce creates, however since you are using the Theme Builder to create a custom template for the Shop Page, where the Shop Module is used (which uses the Woo Shortcodes) that custom filter will not work to change the default number of products.
I’m really sorry about this.`
So.
Is anything we can do in this situation?
Hello.
This plugin works well, but only on shop page that is set in WooCommerce settings.
I have 5 different pages, each for different categories and at these pages plugin doesn’t work properly.
Is there any way to make it work on different pages?
Thanks in advance
]]>Hi, The core WooCommerce plugin warns before updates which plugins have not declared compatibility. Do you have an ETA on compatibility with Woo 5.0?
]]>Hello,
I’ve noticed visitor could manipulate things in order to modify the number of products per page to any they would like to.
As a webmaster, I think it is important to manage this on my side, to offer the best experience, i.e. I’d like the visitor to select and use only predefined numbers of products per page.
So I modified (for me)
loop_shop_per_page
and
products_per_page_action
as follow and suggest you those modifications:
loop_shop_per_page :
public function loop_shop_per_page( $per_page ) {
if ( isset( $_REQUEST['wppp_ppp'] ) ) {
$per_page = intval( $_REQUEST['wppp_ppp'] );
}
elseif ( isset( $_REQUEST['ppp'] ) ) {
// Set the products per page options (e.g. 4, 8, 12)
$per_page = intval( $_REQUEST['ppp'] );
}
elseif ( isset( $_COOKIE['woocommerce_products_per_page'] ) ) {
$per_page = $_COOKIE['woocommerce_products_per_page'];
};
// MR - Check if value sent is an allowed value... Otherwise back to default!
// else $per_page = intval( get_option( 'wppp_default_ppp', '12' ) );
$products_per_page_options = array_values( explode( ' ', apply_filters( 'wppp_products_per_page', get_option( 'wppp_dropdown_options' ) ) ) );
if (! in_array($per_page, $products_per_page_options))
$per_page = intval( get_option( 'wppp_default_ppp', '12' ) );
return $per_page;
}
products_per_page_action :
public function products_per_page_action() {
// MR - Check against 'loop_shop_per_page' to write correct value
if ( isset( $_REQUEST['wppp_ppp'] ) ) :
wc_setcookie( 'woocommerce_products_per_page', $this->loop_shop_per_page( ( intval($_REQUEST['wppp_ppp']) ) ), time() + DAY_IN_SECONDS * 2, apply_filters( 'wc_session_use_secure_cookie', false ) );
elseif ( isset( $_REQUEST['ppp'] ) ) :
wc_setcookie( 'woocommerce_products_per_page', $this->loop_shop_per_page( ( intval($_REQUEST['ppp']) ) ), time() + DAY_IN_SECONDS * 2, apply_filters( 'wc_session_use_secure_cookie', false ) );
endif;
}
Happy to share ??
]]>Hello,
To be more compliant with latest version of WC and take into account other languages, this line should be:
$action = get_permalink( get_option( 'woocommerce_shop_page_id' ) ) . $query_string;
as in others languages, the shop’s permalink might not be ‘shop’…
Great plugin!
]]>Hello –
I have added your shortcode code to my functions.php file and then added the shortcode to a page I am using it on, however every time I save the page I get the following error:
Notice: Undefined property: Woocommerce_Products_Per_Page::$front_end in /public_html/wp-content/themes/Impreza-child/functions.php on line 18
Fatal error: Uncaught Error: Call to a member function products_per_page_dropdown() on null in /public_html/wp-content/themes/Impreza-child/functions.php:18
Stack trace:
#0 /public_html/wp-includes/shortcodes.php(343): custom_wppp_shortcode('', '', 'wppp')
#1 [internal function]: do_shortcode_tag(Array)
#2 /public_html/wp-includes/shortcodes.php(218): preg_replace_callback('/\\[(\\[?)(wppp)(...', 'do_shortcode_ta...', '[wppp]\n')
#3 /public_html/wp-includes/class-wp-hook.php(287): do_shortcode('[wppp]\n')
#4 /public_html/wp-includes/plugin.php(206): WP_Hook->apply_filters('[wppp]\n', Array)
#5 /public_html/wp-content/plugins/us-core/templates/elements/vc_column_text.php(41): apply_filters('widget_text_con...', '[wppp]')
#6 /public_html/wp-c in /public_html/wp-content/themes/Impreza-child/functions.php on line 18
If I then remove the post edit portion from the URL string and just navigate back to WP admin, the site is fine and the page was actually saved.
Any idea what might be causing this issue?
Thanks.
]]>I am using Divi as a website builder, I did create a child theme. (This is happening on all the category pages and product pages)
I am using Woocommerce Products Per Page plugin. But it does not work – it shows the options in the dropdown, but when an option is selected it does not display the correct amount, it stays on the default 8 per page.
I tried a few other custom codes that were available online but nothing works.
Can anyone help me?
Hope to hear from you.
Have a great day.
Kind regards.
]]>Can I change the dropdown height size somehow? It`s bigger then the other dropdown.
https://charkalaci.com/wp-content/uploads/2019/10/ppp.jpg
Hello I need help
I would like to remove site header menu only on mobile view. saw some css shortcode written by others but mostly hide both mobile and desktop. Do you have any idea, only hide on mobile view.
]]>Hi, Im beginner here. Im having some issue with my drop down menu in product page, I cant select any of the option. Ive tried to deactivate all the plugin one by one but still not working. What Should I Do?
]]>Going to the last page in pagination, then changing products per page – the resulting page is an error not found.
]]>