Version Description
07/11/2017 =
[Fix] - Default 'list of dropdown options' setting is not properly set on the settings page.
Download this release
Release Info
Developer | sormano |
Plugin | WooCommerce Products Per Page |
Version | 1.2.4 |
Comparing to | |
See all releases |
Code changes from version 1.2.3 to 1.2.4
includes/class-wppp-front-end.php
CHANGED
@@ -32,14 +32,17 @@ class WPPP_Front_End {
|
|
32 |
endif;
|
33 |
|
34 |
// Add filter for product columns
|
35 |
-
add_filter( 'loop_shop_columns', array( $this, 'loop_shop_columns' )
|
36 |
|
37 |
// Custom number of products per page
|
38 |
-
add_filter( 'loop_shop_per_page', array( $this, 'loop_shop_per_page' )
|
39 |
|
40 |
// Get the right amount of products from the DB
|
41 |
add_action( 'woocommerce_product_query', array( $this, 'woocommerce_product_query' ), 2, 50 );
|
42 |
|
|
|
|
|
|
|
43 |
// Check if ppp form is fired
|
44 |
add_action( 'init', array( $this, 'products_per_page_action' ) );
|
45 |
|
@@ -160,8 +163,8 @@ class WPPP_Front_End {
|
|
160 |
return intval( $_REQUEST['wppp_ppp'] );
|
161 |
elseif ( isset( $_REQUEST['ppp'] ) ) :
|
162 |
return intval( $_REQUEST['ppp'] );
|
163 |
-
elseif (
|
164 |
-
return
|
165 |
else :
|
166 |
return intval( get_option( 'wppp_default_ppp', '12' ) );
|
167 |
endif;
|
@@ -189,6 +192,22 @@ class WPPP_Front_End {
|
|
189 |
}
|
190 |
|
191 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
192 |
/**
|
193 |
* PPP action.
|
194 |
*
|
@@ -200,9 +219,9 @@ class WPPP_Front_End {
|
|
200 |
public function products_per_page_action() {
|
201 |
|
202 |
if ( isset( $_REQUEST['wppp_ppp'] ) ) :
|
203 |
-
|
204 |
elseif ( isset( $_REQUEST['ppp'] ) ) :
|
205 |
-
|
206 |
endif;
|
207 |
|
208 |
}
|
32 |
endif;
|
33 |
|
34 |
// Add filter for product columns
|
35 |
+
add_filter( 'loop_shop_columns', array( $this, 'loop_shop_columns' ) );
|
36 |
|
37 |
// Custom number of products per page
|
38 |
+
add_filter( 'loop_shop_per_page', array( $this, 'loop_shop_per_page' ) );
|
39 |
|
40 |
// Get the right amount of products from the DB
|
41 |
add_action( 'woocommerce_product_query', array( $this, 'woocommerce_product_query' ), 2, 50 );
|
42 |
|
43 |
+
// Set cookie so PPP will be saved
|
44 |
+
add_action( 'init', array( $this, 'set_customer_session' ), 10 );
|
45 |
+
|
46 |
// Check if ppp form is fired
|
47 |
add_action( 'init', array( $this, 'products_per_page_action' ) );
|
48 |
|
163 |
return intval( $_REQUEST['wppp_ppp'] );
|
164 |
elseif ( isset( $_REQUEST['ppp'] ) ) :
|
165 |
return intval( $_REQUEST['ppp'] );
|
166 |
+
elseif ( WC()->session->__isset( 'products_per_page' ) ) :
|
167 |
+
return intval( WC()->session->__get( 'products_per_page' ) );
|
168 |
else :
|
169 |
return intval( get_option( 'wppp_default_ppp', '12' ) );
|
170 |
endif;
|
192 |
}
|
193 |
|
194 |
|
195 |
+
/**
|
196 |
+
* Initialize session.
|
197 |
+
*
|
198 |
+
* Set an initial session for WC 2.1.X users. Cookies are set automatically prior 2.1.X.
|
199 |
+
*
|
200 |
+
* @since 1.2.0
|
201 |
+
*/
|
202 |
+
public function set_customer_session() {
|
203 |
+
|
204 |
+
if ( WC()->version > '2.1' && ( ! is_admin() || defined( 'DOING_AJAX' ) ) && ! defined( 'DOING_CRON' ) ) :
|
205 |
+
WC()->session->set_customer_session_cookie( true );
|
206 |
+
endif;
|
207 |
+
|
208 |
+
}
|
209 |
+
|
210 |
+
|
211 |
/**
|
212 |
* PPP action.
|
213 |
*
|
219 |
public function products_per_page_action() {
|
220 |
|
221 |
if ( isset( $_REQUEST['wppp_ppp'] ) ) :
|
222 |
+
WC()->session->set( 'products_per_page', intval( $_REQUEST['wppp_ppp'] ) );
|
223 |
elseif ( isset( $_REQUEST['ppp'] ) ) :
|
224 |
+
WC()->session->set( 'products_per_page', intval( $_REQUEST['ppp'] ) );
|
225 |
endif;
|
226 |
|
227 |
}
|
languages/woocommerce-products-per-page-de_DE.mo
CHANGED
Binary file
|
languages/woocommerce-products-per-page-de_DE.po
CHANGED
@@ -5,11 +5,11 @@ msgstr ""
|
|
5 |
"PO-Revision-Date: \n"
|
6 |
"Last-Translator: Michael Firnkes <info@blogprofis.de>\n"
|
7 |
"Language-Team: Jeroen Sormani <jeroen.sormani@gmail.com>\n"
|
8 |
-
"Language:
|
9 |
"MIME-Version: 1.0\n"
|
10 |
"Content-Type: text/plain; charset=UTF-8\n"
|
11 |
"Content-Transfer-Encoding: 8bit\n"
|
12 |
-
"X-Generator: Poedit 1.
|
13 |
"X-Poedit-KeywordsList: __;_e\n"
|
14 |
"X-Poedit-Basepath: /Users/Jeroen/plugins/woocommerce-products-per-page/trunk/\n"
|
15 |
"Plural-Forms: nplurals=2; plural=n == 1 ? 0 : 1;\n"
|
@@ -58,7 +58,7 @@ msgstr "Keine"
|
|
58 |
|
59 |
#: /Users/Jeroen/plugins/woocommerce-products-per-page/trunk/admin/options-page.php:107
|
60 |
msgid "Seperated by spaces <em>(-1 for all products)</em>"
|
61 |
-
msgstr "
|
62 |
|
63 |
#: /Users/Jeroen/plugins/woocommerce-products-per-page/trunk/admin/options-page.php:118
|
64 |
msgid "-1 for all products"
|
@@ -80,3 +80,4 @@ msgstr "%s Produkte pro Seite"
|
|
80 |
#: /Users/Jeroen/plugins/woocommerce-products-per-page/trunk/objects/wppp-dropdown.php:50
|
81 |
msgid "All"
|
82 |
msgstr "Alle"
|
|
5 |
"PO-Revision-Date: \n"
|
6 |
"Last-Translator: Michael Firnkes <info@blogprofis.de>\n"
|
7 |
"Language-Team: Jeroen Sormani <jeroen.sormani@gmail.com>\n"
|
8 |
+
"Language: French\n"
|
9 |
"MIME-Version: 1.0\n"
|
10 |
"Content-Type: text/plain; charset=UTF-8\n"
|
11 |
"Content-Transfer-Encoding: 8bit\n"
|
12 |
+
"X-Generator: Poedit 1.5.5\n"
|
13 |
"X-Poedit-KeywordsList: __;_e\n"
|
14 |
"X-Poedit-Basepath: /Users/Jeroen/plugins/woocommerce-products-per-page/trunk/\n"
|
15 |
"Plural-Forms: nplurals=2; plural=n == 1 ? 0 : 1;\n"
|
58 |
|
59 |
#: /Users/Jeroen/plugins/woocommerce-products-per-page/trunk/admin/options-page.php:107
|
60 |
msgid "Seperated by spaces <em>(-1 for all products)</em>"
|
61 |
+
msgstr "Kommagetrennte Eingabe <em>(-1 für 'Alle Produkte anzeigen')</em>"
|
62 |
|
63 |
#: /Users/Jeroen/plugins/woocommerce-products-per-page/trunk/admin/options-page.php:118
|
64 |
msgid "-1 for all products"
|
80 |
#: /Users/Jeroen/plugins/woocommerce-products-per-page/trunk/objects/wppp-dropdown.php:50
|
81 |
msgid "All"
|
82 |
msgstr "Alle"
|
83 |
+
|
readme.txt
CHANGED
@@ -2,8 +2,8 @@
|
|
2 |
Contributors: sormano
|
3 |
Tags: woocommerce, products per page, woocommerce products, woocommerce products per page, products, per page
|
4 |
Requires at least: 4.0.0
|
5 |
-
Tested up to: 4.
|
6 |
-
Stable tag: 1.2.
|
7 |
License: GPLv3 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
9 |
|
@@ -69,6 +69,10 @@ Feel free to open a support thread if you need any further help. Please do note
|
|
69 |
|
70 |
== Changelog ==
|
71 |
|
|
|
|
|
|
|
|
|
72 |
= 1.2.3 - 23/10/2017 =
|
73 |
|
74 |
* [i18n] - Add Swedish translation
|
2 |
Contributors: sormano
|
3 |
Tags: woocommerce, products per page, woocommerce products, woocommerce products per page, products, per page
|
4 |
Requires at least: 4.0.0
|
5 |
+
Tested up to: 4.9
|
6 |
+
Stable tag: 1.2.4
|
7 |
License: GPLv3 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
9 |
|
69 |
|
70 |
== Changelog ==
|
71 |
|
72 |
+
= 1.2.4 - 07/11/2017 =
|
73 |
+
|
74 |
+
* [Fix] - Default 'list of dropdown options' setting is not properly set on the settings page.
|
75 |
+
|
76 |
= 1.2.3 - 23/10/2017 =
|
77 |
|
78 |
* [i18n] - Add Swedish translation
|
woocommerce-products-per-page.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Plugin Name: Woocommerce Products Per Page
|
4 |
* Plugin URI: https://wordpress.org/plugins/woocommerce-products-per-page/
|
5 |
* Description: Integrate a 'products per page' dropdown on your WooCommerce website! Set-up in <strong>seconds</strong>!
|
6 |
-
* Version: 1.2.
|
7 |
* Author: Jeroen Sormani
|
8 |
* Author URI: http://jeroensormani.com
|
9 |
|
@@ -47,7 +47,7 @@ class Woocommerce_Products_Per_Page {
|
|
47 |
* @since 1.2.0
|
48 |
* @var string $version Plugin version number.
|
49 |
*/
|
50 |
-
public $version = '1.2.
|
51 |
|
52 |
|
53 |
/**
|
@@ -177,9 +177,13 @@ class Woocommerce_Products_Per_Page {
|
|
177 |
|
178 |
// Updating to 1.2.0
|
179 |
if ( version_compare( get_option( 'wppp_version', '0' ), '1.2.0', '<' ) ) :
|
|
|
|
|
|
|
|
|
180 |
$settings = get_option( 'wppp_settings', array() );
|
181 |
update_option( 'wppp_dropdown_location', isset( $settings['location'] ) ? $settings['location'] : 'topbottom' );
|
182 |
-
update_option( 'wppp_dropdown_options', isset( $settings['productsPerPage'] ) ? $settings['productsPerPage'] :
|
183 |
update_option( 'wppp_default_ppp', isset( $settings['default_ppp'] ) ? $settings['default_ppp'] : '12' );
|
184 |
update_option( 'wppp_shop_columns', isset( $settings['shop_columns'] ) ? $settings['shop_columns'] : '4' );
|
185 |
update_option( 'wppp_return_to_first', isset( $settings['behaviour'] ) && '1' == $settings['behaviour'] ? 'yes' : 'no' );
|
3 |
* Plugin Name: Woocommerce Products Per Page
|
4 |
* Plugin URI: https://wordpress.org/plugins/woocommerce-products-per-page/
|
5 |
* Description: Integrate a 'products per page' dropdown on your WooCommerce website! Set-up in <strong>seconds</strong>!
|
6 |
+
* Version: 1.2.4
|
7 |
* Author: Jeroen Sormani
|
8 |
* Author URI: http://jeroensormani.com
|
9 |
|
47 |
* @since 1.2.0
|
48 |
* @var string $version Plugin version number.
|
49 |
*/
|
50 |
+
public $version = '1.2.4';
|
51 |
|
52 |
|
53 |
/**
|
177 |
|
178 |
// Updating to 1.2.0
|
179 |
if ( version_compare( get_option( 'wppp_version', '0' ), '1.2.0', '<' ) ) :
|
180 |
+
$dropdown_options_default =
|
181 |
+
( apply_filters( 'loop_shop_columns', 4 ) * 3 ) . ' ' .
|
182 |
+
( apply_filters( 'loop_shop_columns', 4 ) * 6 ) . ' ' .
|
183 |
+
( apply_filters( 'loop_shop_columns', 4 ) * 9 );
|
184 |
$settings = get_option( 'wppp_settings', array() );
|
185 |
update_option( 'wppp_dropdown_location', isset( $settings['location'] ) ? $settings['location'] : 'topbottom' );
|
186 |
+
update_option( 'wppp_dropdown_options', isset( $settings['productsPerPage'] ) ? $settings['productsPerPage'] : $dropdown_options_default );
|
187 |
update_option( 'wppp_default_ppp', isset( $settings['default_ppp'] ) ? $settings['default_ppp'] : '12' );
|
188 |
update_option( 'wppp_shop_columns', isset( $settings['shop_columns'] ) ? $settings['shop_columns'] : '4' );
|
189 |
update_option( 'wppp_return_to_first', isset( $settings['behaviour'] ) && '1' == $settings['behaviour'] ? 'yes' : 'no' );
|