Last active
May 14, 2019 05:46
-
-
Save kilbot/be2ca463f50664569b938faa5baf92da to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// this goes in your theme functions.php file | |
function my_custom_rest_dispatch_request($continue, $request, $route, $handler) | |
{ | |
if (function_exists('is_pos') && is_pos() && $route == 'wc/v3/products') { | |
$request->set_param('per_page', -1); | |
$request->set_param('stock_status', 'instock'); | |
} | |
return $continue; | |
} | |
add_filter('rest_dispatch_request', 'my_custom_rest_dispatch_request'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment