File tree Expand file tree Collapse file tree 7 files changed +57
-6
lines changed
.github/workflows/templates/magento
Observer/SalesQuoteCollectTotalsBefore Expand file tree Collapse file tree 7 files changed +57
-6
lines changed Original file line number Diff line number Diff line change @@ -46,6 +46,9 @@ bin/magento config:set payment/mollie_methods_twint/active 1
46
46
# Enable Components
47
47
bin/magento config:set payment/mollie_methods_creditcard/use_components 1
48
48
49
+ # Set a default payment method
50
+ bin/magento config:set payment/mollie_general/default_selected_method mollie_methods_ideal
51
+
49
52
# Disable webhooks
50
53
bin/magento config:set payment/mollie_general/use_webhooks custom_url
51
54
@@ -60,6 +63,10 @@ bin/magento config:set payment/mollie_general/currency 0 --scope=ch --scope-code
60
63
bin/magento config:set currency/options/default PLN --scope=pl --scope-code=ch
61
64
bin/magento config:set payment/mollie_general/currency 0 --scope=pl --scope-code=ch
62
65
66
+ # Disable flat catalog
67
+ bin/magento config:set catalog/frontend/flat_catalog_category 0
68
+ bin/magento config:set catalog/frontend/flat_catalog_product 0
69
+
63
70
# Disable the use of the base currency
64
71
bin/magento config:set payment/mollie_general/currency 0
65
72
Original file line number Diff line number Diff line change 13
13
use Magento \Framework \App \Config \ScopeConfigInterface ;
14
14
use Magento \Framework \Event \Observer ;
15
15
use Magento \Framework \Event \ObserverInterface ;
16
+ use Magento \Framework \Exception \State \InvalidTransitionException ;
16
17
use Magento \Quote \Api \Data \PaymentInterfaceFactory ;
17
18
use Magento \Quote \Api \PaymentMethodManagementInterface ;
18
19
use Magento \Quote \Model \Quote ;
@@ -35,7 +36,7 @@ public function __construct(
35
36
Config $ config ,
36
37
PaymentInterfaceFactory $ paymentFactory ,
37
38
StoreManagerInterface $ storeManager ,
38
- PaymentMethodManagementInterface $ paymentMethodManagement,
39
+ PaymentMethodManagementInterface $ paymentMethodManagement
39
40
) {
40
41
$ this ->paymentFactory = $ paymentFactory ;
41
42
$ this ->config = $ config ;
@@ -78,7 +79,11 @@ public function execute(Observer $observer): void
78
79
$ payment ->setMethod ($ defaultMethod );
79
80
80
81
$ quote ->setPayment ($ payment );
81
- $ this ->paymentMethodManagement ->set ($ quote ->getId (), $ payment );
82
+ try {
83
+ $ this ->paymentMethodManagement ->set ($ quote ->getId (), $ payment );
84
+ } catch (InvalidTransitionException $ exception ) {
85
+ // We are not able to set the payment method. Probably the address is not set yet.
86
+ }
82
87
}
83
88
84
89
/**
Original file line number Diff line number Diff line change 15
15
<referenceContainer name =" magewire.plugin.scripts" >
16
16
<block name =" checkout.payment.methods.after.mollie_methods_applepay"
17
17
as =" mollie_methods_applepay_after"
18
- template =" Mollie_HyvaCheckout::component/payment/method/applepay_after.phtml" >
18
+ template =" Mollie_HyvaCheckout::component/payment/method/applepay_after.phtml"
19
+ ifconfig =" payment/mollie_methods_applepay/active"
20
+ >
19
21
<arguments >
20
22
<argument name =" magewire" xsi : type =" object" >
21
23
Mollie\HyvaCheckout\Magewire\Checkout\Payment\Method\ApplePay
25
27
26
28
<block name =" checkout.payment.methods.after.mollie_methods_creditcard"
27
29
as =" mollie_methods_creditcard_after"
28
- template =" Mollie_HyvaCheckout::component/payment/method/creditcard_after.phtml" >
30
+ template =" Mollie_HyvaCheckout::component/payment/method/creditcard_after.phtml"
31
+ ifconfig =" payment/mollie_methods_creditcard/active"
32
+ >
29
33
<arguments >
30
34
<argument name =" magewire" xsi : type =" object" >
31
35
Mollie\HyvaCheckout\Magewire\Checkout\Payment\Method\Creditcard
35
39
36
40
<block name =" checkout.payment.methods.after.mollie_methods_pointofsale"
37
41
as =" mollie_methods_pointofsale_after"
38
- template =" Mollie_HyvaCheckout::component/payment/method/pointofsale_after.phtml" >
42
+ template =" Mollie_HyvaCheckout::component/payment/method/pointofsale_after.phtml"
43
+ ifconfig =" payment/mollie_methods_pointofsale/active"
44
+ >
39
45
<arguments >
40
46
<argument name =" magewire" xsi : type =" object" >
41
47
Mollie\HyvaCheckout\Magewire\Checkout\Payment\Method\WithTerminal
Original file line number Diff line number Diff line change 63
63
<referenceContainer name =" hyva.checkout.main" >
64
64
<block name =" checkout.payment.methods.after.mollie_methods_applepay"
65
65
as =" mollie_methods_applepay_after"
66
- template =" Mollie_HyvaCheckout::component/payment/method/applepay_after.phtml" />
66
+ template =" Mollie_HyvaCheckout::component/payment/method/applepay_after.phtml"
67
+ ifconfig =" payment/mollie_methods_applepay/active"
68
+ />
67
69
</referenceContainer >
68
70
69
71
<referenceContainer name =" price-summary.total-segments" >
Original file line number Diff line number Diff line change @@ -15,6 +15,11 @@ export default class CheckoutPaymentPage {
15
15
const methodRow = page . locator ( '#payment-method-list > div' ) . filter ( { hasText : name } ) ;
16
16
const input = methodRow . locator ( 'input' ) ;
17
17
18
+ if ( await input . isChecked ( ) ) {
19
+ // If the input is already checked, we can skip clicking it again
20
+ return ;
21
+ }
22
+
18
23
await input . click ( ) ;
19
24
20
25
await hyvaCheckout . waitForLoaderWithText ( page , 'Saving method' ) ;
Original file line number Diff line number Diff line change @@ -25,5 +25,7 @@ export default class ProductPage {
25
25
const productTitle = await page . locator ( '[data-ui-id="page-title-wrapper"]' ) . innerText ( ) ;
26
26
await page . getByText ( `You added ${ productTitle } to your shopping cart.` ) . waitFor ( { state : 'visible' } ) ;
27
27
await page . locator ( '#menu-cart-icon span' ) . waitFor ( { state : 'visible' } ) ;
28
+
29
+ return productTitle ;
28
30
}
29
31
}
Original file line number Diff line number Diff line change
1
+ /*
2
+ * Copyright Magmodules.eu. All rights reserved.
3
+ * See COPYING.txt for license details.
4
+ */
5
+
6
+ import { test , expect } from '@playwright/test' ;
7
+ import ProductPage from "Pages/frontend/ProductPage" ;
8
+
9
+ const productPage = new ProductPage ( ) ;
10
+
11
+ test ( '[C4251741] Can add multiple products to the cart' , async ( { page } ) => {
12
+ await productPage . openProduct ( page , 4 ) ;
13
+ const product1Name = await productPage . addSimpleProductToCart ( page , 1 ) ;
14
+
15
+ await productPage . openProduct ( page , 5 ) ;
16
+ const product2Name = await productPage . addSimpleProductToCart ( page , 1 ) ;
17
+
18
+ await page . goto ( '/checkout/cart' ) ;
19
+
20
+ await expect ( page . locator ( '#shopping-cart-table .cart.item' ) ) . toHaveCount ( 2 ) ;
21
+
22
+ await page . locator ( '#shopping-cart-table' ) . getByText ( product1Name ) . waitFor ( { state : 'visible' } ) ;
23
+ await page . locator ( '#shopping-cart-table' ) . getByText ( product2Name ) . waitFor ( { state : 'visible' } ) ;
24
+ } ) ;
You can’t perform that action at this time.
0 commit comments