使用PHP从BigCommerce API获取图片网址 [英] Get image url from BigCommerce API with PHP

查看:68
本文介绍了使用PHP从BigCommerce API获取图片网址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以帮助我用PHP检索BigCommerce产品的图像URL吗?我尝试使用Bigcommerce :: getProductImages($ product-> id);但这没有帮助.我希望该API能够更新为最新版本.请提出一个确切的解决方案.预先感谢.

Can anybody help me to retrieve Image URL for a BigCommerce Product in PHP? I tried with Bigcommerce::getProductImages($product->id); but it doesn't helps. I hope the API gets updated in latest version. Pls suggest an exact solution. Thanks in advance.

推荐答案

在迭代产品时,您可以获取产品ID并在其中循环:

when iterating thru products you can grab the product ID and loop through this:

$images = BigCommerce_Api::getCollection('/products/'.$productID.'/images');

    foreach($images as $image) {
        $curImage=$image->image_file;
            echo '<img src="'.$storeURL.'/product_images/'.$curImage.'"/>';
        }

希望这会有所帮助

这篇关于使用PHP从BigCommerce API获取图片网址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆