WordPress.org

Plugin Directory

Changeset 1751256


Ignore:
Timestamp:
10/23/17 15:09:53 (4 weeks ago)
Author:
sormano
Message:

WPPP 1.2.3

Location:
woocommerce-products-per-page
Files:
6 added
1 deleted
7 edited
11 copied

Legend:

Unmodified
Added
Removed
  • woocommerce-products-per-page/tags/1.2.3/includes/class-wppp-front-end.php

    r1314907 r1751256  
    3333 
    3434        // Add filter for product columns 
    35         add_filter( 'loop_shop_columns', array( $this, 'loop_shop_columns' ) ); 
     35        add_filter( 'loop_shop_columns', array( $this, 'loop_shop_columns' ), 100 ); 
    3636 
    3737        // Custom number of products per page 
    38         add_filter( 'loop_shop_per_page', array( $this, 'loop_shop_per_page' ) ); 
     38        add_filter( 'loop_shop_per_page', array( $this, 'loop_shop_per_page' ), 100 ); 
    3939 
    4040        // Get the right amount of products from the DB 
    4141        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 ); 
    4542 
    4643        // Check if ppp form is fired 
     
    164161        elseif ( isset( $_REQUEST['ppp'] ) ) : 
    165162            return intval( $_REQUEST['ppp'] ); 
    166         elseif ( WC()->session->__isset( 'products_per_page' ) ) : 
    167             return intval( WC()->session->__get( 'products_per_page' ) ); 
     163        elseif ( isset( $_COOKIE['woocommerce_products_per_page'] ) ) : 
     164            return $_COOKIE['woocommerce_products_per_page']; 
    168165        else : 
    169166            return intval( get_option( 'wppp_default_ppp', '12' ) ); 
     
    194191 
    195192    /** 
    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     /** 
    212193     * PPP action. 
    213194     * 
     
    220201 
    221202        if ( isset( $_REQUEST['wppp_ppp'] ) ) : 
    222             WC()->session->set( 'products_per_page', intval( $_REQUEST['wppp_ppp'] ) ); 
     203            wc_setcookie( 'woocommerce_products_per_page', intval( $_REQUEST['wppp_ppp'] ), time() + DAY_IN_SECONDS * 2, apply_filters( 'wc_session_use_secure_cookie', false ) ); 
    223204        elseif ( isset( $_REQUEST['ppp'] ) ) : 
    224             WC()->session->set( 'products_per_page', intval( $_REQUEST['ppp'] ) ); 
     205            wc_setcookie( 'woocommerce_products_per_page', intval( $_REQUEST['ppp'] ), time() + DAY_IN_SECONDS * 2, apply_filters( 'wc_session_use_secure_cookie', false ) ); 
    225206        endif; 
    226207 
  • woocommerce-products-per-page/tags/1.2.3/languages/woocommerce-products-per-page-de_DE.po

    r1070323 r1751256  
    66"Last-Translator: Michael Firnkes <info@blogprofis.de>\n" 
    77"Language-Team: Jeroen Sormani <jeroen.sormani@gmail.com>\n" 
    8 "Language: French\n" 
     8"Language: fr\n" 
    99"MIME-Version: 1.0\n" 
    1010"Content-Type: text/plain; charset=UTF-8\n" 
    1111"Content-Transfer-Encoding: 8bit\n" 
    12 "X-Generator: Poedit 1.5.5\n" 
     12"X-Generator: Poedit 1.7.1\n" 
    1313"X-Poedit-KeywordsList: __;_e\n" 
    1414"X-Poedit-Basepath: /Users/Jeroen/plugins/woocommerce-products-per-page/trunk/\n" 
     
    5959#: /Users/Jeroen/plugins/woocommerce-products-per-page/trunk/admin/options-page.php:107 
    6060msgid "Seperated by spaces <em>(-1 for all products)</em>" 
    61 msgstr "Kommagetrennte Eingabe <em>(-1 für 'Alle Produkte anzeigen')</em>" 
     61msgstr "Mit Leerzeichen trennen <em>(-1 für alle Produkte)</em>" 
    6262 
    6363#: /Users/Jeroen/plugins/woocommerce-products-per-page/trunk/admin/options-page.php:118 
     
    8181msgid "All" 
    8282msgstr "Alle" 
    83  
  • woocommerce-products-per-page/tags/1.2.3/readme.txt

    r1636930 r1751256  
    33Tags: woocommerce, products per page, woocommerce products, woocommerce products per page, products, per page 
    44Requires at least: 4.0.0 
    5 Tested up to: 4.7.3 
    6 Stable tag: 1.2.2 
     5Tested up to: 4.8.2 
     6Stable tag: 1.2.3 
    77License: GPLv3 or later 
    88License URI: http://www.gnu.org/licenses/gpl-3.0.html 
     
    3838- Russian 
    3939- Hebrew 
     40- Swedish 
     41- Romanian 
    4042 
    4143== Installation == 
     
    6769 
    6870== Changelog == 
     71 
     72= 1.2.3 - 23/10/2017 = 
     73 
     74* [i18n] - Add Swedish translation 
     75* [i18n] - Add Romanian translation 
     76* [Fix] - Persistent cart snag where cart data gets deleted when logging out/back in 
    6977 
    7078= 1.2.2 - 23/12/2015 = 
  • woocommerce-products-per-page/tags/1.2.3/woocommerce-products-per-page.php

    r1314908 r1751256  
    44 * Plugin URI: https://wordpress.org/plugins/woocommerce-products-per-page/ 
    55 * Description: Integrate a 'products per page' dropdown on your WooCommerce website! Set-up in <strong>seconds</strong>! 
    6  * Version: 1.2.2 
     6 * Version: 1.2.3 
    77 * Author: Jeroen Sormani 
    88 * Author URI: http://jeroensormani.com 
     
    4848     * @var string $version Plugin version number. 
    4949     */ 
    50     public $version = '1.2.2'; 
     50    public $version = '1.2.3'; 
    5151 
    5252 
     
    120120            $this->admin_settings = new WPPP_Admin_Settings(); 
    121121 
    122         else : 
     122        endif; 
     123 
     124        if ( ! is_admin() || ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) : 
    123125 
    124126            /** 
  • woocommerce-products-per-page/trunk/includes/class-wppp-front-end.php

    r1314907 r1751256  
    3333 
    3434        // Add filter for product columns 
    35         add_filter( 'loop_shop_columns', array( $this, 'loop_shop_columns' ) ); 
     35        add_filter( 'loop_shop_columns', array( $this, 'loop_shop_columns' ), 100 ); 
    3636 
    3737        // Custom number of products per page 
    38         add_filter( 'loop_shop_per_page', array( $this, 'loop_shop_per_page' ) ); 
     38        add_filter( 'loop_shop_per_page', array( $this, 'loop_shop_per_page' ), 100 ); 
    3939 
    4040        // Get the right amount of products from the DB 
    4141        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 ); 
    4542 
    4643        // Check if ppp form is fired 
     
    164161        elseif ( isset( $_REQUEST['ppp'] ) ) : 
    165162            return intval( $_REQUEST['ppp'] ); 
    166         elseif ( WC()->session->__isset( 'products_per_page' ) ) : 
    167             return intval( WC()->session->__get( 'products_per_page' ) ); 
     163        elseif ( isset( $_COOKIE['woocommerce_products_per_page'] ) ) : 
     164            return $_COOKIE['woocommerce_products_per_page']; 
    168165        else : 
    169166            return intval( get_option( 'wppp_default_ppp', '12' ) ); 
     
    194191 
    195192    /** 
    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     /** 
    212193     * PPP action. 
    213194     * 
     
    220201 
    221202        if ( isset( $_REQUEST['wppp_ppp'] ) ) : 
    222             WC()->session->set( 'products_per_page', intval( $_REQUEST['wppp_ppp'] ) ); 
     203            wc_setcookie( 'woocommerce_products_per_page', intval( $_REQUEST['wppp_ppp'] ), time() + DAY_IN_SECONDS * 2, apply_filters( 'wc_session_use_secure_cookie', false ) ); 
    223204        elseif ( isset( $_REQUEST['ppp'] ) ) : 
    224             WC()->session->set( 'products_per_page', intval( $_REQUEST['ppp'] ) ); 
     205            wc_setcookie( 'woocommerce_products_per_page', intval( $_REQUEST['ppp'] ), time() + DAY_IN_SECONDS * 2, apply_filters( 'wc_session_use_secure_cookie', false ) ); 
    225206        endif; 
    226207 
  • woocommerce-products-per-page/trunk/languages/woocommerce-products-per-page-de_DE.po

    r1070323 r1751256  
    66"Last-Translator: Michael Firnkes <info@blogprofis.de>\n" 
    77"Language-Team: Jeroen Sormani <jeroen.sormani@gmail.com>\n" 
    8 "Language: French\n" 
     8"Language: fr\n" 
    99"MIME-Version: 1.0\n" 
    1010"Content-Type: text/plain; charset=UTF-8\n" 
    1111"Content-Transfer-Encoding: 8bit\n" 
    12 "X-Generator: Poedit 1.5.5\n" 
     12"X-Generator: Poedit 1.7.1\n" 
    1313"X-Poedit-KeywordsList: __;_e\n" 
    1414"X-Poedit-Basepath: /Users/Jeroen/plugins/woocommerce-products-per-page/trunk/\n" 
     
    5959#: /Users/Jeroen/plugins/woocommerce-products-per-page/trunk/admin/options-page.php:107 
    6060msgid "Seperated by spaces <em>(-1 for all products)</em>" 
    61 msgstr "Kommagetrennte Eingabe <em>(-1 für 'Alle Produkte anzeigen')</em>" 
     61msgstr "Mit Leerzeichen trennen <em>(-1 für alle Produkte)</em>" 
    6262 
    6363#: /Users/Jeroen/plugins/woocommerce-products-per-page/trunk/admin/options-page.php:118 
     
    8181msgid "All" 
    8282msgstr "Alle" 
    83  
  • woocommerce-products-per-page/trunk/readme.txt

    r1636930 r1751256  
    33Tags: woocommerce, products per page, woocommerce products, woocommerce products per page, products, per page 
    44Requires at least: 4.0.0 
    5 Tested up to: 4.7.3 
    6 Stable tag: 1.2.2 
     5Tested up to: 4.8.2 
     6Stable tag: 1.2.3 
    77License: GPLv3 or later 
    88License URI: http://www.gnu.org/licenses/gpl-3.0.html 
     
    3838- Russian 
    3939- Hebrew 
     40- Swedish 
     41- Romanian 
    4042 
    4143== Installation == 
     
    6769 
    6870== Changelog == 
     71 
     72= 1.2.3 - 23/10/2017 = 
     73 
     74* [i18n] - Add Swedish translation 
     75* [i18n] - Add Romanian translation 
     76* [Fix] - Persistent cart snag where cart data gets deleted when logging out/back in 
    6977 
    7078= 1.2.2 - 23/12/2015 = 
  • woocommerce-products-per-page/trunk/woocommerce-products-per-page.php

    r1314908 r1751256  
    44 * Plugin URI: https://wordpress.org/plugins/woocommerce-products-per-page/ 
    55 * Description: Integrate a 'products per page' dropdown on your WooCommerce website! Set-up in <strong>seconds</strong>! 
    6  * Version: 1.2.2 
     6 * Version: 1.2.3 
    77 * Author: Jeroen Sormani 
    88 * Author URI: http://jeroensormani.com 
     
    4848     * @var string $version Plugin version number. 
    4949     */ 
    50     public $version = '1.2.2'; 
     50    public $version = '1.2.3'; 
    5151 
    5252 
     
    120120            $this->admin_settings = new WPPP_Admin_Settings(); 
    121121 
    122         else : 
     122        endif; 
     123 
     124        if ( ! is_admin() || ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) : 
    123125 
    124126            /** 
Note: See TracChangeset for help on using the changeset viewer.