shopgate/cart-integration-shopware6

Shopware 6 的 Shopgate 购物应用插件

安装数: 14,132

依赖: 0

建议者: 0

安全性: 0

星标: 2

关注者: 9

分支: 1

开放问题: 0

类型:shopware-platform-plugin


README

安装

通过 Packagist 安装(推荐)

此插件可在 packagist.org 上找到。要安装,只需将 composer 包添加到 Shopware 的根 composer

cd [shopware6 root folder]
composer require shopgate/cart-integration-shopware6

之后,只需在 root/composer.json 中增加插件版本,然后运行 composer update 以获取最新版本。

文件夹安装

可以通过将插件文件夹复制到 custom/plugins 目录来手动安装。例如 custom/plugins/SgateShopgatePluginSW6。然后您可以像其他插件一样安装并启用它。对于此安装方法,请确保插件文件夹中有一个 vendor 目录,因为我们有 composer 依赖项。您可以通过运行以下命令来执行此操作

cd [plugin folder]
# this is because we do not want to install shopware core files
composer remove shopware/core

Composer 符号链接(开发)

将插件放在 custom/plugins 文件夹中。现在您可以通过在根目录中运行此命令将其链接到 composer

cd custom/plugins
git clone git@github.com:shopgate/cart-integration-shopware6.git
cd ../..
composer require shopgate/cart-integration-shopware6

启用并激活

安装并激活模块

cd [shopware6 root folder]
php bin/console plugin:refresh
php bin/console plugin:install -a SgateShopgatePluginSW6

如果您喜欢,也可以通过 Shopware 管理面板安装和激活。

索引

安装或更新到 3.3.0+ 后需要完全重新索引才能使产品 -> 类别导出工作。可以通过管理员:Admin > 设置 > 系统 > 缓存 > 更新索引 来完成

也可以通过 CLI 完成

bin/console dal:refresh:index

也可以通过 API 完成,有关详细信息,请参阅 tests/Postman/indexer_check.collection.json

已知错误

  • 没有对应的 SaleChannel 域与 SaleChannel 默认语言匹配 - 表明当为域设置默认语言时,但不存在具有该语言的域 URL。简而言之
    1. 转到 SalesChannels
    2. 选择 Shopgate API 正在查询的 SaleChannel
    3. 检查 通用设置 默认语言(例如,英语)
    4. 检查 列表,确认没有默认语言的域 URL(例如,英语)
  • 无法声明接口 XXX,因为该名称已被使用 - 在通过符号链接安装我们的插件后发生。这是因为我们的插件文件夹中有一个 vendor 目录。您可以从我们的插件目录中删除 vendor 目录 或者 不要通过符号链接安装。这是安装我们的插件的两种不同方式。
  • ConstraintViolationException: 在执行 check_cart 或客户注册期间捕获了 1 个违规错误。已知错误之一是当 Shopgate 应用不需要设置电话号码时,但 Shopware 需要。所以当 check_cart 尝试创建地址时,会发生约束违规。
  • 导出价格太长(例如 "unit_amount":2.3999999999999999) - 存在一个服务器设置可以帮助将价格缩小到 3 位小数,简而言之,尝试 php.ini 设置 serialize_precision = -1。有关详细信息,请参阅 stack

配置

管理

导出
  • Flysystem - 使用 Flysystem 编写 SDK 文件导出

电子邮件模板变量使用

用于创建订单电子邮件

{% set shopgateOrder = order.extensions.shopgateOrder|default(false) %}

Selected shipping type:
{% if shopgateOrder %}
  {{ shopgateOrder.getShippingMethodName() }}
{% else %}
  {{ delivery.shippingMethod.translated.name }}
{% endif %}

Payment Type:
{% if shopgateOrder %}
  {{ shopgateOrder.getPaymentMethodName() }}
{% endif %}

设置 API

  • 服务器 - livepgcustom
  • api_url - http://my.url.com
  • product_types_to_export - simple,variant(逗号分隔列表)

自定义字段

这些值可以在Shopgate管理面板或脚本中设置,以传递给Shopware,并将绑定到实体。还可以将不存在的或现有的自定义字段传递给Shopware。如果一个实体(例如订单)存在自定义集,并且它定义了自定义字段,则将其映射。

客户

  • title - 客户标题
  • affiliate_code
  • campaign_code
  • account_type - businessprivate
  • vat_ids - 提供一个 单个 税号,要设置此字段,则accountType必须为business

客户地址

  • department - 公司部门
  • phone_number - 电话号码可以通过customFields传递,作为address->phone的替代

订单

  • affiliate_code
  • campaign_code
  • customer_comment - 来自客户的注释字符串