Php – Shopware6: How to add a product to a cart?
TL;DR: how to create and add a LineItem from an existing product to the cart in a plugin? I'm trying to write a plugin to add a Product to a cart when it's not in it already, e.g. to always…
TL;DR: how to create and add a LineItem from an existing product to the cart in a plugin? I'm trying to write a plugin to add a Product to a cart when it's not in it already, e.g. to always…
Trying to extend property with one to many relation to be able to categorize each property group. I did the extension and the migrations. all Seems to be working fine except from saving the relation in the admin panel property…
I have a JS plugin in Shopware 6, that subscribes to two events of another JS plugin: One that fires after the user interacts with the page and one that fires at the end of init(). The latter does nothing.…
I'm working on a Shopware 6 plugin and encountering a warning related to accessing an array key that doesn't exist. Here's the relevant code snippet: $customFields = $order->getCustomFields(); $optin = null; if (array_key_exists('swag_product_reviews_optin', $customFields)) { $optin = $customFields['swag_product_reviews_optin']; } $text…
The problem I'm having: I get a mixed content error when adding a reverse proxy before the Docker container running a Caddy server, PHP, MySQL and myPhpAdmin in another container. Here is my setup and an quick drawing of what…
We try to establish browser language (Accept-Language header) based redirects in our Shopware 6 systems as an addition to the standard .htaccess file. We managed to do so for the root URLs, i.e. example.com/ -> example.com/de/ (if the browser language…
I'm trying to change shipping method in shopware6 programmatically, but I'm not succeeding. I will not get any error or exception, there just will not be changed anything. class: <?php declare(strict_types=1); namespace WtShippingCalcCoreCheckoutCart; use JetBrainsPhpStormNoReturn; use ShopwareCoreCheckoutCartCart; use ShopwareCoreCheckoutCartCartBehavior; use…
After successfully installing shopware on my machine, i was able to setup and open admin panel. but than if i open demo home page, this is what i see: what am i doing wrong here?
I am currently using dockware in my shell scripts to get Shopware docker images for testing. However, dockware takes some time to upload the latest Shopware versions after they are released, like 6.5.7.0. I would like to be able to…
I'm running a Bash script on Windows Git Bash that uses docker exec to set config values in my Shopware container: docker exec -d $SHOPWARE_CONTAINER_ID php bin/console system:config:set $PLUGIN_NAME.config.active true But I get an error that the config value must…