dimanche 13 avril 2014

php - Bigcommerce API obtenir un oder aléatoire de 40 enregistrements prend 30 secondes - Stack Overflow


I am trying to use PHP with API to get one random order information from 40 records, but it takes 40 seconds.


I am useing a free hosting, and I found not all of hostings support this API program.


Hope soem one ca give me some help.


Thanks.




$orders= Bigcommerce::getOrders();

foreach ($orders as $order) {

foreach ($order->products as $products_item) {
$filter = array(
'min_id' => $products_item->product_id,
'max_id' => $products_item->product_id
);

$products = Bigcommerce::getProducts($filter);

foreach ($products as $product) {

$product_custom_url = $product->custom_url;

$product_img = $product->images[0]->image_file;

$item[] .= '

' . $order->billing_address->first_name . ' in ' . $order->geoip_country . ' just purchased

' . $products_item->name . ' ';

}

}

}

shuffle($item);
print_r($item[1]);



I am trying to use PHP with API to get one random order information from 40 records, but it takes 40 seconds.


I am useing a free hosting, and I found not all of hostings support this API program.


Hope soem one ca give me some help.


Thanks.




$orders= Bigcommerce::getOrders();

foreach ($orders as $order) {

foreach ($order->products as $products_item) {
$filter = array(
'min_id' => $products_item->product_id,
'max_id' => $products_item->product_id
);

$products = Bigcommerce::getProducts($filter);

foreach ($products as $product) {

$product_custom_url = $product->custom_url;

$product_img = $product->images[0]->image_file;

$item[] .= '

' . $order->billing_address->first_name . ' in ' . $order->geoip_country . ' just purchased

' . $products_item->name . ' ';

}

}

}

shuffle($item);
print_r($item[1]);


1 commentaire:

  1. I’m going to read this. I’ll be sure to come back. thanks for sharing. and also This article gives the light in which we can observe the reality. this is very nice one and gives indepth information. thanks for this nice article

    BIGCOMMERCE


    RépondreSupprimer