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
- 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
- How to add a new endpoint in woocommerce
- Slow Loading Attribute Select – WooCommerce Backend
- Get WooCommerce Email Classes in Backend
- Use Hooks to Limit One Comment Per User Per Post – Hide Form if Already Commented
- WooCommerce is slow with many categories [closed]
- Woocommerce – Move product without price a the end
- Extra row / text field to a product page (WooCommerce)
- woocommerce_email_attachments filter arguments [closed]
- How to Show Single Product – 4 Data by ID in Custom Page without over-riding the existing Woo-Commerce
- WOOCommerce redirect after registration to account details
- How can I add an additional action button into the woocommerce admin order page?
- Woocommerce Subscriptions – Set Billing Interval/Period
- WooCommerce with ACF: custom fields per product variation
- Woocommerce checkout page reload on up dating shipping method
- change wp_login url and redirect users at the same time
- How to clear woocommerce checkout form after pageload
- Is there a plugin available for recurring orders in Woocommerce? [closed]
- call_user_func_array() error in class-wp-hook.php
- Error after woocommerce update from 2.6 to 3.5 [closed]
- Send billing info from woocommerce checkout page to paypal checkout form
- Check if a category has a parent category in WooCommerce REST API
- Remove a higher quantity from stock according to a variation
- Woocommerce check if email already created order recently [closed]
- Switch to user link
- How can I edit the Woocommerce product widget html class?
- Can’t show Woocommerce product category description
- Create new email in WooCommerce
- Display vendor phone number on single product page
- 3 Different Prices for Woocommerce Product
- How to create a WooCommerce Product filter based on PHP foreach
- Use ID as slug for product category by default in WooCommerce?
- How to remove Calendar on Woocommerce Category Pages
- How to remove the Sub category product URL Woocommerce
- Fragments to Update Cart Counter not working on homepage – Woocommerce
- WooCommerce Review Author Hook on Review Submission
- woocommerce ad custom button with custom link after add to cart for every product
- Exclude Specific Product Category for showing up in its parent category page
- How to fire a disabled WooCommerce New Order notification?
- Set up PayPal with wrong email by mistake
- Does WP-WooC support filters at database?
- How to send welcome email once user buys the subscription
- Removed Sidebar in single product page
- Reorder PRODUCTS in categories Woo
- Woocommerce section name? [closed]
- how to change value return by _stock_status
- Retrieve Woocommerce Cart Url with javascript/jquery [closed]
- woocommerce_email_recipient_new_order not triggered
- Load custom post template
- Remove plugin function and add it back in via functions.php
- deactivate product-page image slider on mobile
- Woocommerece category page showing in stock product as out of stock
- Increase product variation limit in woocommerce
- WooCommerce widget “WooCommerce Products” template [closed]
- Woocommerce woocommerce_breadcrumb_defaults filter [closed]
- Some Admin disappeared
- Use Homepage as “Shop” for Woocommerce [closed]
- How to display India country first in country selection drop down list in WordPress
- How do I remove the recurring total from thank you for your order email?
- I want to Display custom woocomerce meta box in orders list
- Detect Product Type with code