File tree Expand file tree Collapse file tree 3 files changed +12
-8
lines changed
Braintree/view/adminhtml/web/js
Sales/view/adminhtml/templates/order/create/billing/method
dev/tests/integration/testsuite/Magento/Sales/Block/Adminhtml/Order/Create/Billing/Method Expand file tree Collapse file tree 3 files changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -145,6 +145,8 @@ define([
145
145
_initBraintree : function ( ) {
146
146
var self = this ;
147
147
148
+ this . disableEventListeners ( ) ;
149
+
148
150
self . braintree . setup ( self . clientToken , 'custom' , {
149
151
id : self . selector ,
150
152
hostedFields : self . getHostedFields ( ) ,
@@ -154,6 +156,7 @@ define([
154
156
*/
155
157
onReady : function ( ) {
156
158
$ ( 'body' ) . trigger ( 'processStop' ) ;
159
+ self . enableEventListeners ( ) ;
157
160
} ,
158
161
159
162
/**
Original file line number Diff line number Diff line change 12
12
$ _methods = $ block ->getMethods ();
13
13
$ _methodsCount = count ($ _methods );
14
14
$ _counter = 0 ;
15
+ $ currentSelectedMethod = $ block ->getSelectedMethodCode ();
15
16
?>
16
17
<?php foreach ($ _methods as $ _method ) :
17
18
$ _code = $ _method ->getCode ();
24
25
type="radio" name="payment[method]"
25
26
title="<?= $ block ->escapeHtml ($ _method ->getTitle ()); ?> "
26
27
onclick="payment.switchMethod('<?= $ block ->escapeHtml ($ _code ); ?> ')"
27
- <?php if ($ block -> getSelectedMethodCode () == $ _code ) : ?>
28
+ <?php if ($ currentSelectedMethod == $ _code ) : ?>
28
29
checked="checked"
29
30
<?php endif ; ?>
30
31
<?php $ className = ($ _counter == $ _methodsCount ) ? ' validate-one-required-by-name ' : '' ; ?>
39
40
</span>
40
41
<?php endif ;?>
41
42
42
- <label class="admin__field-label"
43
- for="p_method_ <?= $ block -> escapeHtml ( $ _code ); ?> "> <?= $ block ->escapeHtml ($ _method ->getTitle ()) ?>
43
+ <label class="admin__field-label" for="p_method_ <?= $ block -> escapeHtml ( $ _code ); ?> ">
44
+ <?= $ block ->escapeHtml ($ _method ->getTitle ()) ?>
44
45
</label>
45
46
</dt>
46
47
<dd class="admin__payment-method-wrapper">
55
56
'Magento_Sales/order/create/form'
56
57
], function(mage) {
57
58
mage.apply();
58
- order.setPaymentMethod('<?= $ block ->escapeHtml ($ block ->getSelectedMethodCode ()); ?> ');
59
+ <?php if ($ _methodsCount !== 1 ) : ?>
60
+ order.setPaymentMethod('<?= $ block ->escapeHtml ($ currentSelectedMethod ); ?> ');
61
+ <?php else : ?>
62
+ payment.switchMethod('<?= $ block ->escapeHtml ($ currentSelectedMethod ); ?> ');
63
+ <?php endif ; ?>
59
64
});
60
65
</script>
61
66
<?php else : ?>
Original file line number Diff line number Diff line change @@ -47,9 +47,5 @@ public function testContentUpdated()
47
47
48
48
$ html = $ block ->toHtml ();
49
49
$ this ->assertContains ('mage.apply() ' , $ html );
50
- $ this ->assertContains (
51
- "order.setPaymentMethod(' " . $ block ->escapeHtml ($ block ->getSelectedMethodCode ()) . "') " ,
52
- $ html
53
- );
54
50
}
55
51
}
You can’t perform that action at this time.
0 commit comments