Add additional Storefront URL with CLI

I install Shopware 6 on CLI. My shop is reachable over HTTP and HTTPS.

The cli-installer will create a storefront with my given URL like https://demo.shop.

My problem now is that I need the shop to be reachable without TLS too. How can I add another Storefront URL?

I tried to use the command bin/console sales-channel:create:storefront --id=e28bf43c262f4343938a7b8a841ed136 --url=http://demo.shop but this will fail with

6:06:05 CRITICAL [console] Error thrown while running command "sales-channel:create:storefront --id=e28bf43c262f4343938a7b8a841ed136 --url='http://demo.shop'". Message: "Expected command for "sales_channel" to be "Shopware\Core\Framework\DataAbstractionLayer\Write\Command\InsertCommand". (Got: Shopware\Core\Framework\DataAbstractionLayer\Write\Command\UpdateCommand)" ["exception" => Shopware\Core\Framework\DataAbstractionLayer\Write\Command\WriteTypeIntendException^ { …},"command" => "sales-channel:create:storefront --id=e28bf43c262f4343938a7b8a841ed136 --url='http://demo.shop'","message" => "Expected command for "sales_channel" to be "Shopware\Core\Framework\DataAbstractionLayer\Write\Command\InsertCommand". (Got: Shopware\Core\Framework\DataAbstractionLayer\Write\Command\UpdateCommand)"]

How can I solve this?

Upvotes: 3

Views: 1145

Answers (1)

dneustadt
dneustadt

Reputation: 13161

As the name of the command suggests it is only meant to create new sales channels, not for updating an existing one.

Why not create the additional domain using the administration web-interface?

If you can't access the web-interface for some reason you could change the domain with the command bin/console sales-channel:update:domain instead. This will change the domain for all sales channels unless you provide a specific one to replace. See the help option of the command regarding that.

To actually create additional sales channel domains you may also use the API endpoint, see here or here.

Upvotes: 3

Related Questions