diff --git a/src/Compatibility/DependencyLoader.php b/src/Compatibility/DependencyLoader.php index 798914888..0565fa881 100644 --- a/src/Compatibility/DependencyLoader.php +++ b/src/Compatibility/DependencyLoader.php @@ -48,6 +48,11 @@ public function loadServices(): void $loader->load('compatibility/flowbuilder/6.4.6.0.xml'); } + if ($versionCompare->gte('6.6.0.0')){ + $loader->load('compatibility/service_6.6.0.0.xml'); + } + + $composerDevReqsInstalled = file_exists(__DIR__ . '/../../vendor/bin/phpunit'); if ($composerDevReqsInstalled) { diff --git a/src/Resources/config/compatibility/service_6.6.0.0.xml b/src/Resources/config/compatibility/service_6.6.0.0.xml new file mode 100644 index 000000000..899ec4d20 --- /dev/null +++ b/src/Resources/config/compatibility/service_6.6.0.0.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Resources/config/services/services.xml b/src/Resources/config/services/services.xml index f2859303a..1563d168e 100644 --- a/src/Resources/config/services/services.xml +++ b/src/Resources/config/services/services.xml @@ -126,7 +126,7 @@ - + diff --git a/src/Service/CartService.php b/src/Service/CartService.php index ce91264af..de8bf9b3e 100644 --- a/src/Service/CartService.php +++ b/src/Service/CartService.php @@ -5,8 +5,8 @@ use Kiener\MolliePayments\Compatibility\Gateway\CompatibilityGateway; use Kiener\MolliePayments\Compatibility\Gateway\CompatibilityGatewayInterface; use Shopware\Core\Checkout\Cart\Cart; +use Shopware\Core\Checkout\Cart\LineItemFactoryHandler\ProductLineItemFactory; use Shopware\Core\Checkout\Cart\SalesChannel\CartService as SalesChannelCartService; -use Shopware\Core\Content\Product\Cart\ProductLineItemFactory; use Shopware\Core\Framework\Validation\DataBag\DataBag; use Shopware\Core\System\SalesChannel\Context\SalesChannelContextService; use Shopware\Core\System\SalesChannel\SalesChannel\SalesChannelContextSwitcher; @@ -60,7 +60,7 @@ public function addProduct(string $productId, int $quantity, SalesChannelContext { $cart = $this->getCalculatedMainCart($context); - $productItem = $this->productItemFactory->create($productId, ['quantity' => $quantity]); + $productItem = $this->productItemFactory->create(['id'=>$productId, 'quantity' => $quantity],$context); return $this->swCartService->add($cart, $productItem, $context); } diff --git a/tests/Cypress/cypress/e2e/admin/plugin-config.cy.js b/tests/Cypress/cypress/e2e/admin/plugin-config.cy.js index f3a48d086..6ec6b579d 100644 --- a/tests/Cypress/cypress/e2e/admin/plugin-config.cy.js +++ b/tests/Cypress/cypress/e2e/admin/plugin-config.cy.js @@ -64,7 +64,7 @@ context("Plugin Config", () => { cy.contains('Request support from Mollie'); // the modal should show the Shopware version number - cy.contains("v" + shopware.getVersion()); + cy.contains("v" + shopware.getDisplayedVersion()); // the send button is disabled until data is filled in cy.get('.sw-button-process').should('be.disabled'); diff --git a/tests/Cypress/cypress/support/actions/admin/AdminLoginAction.js b/tests/Cypress/cypress/support/actions/admin/AdminLoginAction.js index 8b76a678e..2f8f3dcda 100644 --- a/tests/Cypress/cypress/support/actions/admin/AdminLoginAction.js +++ b/tests/Cypress/cypress/support/actions/admin/AdminLoginAction.js @@ -15,6 +15,7 @@ export default class AdminLoginAction { cy.get('#sw-field--password').type('shopware'); cy.get('.sw-button').click(); + cy.wait(2000); } } diff --git a/tests/Cypress/cypress/support/actions/store-api/StoreApiLoginAction.js b/tests/Cypress/cypress/support/actions/store-api/StoreApiLoginAction.js index 021365eca..c8c834e7b 100644 --- a/tests/Cypress/cypress/support/actions/store-api/StoreApiLoginAction.js +++ b/tests/Cypress/cypress/support/actions/store-api/StoreApiLoginAction.js @@ -95,7 +95,10 @@ export default class StoreApiLoginAction { ); cy.wrap(loginPromise).then((response) => { - const loginToken = response.data.contextToken; + let loginToken = response.data.contextToken; + if(loginToken === undefined){ + loginToken = response.headers["sw-context-token"]; + } this.client.setContextToken(loginToken); cy.log('Context-Token: ' + loginToken); }); diff --git a/tests/Cypress/cypress/support/services/shopware/Shopware.js b/tests/Cypress/cypress/support/services/shopware/Shopware.js index 932c85b7b..ca1b5ac97 100644 --- a/tests/Cypress/cypress/support/services/shopware/Shopware.js +++ b/tests/Cypress/cypress/support/services/shopware/Shopware.js @@ -13,6 +13,14 @@ export default class Shopware { return Cypress.env().SHOPWARE; } + /** + * sometimes we test RC versions, and shopware display the version differently in the admin + * @returns {string} + */ + getDisplayedVersion(){ + return Cypress.env().SHOPWARE.replace('-rc',' RC '); + } + /** * * @returns {string}