clickandmortar/magento-php-api-client 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

clickandmortar/magento-php-api-client

最新稳定版本:v0.1.0

Composer 安装命令:

composer require clickandmortar/magento-php-api-client

包简介

Magento 2 PHP REST API client / SDK

README 文档

README

This is a PHP client for the Magento / Adobe Commerce REST API.

Requirements

  • PHP 8.2 or higher
  • Magento / Adobe Commerce 2.3 or higher

Installation

composer require clickandmortar/magento-api-client

Usage

<?php

require 'vendor/autoload.php';

use ClickAndMortar\MagentoApiClient\ClientBuilder;
use ClickAndMortar\MagentoApiClient\SearchCriteria\SearchCriteriaBuilder;

$clientBuilder = new ClientBuilder('https://magento.hostname.com/');
$client = $clientBuilder->buildAuthenticatedByOauth(
    '<consumer-key>>',
    '<consumer-secret>',
    '<access-token>',
    '<access-token-secret>'
);

// Fetch all products
$searchCriteriaBuilder = new SearchCriteriaBuilder();
$searchCriteriaBuilder->addFilter('type_id', 'simple');
$searchCriteriaBuilder->setPageSize(10);

foreach ($client->products->all($searchCriteriaBuilder->create()) as $product) {
    echo $product->sku . ' - ' . $product->name . PHP_EOL;
}

// Fetch a single product
$product = $client->products->get('24-MB01');

Available resources

  • products
  • orders
  • customers

Credits

This library is heavily inspired by - and uses parts of - the Akeneo PHP Client, thanks for their amazing work 🧡.

License

This project is licensed under the Open Software License version 3.0 - see the LICENSE file for details.

This project is not affiliated with, endorsed by, or sponsored by Adobe Inc. "Magento" and "Adobe Commerce" are trademarks of Adobe Inc. All trademarks and registered trademarks are the property of their respective owners.

统计信息

  • 总下载量: 5
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-05-30