Plugin Directory

Changeset 3309769


Ignore:
Timestamp:
06/11/2025 11:39:34 AM (10 months ago)
Author:
SkyVerge
Message:

Committing 1.11.2 to trunk

Location:
woocommerce-sequential-order-numbers/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • woocommerce-sequential-order-numbers/trunk/i18n/languages/woocommerce-sequential-order-numbers.pot

    r3289095 r3309769  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: Sequential Order Numbers for WooCommerce 1.11.1\n"
     5"Project-Id-Version: Sequential Order Numbers for WooCommerce 1.11.2\n"
    66"Report-Msgid-Bugs-To: https://woocommerce.com/my-account/marketplace-ticket-form/\n"
    77"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
     
    1010"Content-Type: text/plain; charset=UTF-8\n"
    1111"Content-Transfer-Encoding: 8bit\n"
    12 "POT-Creation-Date: 2025-05-07T11:38:00+00:00\n"
     12"POT-Creation-Date: 2025-06-11T11:38:58+00:00\n"
    1313"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    1414"X-Generator: WP-CLI 2.11.0\n"
     
    5050msgstr ""
    5151
    52 #: woocommerce-sequential-order-numbers.php:537
     52#: woocommerce-sequential-order-numbers.php:484
     53msgid "Sequential Order Number"
     54msgstr ""
     55
     56#: woocommerce-sequential-order-numbers.php:561
    5357msgid "Allows filtering of orders by custom order number. Example: /wp-json/wc/v3/orders/?number=240222-45"
    5458msgstr ""
    5559
    5660#. translators: Placeholders: %1$s - plugin name; %2$s - WooCommerce version; %3$s, %5$s - <a> tags; %4$s - </a> tag
    57 #: woocommerce-sequential-order-numbers.php:779
     61#: woocommerce-sequential-order-numbers.php:803
    5862msgid "%1$s is inactive because it requires WooCommerce %2$s or newer. Please %3$supdate WooCommerce%4$s or run the %5$sWooCommerce database upgrade%4$s."
    5963msgstr ""
    6064
    61 #: woocommerce-sequential-order-numbers.php:831
     65#: woocommerce-sequential-order-numbers.php:855
    6266msgid "Error activating and installing <strong>Sequential Order Numbers for WooCommerce</strong>: %s"
    6367msgstr ""
    6468
    65 #: woocommerce-sequential-order-numbers.php:833
     69#: woocommerce-sequential-order-numbers.php:857
    6670msgid "&laquo; Go Back"
    6771msgstr ""
  • woocommerce-sequential-order-numbers/trunk/readme.txt

    r3289095 r3309769  
    105105== Changelog ==
    106106
     107= 2025.06.11 - version 1.11.2 =
     108 * Tweak - Add new "Sequential Order Number" option to the search order dropdown
     109 * Fix - Searching by order number not working when Full Text Search is enabled (previous fix did not take full effect)
     110
    107111= 2025.05.07 - version 1.11.1 =
    108112 * Fix - Searching by order number not working when Full Text Search is enabled
  • woocommerce-sequential-order-numbers/trunk/woocommerce-sequential-order-numbers.php

    r3289095 r3309769  
    66 * Author: SkyVerge
    77 * Author URI: http://www.skyverge.com
    8  * Version: 1.11.1
     8 * Version: 1.11.2
    99 * Text Domain: woocommerce-sequential-order-numbers
    1010 * Domain Path: /i18n/languages/
    1111 *
    12  * Copyright: (c) 2012-2023, SkyVerge, Inc. (info@skyverge.com)
     12 * Copyright: (c) 2012-2025, SkyVerge, Inc. (info@skyverge.com)
    1313 *
    1414 * License: GNU General Public License v3.0
     
    1616 *
    1717 * @author    SkyVerge
    18  * @copyright Copyright (c) 2012-2023, SkyVerge, Inc. (info@skyverge.com)
     18 * @copyright Copyright (c) 2012-2025, SkyVerge, Inc. (info@skyverge.com)
    1919 * @license   http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
    2020 *
    2121 * WC requires at least: 3.9.4
    22  * WC tested up to: 9.8.4
     22 * WC tested up to: 9.9.3
    2323 */
    2424
     
    3939
    4040    /** Version number */
    41     public const VERSION = '1.11.1';
     41    public const VERSION = '1.11.2';
    4242
    4343    /** Minimum required wc version */
     
    208208
    209209            // ensure that admin order table search by order number works
     210            add_filter('woocommerce_hpos_admin_search_filters', [$this, 'addOrderNumberSearchFilter']);
    210211            add_filter( 'woocommerce_shop_order_search_fields', [ $this, 'custom_search_fields' ] );
    211212            add_filter( 'woocommerce_order_table_search_query_meta_keys', [ $this, 'custom_search_fields' ] );
     
    465466    }
    466467
     468    /**
     469     * Adds a new search filter option for the sequential order number.
     470     *
     471     * @internal
     472     * @since 1.11.2
     473     *
     474     * @param array|mixed $options search options
     475     * @return array|mixed
     476     */
     477    public function addOrderNumberSearchFilter($options)
     478    {
     479        if (! is_array($options)) {
     480            return $options;   
     481        }
     482
     483        // Insert sequential_order_number after order_id
     484        $newOption = ['sequential_order_number' => __('Sequential Order Number', 'woocommerce-sequential-order-numbers')];
     485        $orderIdPosition = array_search('order_id', array_keys($options));
     486        if ($orderIdPosition !== false) {
     487            $insertPosition = $orderIdPosition + 1;
     488            $options = array_slice($options, 0, $insertPosition, true) +
     489                        $newOption +
     490                        array_slice($options, $insertPosition, null, true);
     491        } else {
     492            $options = array_merge($options, $newOption);
     493        }
     494
     495        return $options;
     496    }
     497
    467498
    468499    /**
     
    482513
    483514    /**
    484      * When Full Text Search is enabled, {@see \Automattic\WooCommerce\Internal\DataStores\Orders\OrdersTableSearchQuery::generate_where_for_meta_table()}
    485      * doesn't run, which means our order ID meta field doesn't get searched. This method is responsible for reproducing that
    486      * method specifically when FTS is enabled.
     515     * Generates a WHERE clause for the sequential order number search filter.
    487516     *
    488517     * @param string|mixed $whereClause
     
    494523    public function fullTextSearchFilterWhereClause($whereClause, $searchTerm, $searchFilter, $query)
    495524    {
     525        if ($searchFilter !== 'sequential_order_number') {
     526            return $whereClause;
     527        }
     528
    496529        try {
    497             $ftsIsEnabled = get_option(CustomOrdersTableController::HPOS_FTS_INDEX_OPTION) === 'yes' && get_option(CustomOrdersTableController::HPOS_FTS_ORDER_ITEM_INDEX_CREATED_OPTION) === 'yes';
    498             if (! $ftsIsEnabled) {
    499                 return $whereClause;
    500             }
    501 
    502             if ($searchFilter !== 'order_id') {
    503                 return $whereClause;
    504             }
    505 
    506530            global $wpdb;
    507531            $order_table = $query->get_table_name('orders');
Note: See TracChangeset for help on using the changeset viewer.