我们将用于测试的 Shopware 5 系统从 5.6.10 升级到 5.7.6
现在控制台命令
hpr:orders:export
不见了。
这是来自不再官方支持的市场模块 - 问题是是否有一种简单的方法来修补它。
旧安装:
php7.2 ./console |grep hpr
hpr
hpr:orders:export Starting the export (as defined in the plugin-config) of the orders. Options are mostly the same as the REST-API options.
升级后:
php7.4 ./console |grep hpr
(no output)
在5.7 的升级指南中,它指出 Symfony 已升级……但没有直接提及与此相关的重大更改。
namespace HPrAutomaticOrderExport\Components;
use Exception;
use Shopware\Commands\ShopwareCommand;
use Shopware\Components\Plugin\ConfigReader;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
class CLICommand extends ShopwareCommand
{
protected function configure()
{
$this->setName('hpr:orders:export');
$this->setDescription('Starting the export (as defined in the plugin-config) of the orders. Options are mostly the same as the REST-API options.');
$this->addOption('states', null, InputOption::VALUE_OPTIONAL, 'coma seperated list of order-states ids to filter output');
$this->addOption('statespayment', null, InputOption::VALUE_OPTIONAL, 'coma seperated list of payment-states ids to filter output');
$this->addOption('range', null, InputOption::VALUE_OPTIONAL, 'date range: startdate,enddate'); //TODO syntax for today - n days would be great!!!!!!
$this->addOption('start', null, InputOption::VALUE_OPTIONAL, 'start index in list of orders (defaukt is 0, beginning of the list)');
$this->addOption('limit', null, InputOption::VALUE_OPTIONAL, 'maximal count of orders to export (default is 100)');
$this->addOption('number', null, InputOption::VALUE_OPTIONAL, 'number of a single order');
$this->addOption('exportall', null, InputOption::VALUE_OPTIONAL, 'export all orders, ignore states');
}
该插件已启用:
php7.4 console sw:plugin:list|grep Order
| HPrAutomaticOrderExport | Automatic XML Order-Export Standard
| 3.7.1 | Windeit Software GmbH | Yes | Yes |
services.xml编辑
<service id="hp_order_export_command" class="HPrAutomaticOrderExport\Components\CLICommand">
<tag name="console.command" />
<argument type="service" id="shopware.plugin.config_reader"/>
<argument type="service" id="hp_order_export_service"/>
</service>
更新我们刚刚禁用了这个插件,因为我们真的不需要它——我仍然把它留给更多的读者。