Plugin Directory

Changeset 3747745


Ignore:
Timestamp:
10/15/2026 07:02:52 AM (11 days ago)
Author:
doofinder
Message:

Update to version 2.17.2 from GitHub

Location:
doofinder-for-woocommerce
Files:
8 edited
1 copied

Legend:

Unmodified
Added
Removed
  • doofinder-for-woocommerce/tags/2.17.2/doofinder-for-woocommerce.php

    r3705226 r3747745  
    44 * License: MIT
    55 * License URI: https://opensource.org/licenses/MIT
    6  * Version: 2.17.1
     6 * Version: 2.17.2
    77 * Requires at least: 5.6
    88 * Requires PHP: 7.0
    … …  
    4545                 */
    4646
    47                 public static $version = '2.17.1';
     47                public static $version = '2.17.2';
    4848
    4949                /**
  • doofinder-for-woocommerce/tags/2.17.2/includes/api/endpoints/class-endpoint-product.php

    r3705226 r3747745  
    655655                        )
    656656                );
    657                 $original_response = rest_do_request( $request );
     657                $original_response = self::with_requested_ordering(
     658                        function () use ( $request ) {
     659                                return rest_do_request( $request );
     660                        }
     661                );
    658662                return $original_response->data;
     663        }
     664
     665        /**
     666         * Run a callback with the catalog ordering WooCommerce derives from the request,
     667         * whatever other plugins do to it.
     668         *
     669         * Paginating by offset needs a stable order. Plugins that sort the catalog (for example by
     670         * `menu_order`) hook into `woocommerce_get_catalog_ordering_args` and also rewrite the
     671         * ordering of `/wc/v3/products`, so pages overlap and some products are never returned.
     672         * The arguments WooCommerce computes are saved before any other callback runs and put
     673         * back after all of them.
     674         *
     675         * @param callable $callback The code that queries the products.
     676         * @return mixed What the callback returns.
     677         */
     678        private static function with_requested_ordering( $callback ) {
     679                $requested_args = null;
     680
     681                $save_requested_args = function ( $args ) use ( &$requested_args ) {
     682                        $requested_args = $args;
     683                        return $args;
     684                };
     685
     686                $restore_requested_args = function ( $args ) use ( &$requested_args ) {
     687                        return null === $requested_args ? $args : $requested_args;
     688                };
     689
     690                add_filter( 'woocommerce_get_catalog_ordering_args', $save_requested_args, PHP_INT_MIN );
     691                add_filter( 'woocommerce_get_catalog_ordering_args', $restore_requested_args, PHP_INT_MAX );
     692
     693                try {
     694                        return $callback();
     695                } finally {
     696                        remove_filter( 'woocommerce_get_catalog_ordering_args', $save_requested_args, PHP_INT_MIN );
     697                        remove_filter( 'woocommerce_get_catalog_ordering_args', $restore_requested_args, PHP_INT_MAX );
     698                }
    659699        }
    660700
  • doofinder-for-woocommerce/tags/2.17.2/includes/class-doofinder-constants.php

    r3705226 r3747745  
    2424class Doofinder_Constants {
    2525
    26         const VERSION            = '2.17.1';
     26        const VERSION            = '2.17.2';
    2727        const PLUGINS_URL_FORMAT = 'https://%splugins.doofinder.com';
    2828        const API_URL_FORMAT     = 'https://%sadmin.doofinder.com';
  • doofinder-for-woocommerce/tags/2.17.2/readme.txt

    r3705226 r3747745  
    22Contributors: Doofinder
    33Tags: search, autocomplete
    4 Version: 2.17.1
     4Version: 2.17.2
    55Requires at least: 5.6
    66Tested up to: 6.9
    77Requires PHP: 7.0
    8 Stable tag: 2.17.1
     8Stable tag: 2.17.2
    99License: MIT
    1010License URI: https://opensource.org/licenses/MIT
    … …  
    127127== Changelog ==
    128128
     129= 2.17.2 =
     130- Fixed products missing from the index when another plugin changes the ordering of the catalog.
     131
    129132= 2.17.1 =
    130133- Fixed the indexed price being 0 for products whose regular price is 0 but are sold at another price.
  • doofinder-for-woocommerce/trunk/doofinder-for-woocommerce.php

    r3705226 r3747745  
    44 * License: MIT
    55 * License URI: https://opensource.org/licenses/MIT
    6  * Version: 2.17.1
     6 * Version: 2.17.2
    77 * Requires at least: 5.6
    88 * Requires PHP: 7.0
    … …  
    4545                 */
    4646
    47                 public static $version = '2.17.1';
     47                public static $version = '2.17.2';
    4848
    4949                /**
  • doofinder-for-woocommerce/trunk/includes/api/endpoints/class-endpoint-product.php

    r3705226 r3747745  
    655655                        )
    656656                );
    657                 $original_response = rest_do_request( $request );
     657                $original_response = self::with_requested_ordering(
     658                        function () use ( $request ) {
     659                                return rest_do_request( $request );
     660                        }
     661                );
    658662                return $original_response->data;
     663        }
     664
     665        /**
     666         * Run a callback with the catalog ordering WooCommerce derives from the request,
     667         * whatever other plugins do to it.
     668         *
     669         * Paginating by offset needs a stable order. Plugins that sort the catalog (for example by
     670         * `menu_order`) hook into `woocommerce_get_catalog_ordering_args` and also rewrite the
     671         * ordering of `/wc/v3/products`, so pages overlap and some products are never returned.
     672         * The arguments WooCommerce computes are saved before any other callback runs and put
     673         * back after all of them.
     674         *
     675         * @param callable $callback The code that queries the products.
     676         * @return mixed What the callback returns.
     677         */
     678        private static function with_requested_ordering( $callback ) {
     679                $requested_args = null;
     680
     681                $save_requested_args = function ( $args ) use ( &$requested_args ) {
     682                        $requested_args = $args;
     683                        return $args;
     684                };
     685
     686                $restore_requested_args = function ( $args ) use ( &$requested_args ) {
     687                        return null === $requested_args ? $args : $requested_args;
     688                };
     689
     690                add_filter( 'woocommerce_get_catalog_ordering_args', $save_requested_args, PHP_INT_MIN );
     691                add_filter( 'woocommerce_get_catalog_ordering_args', $restore_requested_args, PHP_INT_MAX );
     692
     693                try {
     694                        return $callback();
     695                } finally {
     696                        remove_filter( 'woocommerce_get_catalog_ordering_args', $save_requested_args, PHP_INT_MIN );
     697                        remove_filter( 'woocommerce_get_catalog_ordering_args', $restore_requested_args, PHP_INT_MAX );
     698                }
    659699        }
    660700
  • doofinder-for-woocommerce/trunk/includes/class-doofinder-constants.php

    r3705226 r3747745  
    2424class Doofinder_Constants {
    2525
    26         const VERSION            = '2.17.1';
     26        const VERSION            = '2.17.2';
    2727        const PLUGINS_URL_FORMAT = 'https://%splugins.doofinder.com';
    2828        const API_URL_FORMAT     = 'https://%sadmin.doofinder.com';
  • doofinder-for-woocommerce/trunk/readme.txt

    r3705226 r3747745  
    22Contributors: Doofinder
    33Tags: search, autocomplete
    4 Version: 2.17.1
     4Version: 2.17.2
    55Requires at least: 5.6
    66Tested up to: 6.9
    77Requires PHP: 7.0
    8 Stable tag: 2.17.1
     8Stable tag: 2.17.2
    99License: MIT
    1010License URI: https://opensource.org/licenses/MIT
    … …  
    127127== Changelog ==
    128128
     129= 2.17.2 =
     130- Fixed products missing from the index when another plugin changes the ordering of the catalog.
     131
    129132= 2.17.1 =
    130133- Fixed the indexed price being 0 for products whose regular price is 0 but are sold at another price.
Note: See TracChangeset for help on using the changeset viewer.