vkolya/opencart-sdk
Composer 安装命令:
composer require vkolya/opencart-sdk
包简介
Open Cart API
关键字:
README 文档
README
As a basis was used this project https://github.com/iSenseLabs/OpenCartAPI/blob/master/opencart.php
Installation
Require this package in your composer.json and update composer. This will download the package
composer require vkolya/opencart-sdk
Basic usage
use Vkolya\ocSDK\OpenCart;
Second parameter is name of file in your file system where will be store opencart session data for next requests(if you're not going to save session beetwen request you may not pass this parameter)
$oc = new OpenCart('http://opencartsite,com','oc_api.dat'); //login method on success returns array with token and apiVersion $oc->login('OC_API_TOKEN');
if you want to work with api, for instance , not only in one class(controller) . In this case , you can save token and apiVersion on session
$_SESSION['op_session_data'] = $oc->login('OC_API_TOKEN');
And later in another controller call
$oc = new OpenCart('http://opencartsite,com','oc_api.dat',$_SESSION['op_session_data']); //add product to cart $oc->cart->add(1, 1);
统计信息
- 总下载量: 66
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-02-17