Fetch orders and variants is slow

New Member
3 0 1

Hi there! I try to fetch the orders and for each order I go featch each variant to extract its details, but this is very slow, is there any way to improve the speed of this?

here is my code

foreach ($orders['orders'] as $order) {
foreach ($order['line_items'] as $item){
$variant =https://'.$user.':'.$password.'@'.$shop_domain.'/admin/api/2021-07/variants/'.$variant_id.'.json
Shopify Partner
119 31 72

You are processing sequentially, you can change the code to parallel process with rate limiting checks (to cool down the thread when close to the limits). That is substantially faster than what you have below.

Tech Expert at Frankie - Personalizing the Shopping experience.
Frankie - empowering merchants in 206 Countries and 31 Currencies.