digitalprint/oro-api-php
Composer 安装命令:
composer require digitalprint/oro-api-php
包简介
OroCommerce API client for PHP applications.
关键字:
README 文档
README
Thank you for using the "OroCommerce Api PHP Client" (Digitalprint_Oro-Api-PHP).
This package contains some basic functions you need to connect php applications with your OroCommerce system.
This package contains only a few endpoints. If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement".
1. Documentation
2. How to install
Install via composer (recommend)
Run the following command in your root folder:
composer require digitalprint/oro-api-php
3. User Guide
This package integrates OroCommerce API functions into your php application.
3.1 Getting started
Initializing the OroCommerce API client.
$oro = new \Digitalprint\Oro\Api\OroApiClient(); $oro->setApiEndpoint('YOUR_ORO_API_ENDPOINT'); $oro->setUser('YOUR_ORO_API_USER'); $res = $oro->authorization->create([ 'client_id' => 'YOUR_CLIENT_ID', 'client_secret' => 'YOUR_CLIENT_SECRET', ]); $oro->setAccessToken($res->access_token);
3.2 Product Examples
Get a single product
$product = $oro->products->get(100);
Get a single product with related entities included
$oro->products->get(1, ['include' => 'names,descriptions']);
Get a list of products
$products = $oro->products->page();
Get a list of featured products
$products = $oro->products->page(1, 10, ['featured' => true]);
Get names of a product
$names = $oro->products->get(100)->names();
Update an existing product
$product = $oro->products->get(100); $res = $product->update([ 'data' => [ 'meta' => [ 'update' => true, ], 'type' => 'products', 'id' => $product->id, 'attributes' => [ 'status' => ($product->attributes->status === 'disabled' ? "enabled" : "disabled"), ], ], ]);
Create a new product
$product = $oro->products->create([ 'data' => [ 'type' => 'products', 'attributes' => [ 'sku' => 'test-api-' . strtotime('now'), 'status' => 'enabled', 'variantFields' => [], 'productType' => 'simple', 'featured' => true, 'newArrival' => false, 'availability_date' => '2018-01-01', ], 'relationships' => [ ... ], ], 'included' => [ ... ], ]);
Delete a single product
$names = $oro->products->get(100)->delete();
3.3 More Examples
More examples are in the examples folder
digitalprint/oro-api-php 适用场景与选型建议
digitalprint/oro-api-php 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 245 次下载、GitHub Stars 达 1, 最近一次更新时间为 2021 年 12 月 29 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「php」 「api」 「API-Client」 「ORO」 「OroCommerce」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 digitalprint/oro-api-php 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 digitalprint/oro-api-php 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 digitalprint/oro-api-php 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Skolkovo API Client
A PSR-7 compatible library for making CRUD API endpoints
A client library for the OpenPLZ API project
Alfabank REST API integration
chargebee-php-sdk integration for WordPress
统计信息
- 总下载量: 245
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: BSD-2-Clause
- 更新时间: 2021-12-29