我是bigcommerce api的新手。在google搜索之后,我得到了
但是,当我尝试测试我的测试脚本中的api时,我得到了错误。
C:\xampp\htdocs\apitest\src\Bigcommerce\test.php中的致命错误:在第7行的中找不到'Bigcommerce_Api‘类
我的test.php代码如下:-
<?php
require_once 'Api.php';
Bigcommerce_Api::setCipher('RC4-SHA');
Bigcommerce_Api::verifyPeer(false);
Bigcommerce_Api::configure(array(
'store_url' => 'http://filtersdelivered-com.mybigcommerce.com/',
'username' => 'admin',
'api_key' => '26e92a2f6fc3719c1889e78d9c0df7f1402123e9'
));
$products = Bigcommerce_Api::getProducts();
foreach($products as $product) {
echo $product->name;
echo $product->price;
}
?>
有人能帮我吗?
发布于 2014-12-03 10:56:00
是同名的。尝试在use Bigcommerce\Api\Client as Bigcommerce_Api;
之后添加require_once
。一种完整的副本废物解决方案:
<?php
require_once 'Api.php';
use Bigcommerce\Api\Client as Bigcommerce_Api;
Bigcommerce_Api::setCipher('RC4-SHA');
Bigcommerce_Api::verifyPeer(false);
Bigcommerce_Api::configure(array(
'store_url' => 'http://filtersdelivered-com.mybigcommerce.com/',
'username' => 'admin',
'api_key' => '26e92a2f6fc3719c1889e78d9c0df7f1402123e9'
));
$products = Bigcommerce_Api::getProducts();
foreach($products as $product) {
echo $product->name;
echo $product->price;
}
?>
https://stackoverflow.com/questions/27269588
复制相似问题