Noobie的Bigcommerce API接口 [英] Noobie bigcommerce API connection

查看:425
本文介绍了Noobie的Bigcommerce API接口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对不起,noobie问题,但我只是想知道由我至少可以连接到我的Bigcommerce店,并通过PHP或卷曲脚本查询它的进程。

Sorry for the noobie question but I just wanted to know the process by which I could at least connect to my bigcommerce store and query it via a PHP or curl script.

如果有人可以帮助我简单的说明。即下载的Bigcommerce PHP脚本,安装,生成用户的API,安装WAMP或其他一些PHP的Mac应用程序粘贴到这里等等等等,我将永远感激。

If someone could help me with simple instructions. i.e download bigcommerce php script, install , generate API on user, install wamp or some other php mac app paste into here blah blah blah I would be eternally grateful.

我一直在阅读和阅读,只是obvioulsy失去了一些东西,因为我不能gereneate什么出格的开发商大商务功能操场部分和不知道从哪里从这里走。

I have been reading and reading and just obvioulsy missing something as I cant gereneate anything out of the playground section of developer big commerce functionality and dont know where to go from here.

几乎忘了提,我在Mac上,如果有差别

Nearly forgot to mention I am on a mac if that makes a difference

感谢

安德鲁

推荐答案

1)要求

    PHP 5.3 or greater
    cUrl extension enabled

2)创建文件夹WAMP / WWW / bigcommerceDemo和下载的https:/ /github.com/bigcommerce/bigcommerce-api-php/archive/master.zip 在里面。

3)与作曲家作曲安装install命令

3) Install composer with composer install command

4)创建bigcommerceDemo文件夹index.php文件意味着你的项目文件夹

4) Create index.php file in bigcommerceDemo folder means your project folder

index.php File :- 


  <?php
    require 'vendor/autoload.php';

    use Bigcommerce\Api\Client as Bigcommerce;

    Bigcommerce::configure(array(

        'store_url' => 'https://xyz-com.mybigcommerce.com/',
        'username' => 'admin',
        'api_key' => 'dummy92f6fd3df7f140719c1889e78d9c026999p'
    ));

    Bigcommerce::verifyPeer(false);

    $ping = Bigcommerce::getTime();

    if ($ping) {
        //echo $ping->format('H:i:s');
    }
    Bigcommerce::failOnError();

    try {
        $orders = Bigcommerce::getOrders();

    } catch(Bigcommerce\Api\Error $error) {
        echo $error->getCode();
        echo $error->getMessage();
    }

    $products = Bigcommerce::getProducts();

    //echo '<pre>'; print_r($products); exit;

    echo '<pre>';

    foreach($products as $product) {
        //print_r($product);
        echo $product->name . '---------';
        //echo $product->price . '<br>';
    }

5)运行本地主机/ bigcommerceDemo:该文件显示所有产品。

5) Run localhost/bigcommerceDemo : This file display all products.

这篇关于Noobie的Bigcommerce API接口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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