So, after fiddling with this all week, i finally found the solution.
In my original script, i asked for 99999 products with this line:
$products = $woocommerce->get('products', $parameters=['per_page' => 99999]);
I also had this function in functions.php in WP:
function maximum_api_filter($query_params) {
$query_params['per_page']["maximum"]= 99999;
return $query_params;
}
add_filter('rest_product_collection_params', 'maximum_api_filter');
The new changes i made to the script was that i changed “per_page” to 100, and then looped through it x number of times and finally merged the arrays.
The new solution works fine, and the fatal error i was getting before was maybe caused by WordPress trying to serve me several hundreds of products at one go witch may have overloaded or triggered something on the server. Dont know this for sure, but new solution works fine.
Related Posts:
- WordPress Woocommerce REST API JSON Error
- Fatal error: Uncaught Error: The script tried to modify a property on an incomplete object
- WP/WooCommerce REST API cart/checkout/order [closed]
- Creating woocommerce product using WordPress REST API
- Fatal Error in WordPress WooCommerce theme “Call to undefined function wc_get_theme_slug_for_templates()”
- Woocommerce REST API allow normal users make an order
- Expired session error (admin) when I try to make a call to WooCommerce api [closed]
- WooCommerce plugin won’t let me access settings
- How can I get all the woocommerce api orders [closed]
- wc_get_products() not return the images details
- Woocommerce REST API – add filter to set maximum query per page for product brands [closed]
- Update Customer JWT Woocommerce
- Woocommerce, finding the ordinal number of a purchase for a certain product
- WordPress SMS API integration without plugin error
- Absolute search against wordpress api
- Change Out of Stock Error Message in WooCommerce Cart
- Woocommerce checkout required field error
- woocommerce REST api on the website’s front-end
- Random 503 and 504 errors
- How to save one API response to WooCommerce order meta data
- How can I get a get a list of customers from a list of email addresses?
- Editing product categories suddenly crashes website and goes back to wordpress installation
- How to get WordPress to respond to a GET request at the end of a Woo product page
- Working with a json feed & trying to figure out how best to import
- Delete product image using WooCommerce API?
- Getting error in debug : price was called incorrectly. Product properties should not be accessed directly
- email address non required
- SyntaxError: unterminated string literal – if WordPress Debug in wp-config is set to true
- WordPress returning “XHR” even when access keys are used
- Stop the “upload file size” error from printing [closed]
- How to programatically create a WooCommerce downloadable product?
- Users credentials and syncing from third party with WooCommerce
- Manual Woocommerce Complete order Emails
- WooCommerce REST API endpoints don’t exist
- Notice: Trying to get property of non-object in bodycenter [closed]
- Fetch products with filter by similar categories at same time
- WordPress error
- Woocommerce API REST search by multiple keywords
- Create WordPress account on different domain when WooCommerce order completed
- Auto generating API keys using the Application Authentication Endpoint [closed]
- Critical error on woocommerce checkout page
- Checkout page not loading on my ecommerce website
- Echo SKU in WooCommerce Conformation page [closed]
- WordPress won’t display errors at all
- Plugin won’t activate, fatal error (widget class not found)
- WP_Error message
- blank white page in admin, white space hunting?
- How to hide metaboxes in WordPress Admin on WooCommerce “Add Product” page – Remove side sortables for a specific user role
- Hide woocommerce login form
- Fatal error: Cannot declare class WP_User_Request, because the name is already in use?
- Custom product loop avoiding duplicates
- how to get woocommerce product id by acf field in wordpress and display product
- Woocommerece category page showing in stock product as out of stock
- I’m getting Call to undefined function wp_parse_list() out of the blue
- Trying to link to a custom css file in a new folder
- Unable to enocde the result of wc_get_products
- Woocommerce – Remove ‘Buy Product’ Button + Make Product Thumbnails Clickable
- Increase product variation limit in woocommerce
- Issue with Woocommerce and extra field in orders data
- How to get an Array from “select” field in advanced custom fields
- WooCommerce widget “WooCommerce Products” template [closed]
- change text “free shipping” in WooCommerce [closed]
- How to get _POST variable on WooCommerce product page (form on homepage)
- How to add ajax loading icon after click add to cart button on woocommerce
- Disable add to cart button when product is out of stock
- WooCommerce add custom product_type_option
- Redirect whole website or pages to /wp-admin in wordpress
- Can’t display product categories on woocommerce getting Invalid taxonomy?
- Changing sale price programmatically, but it’s not shown on front-end
- How do I put woocommerce cart page to my checkout page? [closed]
- Send form data to functions.php
- Customizing the add to cart function
- Hiding all products except for one in wordpress admin panel
- add custom menu in woocommerce dashboard [closed]
- How-To: Get meta data from the users last order in woocommerce
- how to query single product in woocommerce? [closed]
- woocommerce-how can i get all products by their groups! [closed]
- Custom sender email address for specific WooCommerce product
- Anchor link to every product
- Plugin could not be activated because it triggered a fatal error
- How to disable the “Upgrade or Downgrade” button in “My account” of WooCommerce Subscriptions
- WooCommerce – Inconsistent Indexing of Orders
- Woocommerce custom product with JS script, can’t understand how it works [closed]
- Stock QTY gets negative after order
- Woocommerce REST API authentication with server password [closed]
- How to remove content from hacked pages? [closed]
- Disable WooCommerce Address State Dropdown
- Decrease stock quantity when a variation is sold using Woocommerce
- woocommerce breadcrumb only in cart and checkout pages
- Rename woocommerce button [closed]
- Allow authors to use their own PayPal account and payment process automation [closed]
- is_plugin_active() not defined on active plugin, in the thumbnails.php file
- WooCommerce show decimals in totals [closed]
- How to show detailed order history on woocommerce product page [closed]
- The plugin generated xxx characters of unexpected output during activation
- Woocommerce Add to Cart function
- WooCommerce – doesn’t show product when using woocommerce.php [closed]
- WordPress Woocommerce – Checkout – Error 405: Unable to create order. Please try again [closed]
- eCommerce solution doesn’t want to display its shortcodes or any content where it’s set to [closed]
- How to move WooCommerce Product Data Box below Title Box in Edit