Note that there are some explanatory texts on larger screens.

plurals
  1. POFetch Product Images with BigCommerce API
    text
    copied!<p>Long story short a couple months ago i made a plugin for WordPress with the Bigcommerce API to fetch products in the Widget Area.</p> <p>Now I have updated the Single File "Bigcommerce.php" and now the Function getProductImages () is none existent. And I cant seem to find the new function to get the Product Images. Maybe its just to late and Im tired or just plain Blind.</p> <p>Please let me know how to fetch now the image for a specific product.</p> <p>See below for the old code used i reverted back to the Old "Bigcommerce.php" and it works again but would ratehr use the new way.</p> <pre><code> Bigcommerce::configure(array( 'store_url' =&gt; $store_url, 'username' =&gt; $username, 'api_key' =&gt; $api_key )); Bigcommerce::setCipher('RC4-SHA'); Bigcommerce::verifyPeer(false); $countProducts = 0; $products = Bigcommerce::getProducts(); shuffle($products); echo '&lt;div class="BCStoreWidget"&gt;'; if (!$products) { echo '&lt;div class="BCerror"&gt;'; $error = Bigcommerce::getLastError(); echo $error-&gt;code; echo $error-&gt;message; echo '&lt;/div&gt;'; } else { foreach ($products as $product) { $productImages = Bigcommerce::getProductImages($product-&gt;id); echo '&lt;h4&gt;' . $product-&gt;name . '&lt;/h4&gt;'; if ($productImages-&gt;image_file){ echo '&lt;div class="pimage"&gt;'; echo '&lt;a href="'. $store_url . $product-&gt;custom_url . '"&gt;&lt;img src="' . $store_url . '/product_images/' . $productImages-&gt;image_file . '"&gt;&lt;/a&gt;'; echo '&lt;/div&gt;'; } // echo '&lt;p&gt;' . substr($product-&gt;description,0,100) . '&amp;nbsp;...&lt;/p&gt;'; echo '&lt;p&gt;' . number_format($product-&gt;price, 2, '.', '') . '&amp;nbsp; USD&lt;/p&gt;'; echo '&lt;p&gt;&lt;a href="'. $store_url . $product-&gt;custom_url . '" class="button"&gt; Buy Now &lt;/a&gt;&lt;/p&gt;'; $countProducts++; if ($countProducts == $max_show) break; } } echo '&lt;/div&gt;'; </code></pre> <p>Thank you all in Advance</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload