'', // Your wpsorders dealer number. 'PASSWORD' => '', // Your wpsorders admin account password. 'FITMENT' => 'HONDA HON8300 2012', // Here you would enter the fitment key. (ie. Make-name Model-number Year) 'OUTPUT' => 'json' // JSON is used in this example. ); // Make the cURL request. $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "https://www.wpswebservices.com/version2/wsFITS.pgm"); curl_setopt($ch, CURLOPT_POSTFIELDS, $vars); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); $curl_result = curl_exec($ch); curl_close($ch); // Decode the JSON string into stdObject. $result = json_decode($curl_result); // Print the HTML to set up a table. echo '

There are ' . $result->response->numFound . ' items that fit a "' . $vars['FITMENT'] . '" vehicle:

' . "\n"; echo '' . "\n"; echo ' ' . "\n"; echo ' ' . "\n"; echo ' ' . "\n"; echo ' ' . "\n"; echo ' ' . "\n"; echo ' ' . "\n"; // For each 'docs' property in the response, do this: foreach ($result->response->docs as $a) { $image = (property_exists($a, 'mainimg')) ? $a->mainimg : 'image_coming_soon.jpg'; echo ' ' . "\n"; echo ' ' . "\n"; echo ' ' . "\n"; echo ' ' . "\n"; echo ' ' . "\n"; echo ' ' . "\n"; } // Print the closing HTML echo ' ' . "\n"; echo '
prtnmbrnamelistprcmainimg
' . $a->prtnmbr . '' . $a->name . '$' . $a->listprc . '
' . "\n"; ?>