Plugin Directory

Changeset 3289095


Ignore:
Timestamp:
05/07/2025 11:38:40 AM (11 months ago)
Author:
SkyVerge
Message:

Committing 1.11.1 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

    r3182923 r3289095  
    1 # Copyright (C) 2024 SkyVerge
     1# Copyright (C) 2025 SkyVerge
    22# This file is distributed under the GNU General Public License v3.0.
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: Sequential Order Numbers for WooCommerce 1.11.0\n"
     5"Project-Id-Version: Sequential Order Numbers for WooCommerce 1.11.1\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: 2024-11-06T07:50:23+00:00\n"
     12"POT-Creation-Date: 2025-05-07T11:38:00+00:00\n"
    1313"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    14 "X-Generator: WP-CLI 2.6.0\n"
     14"X-Generator: WP-CLI 2.11.0\n"
    1515"X-Domain: woocommerce-sequential-order-numbers\n"
    1616
    1717#. Plugin Name of the plugin
     18#: woocommerce-sequential-order-numbers.php
    1819msgid "Sequential Order Numbers for WooCommerce"
    1920msgstr ""
    2021
    2122#. Plugin URI of the plugin
     23#: woocommerce-sequential-order-numbers.php
    2224msgid "http://www.skyverge.com/blog/woocommerce-sequential-order-numbers/"
    2325msgstr ""
    2426
    2527#. Description of the plugin
     28#: woocommerce-sequential-order-numbers.php
    2629msgid "Provides sequential order numbers for WooCommerce orders"
    2730msgstr ""
    2831
    2932#. Author of the plugin
     33#: woocommerce-sequential-order-numbers.php
    3034msgid "SkyVerge"
    3135msgstr ""
    3236
    3337#. Author URI of the plugin
     38#: woocommerce-sequential-order-numbers.php
    3439msgid "http://www.skyverge.com"
    3540msgstr ""
    3641
    3742#. translators: Placeholders: %s - plugin name
    38 #: woocommerce-sequential-order-numbers.php:139
     43#: woocommerce-sequential-order-numbers.php:141
    3944msgid "You cannot clone instances of %s."
    4045msgstr ""
    4146
    4247#. translators: Placeholders: %s - plugin name
    43 #: woocommerce-sequential-order-numbers.php:151
     48#: woocommerce-sequential-order-numbers.php:153
    4449msgid "You cannot unserialize instances of %s."
    4550msgstr ""
    4651
    47 #: woocommerce-sequential-order-numbers.php:489
     52#: woocommerce-sequential-order-numbers.php:537
    4853msgid "Allows filtering of orders by custom order number. Example: /wp-json/wc/v3/orders/?number=240222-45"
    4954msgstr ""
    5055
    5156#. translators: Placeholders: %1$s - plugin name; %2$s - WooCommerce version; %3$s, %5$s - <a> tags; %4$s - </a> tag
    52 #: woocommerce-sequential-order-numbers.php:731
     57#: woocommerce-sequential-order-numbers.php:779
    5358msgid "%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."
    5459msgstr ""
    5560
    56 #: woocommerce-sequential-order-numbers.php:783
     61#: woocommerce-sequential-order-numbers.php:831
    5762msgid "Error activating and installing <strong>Sequential Order Numbers for WooCommerce</strong>: %s"
    5863msgstr ""
    5964
    60 #: woocommerce-sequential-order-numbers.php:785
     65#: woocommerce-sequential-order-numbers.php:833
    6166msgid "&laquo; Go Back"
    6267msgstr ""
  • woocommerce-sequential-order-numbers/trunk/readme.txt

    r3279478 r3289095  
    33Tags: woocommerce, order number, sequential order number, woocommerce orders
    44Requires at least: 5.6
    5 Tested up to: 6.8
     5Tested up to: 6.8.1
    66Requires PHP: 7.4
    7 Stable tag: 1.11.0
     7Stable tag: 1.11.1
    88License: GPLv3 or later
    99License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    105105== Changelog ==
    106106
     107= 2025.05.07 - version 1.11.1 =
     108 * Fix - Searching by order number not working when Full Text Search is enabled
     109
    107110= 2024.11.06 - version 1.11.0 =
    108111 * Misc - Code clean up and optimization
  • woocommerce-sequential-order-numbers/trunk/woocommerce-sequential-order-numbers.php

    r3182923 r3289095  
    66 * Author: SkyVerge
    77 * Author URI: http://www.skyverge.com
    8  * Version: 1.11.0
     8 * Version: 1.11.1
    99 * Text Domain: woocommerce-sequential-order-numbers
    1010 * Domain Path: /i18n/languages/
     
    2020 *
    2121 * WC requires at least: 3.9.4
    22  * WC tested up to: 9.3.3
     22 * WC tested up to: 9.8.4
    2323 */
    2424
     25use Automattic\WooCommerce\Internal\DataStores\Orders\CustomOrdersTableController;
     26use Automattic\WooCommerce\Internal\DataStores\Orders\OrdersTableQuery;
    2527use Automattic\WooCommerce\Utilities\FeaturesUtil;
    2628use Automattic\WooCommerce\Utilities\OrderUtil;
     
    3739
    3840    /** Version number */
    39     public const VERSION = '1.11.0';
     41    public const VERSION = '1.11.1';
    4042
    4143    /** Minimum required wc version */
     
    208210            add_filter( 'woocommerce_shop_order_search_fields', [ $this, 'custom_search_fields' ] );
    209211            add_filter( 'woocommerce_order_table_search_query_meta_keys', [ $this, 'custom_search_fields' ] );
     212
     213            // admin order table search when using full text
     214            add_filter('woocommerce_hpos_generate_where_for_search_filter', [$this, 'fullTextSearchFilterWhereClause'], 10, 4);
    210215
    211216            // sort by underlying _order_number on the Pre-Orders table
     
    476481    }
    477482
     483    /**
     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.
     487     *
     488     * @param string|mixed $whereClause
     489     * @param string|mixed $searchTerm
     490     * @param string|mixed $searchFilter
     491     * @param OrdersTableQuery|mixed $query
     492     * @return string|mixed
     493     */
     494    public function fullTextSearchFilterWhereClause($whereClause, $searchTerm, $searchFilter, $query)
     495    {
     496        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
     506            global $wpdb;
     507            $order_table = $query->get_table_name('orders');
     508            $meta_table = $query->get_table_name('meta');
     509
     510            $meta_sub_query = $wpdb->prepare(
     511            "SELECT search_query_meta.order_id
     512                    FROM $meta_table as search_query_meta
     513                    WHERE search_query_meta.meta_key = '_order_number'
     514                    AND search_query_meta.meta_value LIKE %s
     515                    GROUP BY search_query_meta.order_id
     516                    ",
     517                '%' . $wpdb->esc_like($searchTerm) . '%'
     518            );
     519
     520            return "`$order_table`.id IN ( $meta_sub_query ) ";
     521        } catch(Exception $e) {
     522            return $whereClause;
     523        }
     524    }
     525
    478526
    479527    /**
Note: See TracChangeset for help on using the changeset viewer.