Closed rjacobso closed 4 years ago
What is the correct way to use this to get all products? I used your example code on your other PR, but I get the following error:
No action named lastResourceContainsNextPageInfo is defined for Product in ....
You are correct, it seems there was another competing pull request to do this in a different manner. It looks like @tareqtms approved both, but some / most of my changes were removed as part of the merge. - Actually this could have been me screwing it up trying to bring my repo up to date. Looking now ...
The working code should be here:
$productResource = $shopify->Product();
$products = $productResource->get(['limit'=>50]);
$nextPageProducts = $productResource->get($productResource->getNextPageParams());
/* in short: you need to reuse the resource to get the params before making another resource */**
Please follow the thread #101 for more info.
This is an attempt to implement the same logic from #125 but without breaking backwards-compat.