heptacom/heptaconnect-package-shopware-6 问题修复 & 功能扩展

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

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

heptacom/heptaconnect-package-shopware-6

Composer 安装命令:

composer require heptacom/heptaconnect-package-shopware-6

包简介

HEPTAconnect package to work with Shopware 6 APIs

README 文档

README

This is part of HEPTACOM solutions for medium and large enterprises.

Description

This HEPTAconnect package is all about communicating to Shopware 6 APIs. You can use it in combination with the Shopware 6 Portal. Read more in the documentation (especially the package design decision) and have a look into the examples section.

Usage

Installation

  1. composer require heptacom/heptaconnect-package-shopware-6
  2. Use guide for specific situation:
  3. Follow examples below

AdminAPI - EntityClient

<?php

use Heptacom\HeptaConnect\Package\Shopware6\EntitySearch\Contract\Aggregation\TermsAggregation;
use Heptacom\HeptaConnect\Package\Shopware6\EntitySearch\Contract\Filter\EqualsFilter;
use Heptacom\HeptaConnect\Package\Shopware6\Http\AdminApi\Utility\EntityClient;

/** @var $entityClient EntityClient */
$propertyGroupId = $entityClient->create('property_group', [
    'name' => 'Color',
    'sortingType' => 'position',
    'displayType' => 'color',
    'options' => [[
        'position' => 1,
        'name' => 'Red',
        'colorHexCode' => '#aa0000',
    ], [
        'position' => 2,
        'name' => 'Green',
        'colorHexCode' => '#00aa00',
    ], [
        'position' => 3,
        'name' => 'Blue',
        'colorHexCode' => '#0000aa',
    ]],
]);

$colorNamesByName = $entityClient->groupFieldByField(
    'property_group_option',
    'colorHexCode',
    'name',
    new EqualsFilter('group.id', $propertyGroupId)
);
var_export($colorNamesByName);
// array (
//   '#0000aa' => 'Blue',
//   '#00aa00' => 'Green',
//   '#aa0000' => 'Red',
// )

// paginates automatically
foreach ($entityClient->iterate('product') as $product) {
    // …
}

$countryIsos = $entityClient->aggregate('country', new TermsAggregation('countries', 'iso'))->buckets->getKeys();
var_export($countryIsos->asArray());
// array (
//   0 => 'AD',
//   1 => 'AE',
//   2 => 'AF',
//   3 => 'AG',
//   4 => 'AI',
//   …

AdminAPI - ExtensionClient

<?php

use Heptacom\HeptaConnect\Package\Shopware6\Http\AdminApi\Utility\ExtensionClient;

/** @var $extensionClient ExtensionClient */
// remote updating security plugin
$extensionClient->upload('/path/to/SwagSecurityPlatform.zip');
$extensionClient->refresh();
$extensionClient->update('SwagSecurityPlatform');

if (!$extensionClient->isInstalled('SwagSecurityPlatform')) {
    $extensionClient->install('SwagSecurityPlatform');
}

if (!$extensionClient->isActive('SwagSecurityPlatform')) {
    $extensionClient->activate('SwagSecurityPlatform');
}

AdminAPI - GenericClient

<?php

use Heptacom\HeptaConnect\Package\Shopware6\Http\AdminApi\Utility\GenericClient;

/** @var $client GenericClient */
// low amount of parameters
var_export($client->get('_info/version'));
// array (
//   'version' => '6.4.20.0',
// )

// query parameters
var_export($client->get('_action/system-config', [
    'domain' => 'core.update',
]));
// array (
//   'core.update.apiUri' => 'https://update-api.shopware.com',
//   'core.update.channel' => 'stable',
//   'core.update.code' => '',
// )

// JSON body
$client->post('_action/system-config', [
    'key' => 'value',
]);

// header support
$client->post('_action/order/00000000000000000000000000000000/state/complete', [], [], [
    // do not run flows to silently update order state
    'sw-skip-trigger-flow' => 1,
]);

StoreAPI - GenericClient

<?php

use Heptacom\HeptaConnect\Package\Shopware6\Http\StoreApi\Utility\GenericClient;

/** @var $client GenericClient */
// low amount of parameters
var_export($client->get('context')['token']);
// 12c9a85D538b4795877A95aC908987db

// different methods
var_export(\array_column($client->post('country')['data'], 'iso'));
// array (
//   0 => 'AD',
//   1 => 'AE',
//   2 => 'AF',
//   3 => 'AG',
//   4 => 'AI',
//   …

System requirements

  • PHP 8.0 or above

Changelog

See the attached CHANGELOG.md file for a complete version history and release notes.

ADR

See the Architecture Decision Records to understand decisions made, that influence the structure of this project.

Additional development requirements

  • Make
  • Any debugging/coverage php extension like xdebug or pcov
  • A running Shopware 6 instance

Contributing

Thank you for considering contributing to this package! Be sure to sign the CLA after creating the pull request. CLA assistant

Steps to contribute

  1. Fork the repository
  2. git clone yourname/heptaconnect-package-shopware-6
  3. Make your changes to master branch
  4. Create your Pull-Request

Check your changes

  1. Compare your code against the project ADRs
  2. Check and fix code style make cs-fix && make cs
  3. Setup Shopware 6 instance for testing. Checkout dockware.io for a Shopware 6 development instance
    • Set TEST_ADMIN_API_URL, TEST_ADMIN_API_USERNAME, TEST_ADMIN_API_PASSWORD to point to your Shopware 6 instance
    • Optionally set TEST_STORE_API_URL, TEST_STORE_API_ACCESS_KEY to point to your Shopware 6 instance. If not set the Admin API credentials will be used to create the data
  4. Check tests make -e test
  5. Check whether test code coverage is same or higher make -e coverage
  6. Check whether tests can find future obscurities make -e infection

License

Copyright 2020 HEPTACOM GmbH

Dual licensed under the GNU Affero General Public License v3.0 (the "License") and proprietary license; you may not use this project except in compliance with the License. You may obtain a copy of the AGPL License at https://spdx.org/licenses/AGPL-3.0-or-later.html. Contact us on our website for further information about proprietary usage.

heptacom/heptaconnect-package-shopware-6 适用场景与选型建议

heptacom/heptaconnect-package-shopware-6 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 17 次下载、GitHub Stars 达 4, 最近一次更新时间为 2023 年 04 月 27 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「ecommerce」 「shopware」 「shopware 6」 「heptaconnect-package」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 heptacom/heptaconnect-package-shopware-6 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 heptacom/heptaconnect-package-shopware-6 我们能提供哪些服务?
定制开发 / 二次开发

基于 heptacom/heptaconnect-package-shopware-6 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

  • Stars: 4
  • Watchers: 3
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: AGPL-3.0-or-later
  • 更新时间: 2023-04-27