Changeset 3747745
- Timestamp:
- 10/15/2026 07:02:52 AM (11 days ago)
- Location:
- doofinder-for-woocommerce
- Files:
-
- 8 edited
- 1 copied
-
tags/2.17.2 (copied) (copied from doofinder-for-woocommerce/trunk )
-
tags/2.17.2/doofinder-for-woocommerce.php (modified) (2 diffs)
-
tags/2.17.2/includes/api/endpoints/class-endpoint-product.php (modified) (1 diff)
-
tags/2.17.2/includes/class-doofinder-constants.php (modified) (1 diff)
-
tags/2.17.2/readme.txt (modified) (2 diffs)
-
trunk/doofinder-for-woocommerce.php (modified) (2 diffs)
-
trunk/includes/api/endpoints/class-endpoint-product.php (modified) (1 diff)
-
trunk/includes/class-doofinder-constants.php (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
doofinder-for-woocommerce/tags/2.17.2/doofinder-for-woocommerce.php
r3705226 r3747745 4 4 * License: MIT 5 5 * License URI: https://opensource.org/licenses/MIT 6 * Version: 2.17. 16 * Version: 2.17.2 7 7 * Requires at least: 5.6 8 8 * Requires PHP: 7.0 … … 45 45 */ 46 46 47 public static $version = '2.17. 1';47 public static $version = '2.17.2'; 48 48 49 49 /** -
doofinder-for-woocommerce/tags/2.17.2/includes/api/endpoints/class-endpoint-product.php
r3705226 r3747745 655 655 ) 656 656 ); 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 ); 658 662 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 } 659 699 } 660 700 -
doofinder-for-woocommerce/tags/2.17.2/includes/class-doofinder-constants.php
r3705226 r3747745 24 24 class Doofinder_Constants { 25 25 26 const VERSION = '2.17. 1';26 const VERSION = '2.17.2'; 27 27 const PLUGINS_URL_FORMAT = 'https://%splugins.doofinder.com'; 28 28 const API_URL_FORMAT = 'https://%sadmin.doofinder.com'; -
doofinder-for-woocommerce/tags/2.17.2/readme.txt
r3705226 r3747745 2 2 Contributors: Doofinder 3 3 Tags: search, autocomplete 4 Version: 2.17. 14 Version: 2.17.2 5 5 Requires at least: 5.6 6 6 Tested up to: 6.9 7 7 Requires PHP: 7.0 8 Stable tag: 2.17. 18 Stable tag: 2.17.2 9 9 License: MIT 10 10 License URI: https://opensource.org/licenses/MIT … … 127 127 == Changelog == 128 128 129 = 2.17.2 = 130 - Fixed products missing from the index when another plugin changes the ordering of the catalog. 131 129 132 = 2.17.1 = 130 133 - 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 4 4 * License: MIT 5 5 * License URI: https://opensource.org/licenses/MIT 6 * Version: 2.17. 16 * Version: 2.17.2 7 7 * Requires at least: 5.6 8 8 * Requires PHP: 7.0 … … 45 45 */ 46 46 47 public static $version = '2.17. 1';47 public static $version = '2.17.2'; 48 48 49 49 /** -
doofinder-for-woocommerce/trunk/includes/api/endpoints/class-endpoint-product.php
r3705226 r3747745 655 655 ) 656 656 ); 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 ); 658 662 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 } 659 699 } 660 700 -
doofinder-for-woocommerce/trunk/includes/class-doofinder-constants.php
r3705226 r3747745 24 24 class Doofinder_Constants { 25 25 26 const VERSION = '2.17. 1';26 const VERSION = '2.17.2'; 27 27 const PLUGINS_URL_FORMAT = 'https://%splugins.doofinder.com'; 28 28 const API_URL_FORMAT = 'https://%sadmin.doofinder.com'; -
doofinder-for-woocommerce/trunk/readme.txt
r3705226 r3747745 2 2 Contributors: Doofinder 3 3 Tags: search, autocomplete 4 Version: 2.17. 14 Version: 2.17.2 5 5 Requires at least: 5.6 6 6 Tested up to: 6.9 7 7 Requires PHP: 7.0 8 Stable tag: 2.17. 18 Stable tag: 2.17.2 9 9 License: MIT 10 10 License URI: https://opensource.org/licenses/MIT … … 127 127 == Changelog == 128 128 129 = 2.17.2 = 130 - Fixed products missing from the index when another plugin changes the ordering of the catalog. 131 129 132 = 2.17.1 = 130 133 - 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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)