WordPress.org

Plugin Directory

Changeset 1462580


Ignore:
Timestamp:
07/28/16 19:56:41 (13 months ago)
Author:
beka.rice
Message:

Tagging 2.5.0

Location:
woocommerce-extra-product-sorting-options/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • woocommerce-extra-product-sorting-options/trunk/i18n/languages/woocommerce-extra-product-sorting-options.pot

    r1427950 r1462580  
    33msgid "" 
    44msgstr "" 
    5 "Project-Id-Version: WooCommerce Extra Product Sorting Options 2.4.0\n" 
     5"Project-Id-Version: WooCommerce Extra Product Sorting Options 2.5.0\n" 
    66"Report-Msgid-Bugs-To: " 
    77"https://github.com/skyverge/woocommerce-extra-product-sorting-options/" 
     
    7676 
    7777#: build/woocommerce-extra-product-sorting-options.php:232 
    78 #: woocommerce-extra-product-sorting-options.php:232 
    7978msgid "" 
    8079"\"On-sale First\" shows <strong>simple</strong> products on sale first; <a " 
     
    8382 
    8483#: build/woocommerce-extra-product-sorting-options.php:237 
    85 #: woocommerce-extra-product-sorting-options.php:237 
     84#: woocommerce-extra-product-sorting-options.php:243 
    8685msgid "Name: A to Z" 
    8786msgstr "" 
    8887 
    8988#: build/woocommerce-extra-product-sorting-options.php:238 
    90 #: woocommerce-extra-product-sorting-options.php:238 
     89#: woocommerce-extra-product-sorting-options.php:244 
    9190msgid "Name: Z to A" 
    9291msgstr "" 
    9392 
    9493#: build/woocommerce-extra-product-sorting-options.php:239 
    95 #: woocommerce-extra-product-sorting-options.php:239 
     94#: woocommerce-extra-product-sorting-options.php:245 
    9695msgid "Available Stock" 
    9796msgstr "" 
    9897 
    9998#: build/woocommerce-extra-product-sorting-options.php:240 
    100 #: woocommerce-extra-product-sorting-options.php:240 
     99#: woocommerce-extra-product-sorting-options.php:246 
    101100msgid "Featured First" 
    102101msgstr "" 
    103102 
    104103#: build/woocommerce-extra-product-sorting-options.php:241 
    105 #: woocommerce-extra-product-sorting-options.php:241 
     104#: woocommerce-extra-product-sorting-options.php:247 
    106105msgid "On-sale First" 
    107106msgstr "" 
    108107 
    109108#: build/woocommerce-extra-product-sorting-options.php:242 
    110 #: woocommerce-extra-product-sorting-options.php:242 
    111109msgid "Random" 
    112110msgstr "" 
    113111 
    114112#: build/woocommerce-extra-product-sorting-options.php:277 
    115 #: woocommerce-extra-product-sorting-options.php:277 
     113#: woocommerce-extra-product-sorting-options.php:285 
    116114msgid "Sort by name: A to Z" 
    117115msgstr "" 
    118116 
    119117#: build/woocommerce-extra-product-sorting-options.php:281 
    120 #: woocommerce-extra-product-sorting-options.php:281 
     118#: woocommerce-extra-product-sorting-options.php:289 
    121119msgid "Sort by name: Z to A" 
    122120msgstr "" 
    123121 
    124122#: build/woocommerce-extra-product-sorting-options.php:285 
    125 #: woocommerce-extra-product-sorting-options.php:285 
     123#: woocommerce-extra-product-sorting-options.php:293 
    126124msgid "Sort by availability" 
    127125msgstr "" 
    128126 
    129127#: build/woocommerce-extra-product-sorting-options.php:289 
    130 #: woocommerce-extra-product-sorting-options.php:289 
     128#: woocommerce-extra-product-sorting-options.php:297 
    131129msgid "Show sale items first" 
    132130msgstr "" 
    133131 
    134132#: build/woocommerce-extra-product-sorting-options.php:293 
    135 #: woocommerce-extra-product-sorting-options.php:293 
     133#: woocommerce-extra-product-sorting-options.php:301 
    136134msgid "Show featured items first" 
    137135msgstr "" 
    138136 
    139137#: build/woocommerce-extra-product-sorting-options.php:297 
    140 #: woocommerce-extra-product-sorting-options.php:297 
    141138msgid "Sort by: random order" 
     139msgstr "" 
     140 
     141#: woocommerce-extra-product-sorting-options.php:233 
     142#. translators: Placeholders: %1$s - <strong>, %2$s - </strong>, %3$s - <a>, 
     143#. %4$s - </a> 
     144msgid "" 
     145"\"On-sale First\" shows %1$ssimple%2$s products on sale first; %3$ssee " 
     146"documentation%4$s for more details." 
     147msgstr "" 
     148 
     149#: woocommerce-extra-product-sorting-options.php:251 
     150msgid "Select sorting options to add to your shop." 
     151msgstr "" 
     152 
     153#: woocommerce-extra-product-sorting-options.php:455 
     154#. translators: Placeholders: %1$s - <strong>, %2$s - <strong>, %3$s - <a>, 
     155#. %4$s - </a> 
     156msgid "" 
     157"%1$sWooCommerce Extra Product Sorting Options settings have changed.%2$s " 
     158"Random sorting is now disabled. If you need to re-add this option, please " 
     159"%3$sview our plugin notes%4$s." 
    142160msgstr "" 
    143161 
  • woocommerce-extra-product-sorting-options/trunk/readme.txt

    r1427950 r1462580  
    44Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=paypal@skyverge.com&item_name=Donation+for+WooCommerce+Extra+Product+Sorting 
    55Requires at least: 4.0 
    6 Tested up to: 4.5.2 
     6Tested up to: 4.6.0 
    77Requires WooCommerce at least: 2.3 
    88Tested WooCommerce up to: 2.6 
    9 Stable Tag: 2.4.0 
     9Stable Tag: 2.5.0 
    1010License: GPLv3 
    1111License URI: http://www.gnu.org/licenses/gpl-3.0.html 
    1212 
    13 Rename the default product sorting option and add up to 6 new sorting options including alphabetical and on-sale sorting. 
     13Rename the default product sorting option and add up to 5 new sorting options including alphabetical and on-sale sorting. 
    1414 
    1515== Description == 
    1616 
    17 WooCommerce Extra Product Sorting Options provides options that extend the default WooCommerce orderby options on the shop page. You can optionally set a new name for the default sorting (helpful if you've used this to create a custom sorting order), and can enable up to **6 new sorting options**: alphabetical, reverse alphabetical, on sale, featured, availability, and random product sorting. 
     17WooCommerce Extra Product Sorting Options provides options that extend the default WooCommerce orderby options on the shop page. You can optionally set a new name for the default sorting (helpful if you've used this to create a custom sorting order), and can enable up to **5 new sorting options**: alphabetical, reverse alphabetical, on sale, featured, and availability product sorting. 
    1818 
    1919> **Requires: WooCommerce 2.3+ and WordPress 4.0+** 
     
    2828 - enable on sale sorting (**note**: works only for simple products) 
    2929 - enable sorting by inventory / availability 
    30  - enable randomized product sorting (works well for single-page catalogs) 
    3130 
    3231= Rename Default Sorting = 
    33 You can customize your product sorting order on your shop pages - [here's a handy tutorial](http://www.sellwithwp.com/create-woocommerce-custom-product-sorting/) to do so. However, many shop admins like to then rename this from "Default Sorting" to something more descriptive, such as "Our Sorting" or "Our Selection". You can optionally enter a new name for this sorting order if desired. 
     32You can customize your product sorting order on your shop pages by clicking "Sort Products" or manually changin the "menu order" value. However, many shop admins like to then rename this from "Default Sorting" to something more descriptive, such as "Our Sorting" or "Our Selection". You can optionally enter a new name for this sorting order if desired. 
    3433 
    3534= Adding Sorting Options = 
     
    3938 
    4039You can add the option to sort items by sale status - there's a sorting option to show "On Sale" items first in the shop catalog. Please note that only simple products can be sorted by sale status, and variable products will display mixed with non-sale products. 
    41  
    42 Finally, you can add a "randomized" sorting option just for fun - any time this sorting is selected, the product order will be randomized when the shop page is viewed. This works best when all products are shown on one page, as paged product catalogs will be "re-randomized" with each page change. 
    4340 
    4441= Looking to remove sorting options? = 
     
    7370 
    7471= Why doesn't sorting by availability work? = 
    75 Don't worry, it does :). It's possible to sort by stock, but this will work for parent products rather than using the stock available at the variation level. You can set this under Product Data &gt; Inventory by enabling "Manage stock". Set the available stock for _all_ variations, and this will be used to sort the item. You can still manage stock at the variation level. 
     72Don't worry, it does :) It's possible to sort by stock, but this will work for parent products rather than using the stock available at the variation level. You can set this under Product Data &gt; Inventory by enabling "Manage stock". Set the available stock for _all_ variations, and this will be used to sort the item. You can still manage stock at the variation level. 
    7673 
    7774If you don't manage your stock, you should **disable** this option - it will simply work as an alphabetical sort if all products are just "In Stock" without inventory managed. 
     
    8178 
    8279We don't anticipate changing this in the foreseeable future, as we've spent a couple hours trying to get the custom search query to work, but WooCommerce core adds search parameters that conflict with it, and we haven't found a suitable work-around. 
    83  
    84 = When I view other pages of my shop while using random sorting, some products are repeated. Why does this happen? = 
    85  
    86 WordPress will get a new random set of products for each page in your shop, so random sorting works best when you have a small number of products and they're all displayed on one page. 
    87  
    88 In order to "remember" which products have already been displayed, you'd need [some custom code](http://wordpress.stackexchange.com/questions/31647/is-it-possible-to-paginate-posts-correctly-that-are-random-ordered) to store these products in a session, which is not something we support. 
    8980 
    9081= This is handy! Can I contribute? = 
     
    96873. Change sorting label (in shop dropdown) with the [Say What plugin](https://wordpress.org/plugins/say-what/) 
    9788 
     89== Other Notes == 
     90 
     91= Translations = 
     92 
     93**The plugin text domain is**: `woocommerce-extra-product-sorting-options` 
     94 
     95= This plugin used to have random sorting, I need it back! = 
     96 
     97We removed randomized product sorting because it wasn't 100% functional for many shops (as it required all products to be on one page), and thus is better served as custom code snippet instead of being part of this plugin. 
     98 
     99**Why didn't it work?** WordPress will get a new random set of products for each page in your shop, so random sorting only works at 100% when you have a small number of products and they're all displayed on one page. In order to "remember" which products have already been displayed, you'd need [some custom code](http://wordpress.stackexchange.com/questions/31647/is-it-possible-to-paginate-posts-correctly-that-are-random-ordered) to store these products in a session, which is not something we ever planned to support as it isn't possible with the structure of this plugin. 
     100 
     101Since this feature wasn't at 100%, we have removed it and turned it into a code snippet. If you need to re-add randomized sorting, please [use this code snippet](https://gist.github.com/bekarice/bac8b67064001ebc3bc2475424d99f87), ensuring that you [know how to add code to your site](http://skyverge.com/blog/add-custom-code-to-wordpress/). 
     102 
    98103== Changelog == 
     104 
     105= 2016.07.28 - version 2.5.0 = 
     106 * Misc: removed 'randomized' sorting due to issues with larger catalogs ([see notes](http://wordpress.org/plugins/woocommerce-extra-product-sorting-options/other_notes/) for further details) 
    99107 
    100108= 2016.05.31 - version 2.4.0 = 
  • woocommerce-extra-product-sorting-options/trunk/woocommerce-extra-product-sorting-options.php

    r1427950 r1462580  
    66 * Author: SkyVerge 
    77 * Author URI: http://www.skyverge.com/ 
    8  * Version: 2.4.0 
     8 * Version: 2.5.0 
    99 * Text Domain: woocommerce-extra-product-sorting-options 
    1010 * 
     
    5656 
    5757 
    58     const VERSION = '2.4.0'; 
     58    const VERSION = '2.5.0'; 
    5959 
    6060 
     
    189189 
    190190        $message = sprintf( 
    191         /* translators: %1$s and %2$s are <strong> tags. %3$s and %4$s are <a> tags */ 
     191            /* translators: %1$s and %2$s are <strong> tags. %3$s and %4$s are <a> tags */ 
    192192            esc_html__( '%1$sWooCommerce Extra Product Sorting Options is inactive.%2$s This plugin requires WooCommerce 2.3 or newer. Please %3$supdate WooCommerce to version 2.3 or newer%4$s', 'woocommerce-extra-product-sorting-options' ), 
    193193            '<strong>', 
     
    228228                    ), 
    229229                    array( 
    230                         'name'     => __( 'Add Product Sorting:', 'woocommerce-extra-product-sorting-options' ), 
    231                         'desc_tip' => __( 'Select sorting options to add to your shop. "Available Stock" sorts products with the most stock first.', 'woocommerce-extra-product-sorting-options' ), 
    232                         'desc'     => '<br/>' . sprintf( __( '"On-sale First" shows <strong>simple</strong> products on sale first; <a href="%s" target="_blank">see documentation</a> for more details.', 'woocommerce-extra-product-sorting-options' ), 'https://wordpress.org/plugins/woocommerce-extra-product-sorting-options/faq/' ), 
    233                         'id'       => 'wc_extra_product_sorting_options', 
    234                         'type'     => 'multiselect', 
    235                         'class'    => 'chosen_select', 
    236                         'options'  => array( 
     230                        'name'              => __( 'Add Product Sorting:', 'woocommerce-extra-product-sorting-options' ), 
     231                        'desc_tip'          => __( 'Select sorting options to add to your shop. "Available Stock" sorts products with the most stock first.', 'woocommerce-extra-product-sorting-options' ), 
     232                        /* translators: Placeholders: %1$s - <strong>, %2$s - </strong>, %3$s - <a>, %4$s - </a> */ 
     233                        'desc'              => sprintf( __( '"On-sale First" shows %1$ssimple%2$s products on sale first; %3$ssee documentation%4$s for more details.', 'woocommerce-extra-product-sorting-options' ), 
     234                                '<strong>', 
     235                                '</strong>', 
     236                                '<a href="http://wordpress.org/plugins/woocommerce-extra-product-sorting-options/faq/" target="_blank">', 
     237                                '</a>' 
     238                            ), 
     239                        'id'                => 'wc_extra_product_sorting_options', 
     240                        'type'              => 'multiselect', 
     241                        'class'             => 'chosen_select', 
     242                        'options'           => array( 
    237243                            'alphabetical'   => __( 'Name: A to Z', 'woocommerce-extra-product-sorting-options' ), 
    238244                            'reverse_alpha'  => __( 'Name: Z to A', 'woocommerce-extra-product-sorting-options' ), 
    239                             'by_stock'       => __( 'Available Stock', 'woocommerce-extra-product-sorting-options' ), 
     245                            'by_stock'       => __( 'Available Stock', 'woocommerce-extra-product-sorting-options' ), 
    240246                            'featured_first' => __( 'Featured First', 'woocommerce-extra-product-sorting-options' ), 
    241247                            'on_sale_first'  => __( 'On-sale First', 'woocommerce-extra-product-sorting-options' ), 
    242                             'randomize'      => __( 'Random', 'woocommerce-extra-product-sorting-options' ), 
    243248                        ), 
    244                         'default'  => '', 
     249                        'default'           => '', 
     250                        'custom_attributes' => array( 
     251                            'data-placeholder' => __( 'Select sorting options to add to your shop.', 'woocommerce-extra-product-sorting-options' ), 
     252                        ), 
    245253                    ), 
    246254                ); 
     
    272280        foreach( $new_sorting_options as $option ) { 
    273281 
    274             switch( $option ) { 
     282            switch ( $option ) { 
    275283 
    276284                case 'alphabetical': 
    277                     $sortby['alphabetical'] = __( 'Sort by name: A to Z', 'woocommerce-extra-product-sorting-options' ); 
    278                     break; 
     285                    $sortby['alphabetical']   = __( 'Sort by name: A to Z', 'woocommerce-extra-product-sorting-options' ); 
     286                break; 
    279287 
    280288                case 'reverse_alpha': 
    281                     $sortby['reverse_alpha'] = __( 'Sort by name: Z to A', 'woocommerce-extra-product-sorting-options' ); 
    282                     break; 
     289                    $sortby['reverse_alpha']  = __( 'Sort by name: Z to A', 'woocommerce-extra-product-sorting-options' ); 
     290                break; 
    283291 
    284292                case 'by_stock': 
    285                     $sortby['by_stock'] = __( 'Sort by availability', 'woocommerce-extra-product-sorting-options' ); 
    286                     break; 
     293                    $sortby['by_stock']       = __( 'Sort by availability', 'woocommerce-extra-product-sorting-options' ); 
     294                break; 
    287295 
    288296                case 'on_sale_first': 
    289                     $sortby['on_sale_first'] = __( 'Show sale items first', 'woocommerce-extra-product-sorting-options' ); 
    290                     break; 
     297                    $sortby['on_sale_first']  = __( 'Show sale items first', 'woocommerce-extra-product-sorting-options' ); 
     298                break; 
    291299 
    292300                case 'featured_first': 
    293301                    $sortby['featured_first'] = __( 'Show featured items first', 'woocommerce-extra-product-sorting-options' ); 
    294                     break; 
    295  
    296                 case 'randomize': 
    297                     $sortby['rand'] = __( 'Sort by: random order', 'woocommerce-extra-product-sorting-options' ); 
    298                     break; 
     302                break; 
    299303 
    300304            } 
    301  
    302305        } 
    303306 
     
    328331        } 
    329332 
    330         $fallback = apply_filters( 'wc_extra_sorting_options_fallback', 'title', $orderby_value ); 
     333        $fallback       = apply_filters( 'wc_extra_sorting_options_fallback', 'title', $orderby_value ); 
    331334        $fallback_order = apply_filters( 'wc_extra_sorting_options_fallback_order', 'ASC', $orderby_value ); 
    332335 
     
    335338            case 'alphabetical': 
    336339                $sort_args['orderby'] = 'title'; 
    337                 $sort_args['order'] = 'asc'; 
    338                 break; 
     340                $sort_args['order']   = 'asc'; 
     341            break; 
    339342 
    340343            case 'reverse_alpha': 
     
    342345                $sort_args['order']    = 'desc'; 
    343346                $sort_args['meta_key'] = ''; 
    344                 break; 
     347            break; 
    345348 
    346349            case 'by_stock': 
    347                 $sort_args['orderby'] = array( 'meta_value_num' => 'DESC', $fallback => $fallback_order ); 
     350                $sort_args['orderby']  = array( 'meta_value_num' => 'DESC', $fallback => $fallback_order ); 
    348351                $sort_args['meta_key'] = '_stock'; 
    349                 break; 
     352            break; 
    350353 
    351354 
    352355            case 'on_sale_first': 
    353                 $sort_args['orderby'] = array( 'meta_value_num' => 'DESC', $fallback => $fallback_order ); 
     356                $sort_args['orderby']  = array( 'meta_value_num' => 'DESC', $fallback => $fallback_order ); 
    354357                $sort_args['meta_key'] = '_sale_price'; 
    355                 break; 
     358            break; 
    356359 
    357360            case 'featured_first': 
    358                 $sort_args['orderby'] = array( 'meta_value' => 'DESC', $fallback => $fallback_order ); 
     361                $sort_args['orderby']  = array( 'meta_value' => 'DESC', $fallback => $fallback_order ); 
    359362                $sort_args['meta_key'] = '_featured'; 
    360                 break; 
     363            break; 
    361364 
    362365        } 
     
    404407 
    405408            $old_options = array( 
    406                 'wc_alphabetical_product_sorting' => 'alphabetical', 
     409                'wc_alphabetical_product_sorting'         => 'alphabetical', 
    407410                'wc_reverse_alphabetical_product_sorting' => 'reverse_alpha', 
    408                 'wc_on_sale_product_sorting' => 'on_sale_first', 
    409                 'wc_random_product_sorting' => 'randomize', 
     411                'wc_on_sale_product_sorting'              => 'on_sale_first', 
     412                'wc_random_product_sorting'               => 'randomize', 
    410413            ); 
    411414 
     
    423426        } 
    424427 
     428        // remove random sorting if it was set 
     429        if ( version_compare( $installed_version, '2.5.0', '<' ) ) { 
     430 
     431            $settings = get_option( 'wc_extra_product_sorting_options' ); 
     432 
     433            if ( in_array( 'randomize', $settings, true ) ) { 
     434 
     435                unset( $settings['randomize'] ); 
     436                update_option( 'wc_extra_product_sorting_options', $settings ); 
     437 
     438                add_action( 'admin_notices', array( $this, 'render_2_5_upgrade_notice' ) ); 
     439            } 
     440        } 
     441 
    425442        // update the installed version option 
    426443        update_option( 'wc_extra_sorting_options_version', self::VERSION ); 
     444    } 
     445 
     446 
     447    /** 
     448     * Renders a notice when upgrading to v2.5 if random sorting was enabled 
     449     *  as this was removed from the plugin 
     450     */ 
     451    public function render_2_5_upgrade_notice() { 
     452 
     453        $message = sprintf( 
     454            /* translators: Placeholders: %1$s - <strong>, %2$s - <strong>, %3$s - <a>, %4$s - </a> */ 
     455            esc_html__( '%1$sWooCommerce Extra Product Sorting Options 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' ), 
     456            '<strong>', 
     457            '</strong>', 
     458            '<a href="http://wordpress.org/plugins/woocommerce-extra-product-sorting-options/other_notes/" target="_blank">', 
     459            '&nbsp;&raquo;</a>' 
     460        ); 
     461 
     462        printf( '<div class="notice notice-warning is-dismissible"><p>%s</p></div>', $message ); 
    427463    } 
    428464 
Note: See TracChangeset for help on using the changeset viewer.