Skip to content

Commit 8df61e0

Browse files
author
Natalia Momotenko
committed
MAGETWO-53172: Broken markup for Gift Options in Multiple Address Checkout
- Merge remote-tracking branch 'origin/MAGETWO-53172' into bugfixes - Conflicts: - app/design/frontend/Magento/blank/Magento_GiftMessage/web/css/source/_module.less - app/design/frontend/Magento/luma/Magento_GiftMessage/web/css/source/_module.less
2 parents 67e29b2 + e38fbfe commit 8df61e0

File tree

7 files changed

+360
-211
lines changed

7 files changed

+360
-211
lines changed

app/code/Magento/GiftMessage/view/frontend/templates/inline.phtml

Lines changed: 40 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@
2828

2929
<dd id="allow-gift-options-for-order-container" class="order-options">
3030
<div class="options-order-container" id="options-order-container-<?php /* @escapeNotVerified */ echo $block->getEntity()->getId() ?>"></div>
31-
<a href="#" class="action activate message" data-mage-init='{"toggleAdvanced": {"selectorsToggleClass":"hidden", "toggleContainers":"#allow-gift-messages-for-order-container"}}'><?php /* @escapeNotVerified */ echo __('Gift Message') ?></a>
31+
<button class="action action-gift"
32+
data-mage-init='{"toggleAdvanced": {"selectorsToggleClass":"hidden", "toggleContainers":"#allow-gift-messages-for-order-container"}}'>
33+
<span><?php /* @escapeNotVerified */ echo __('Gift Message') ?></span>
34+
</button>
3235
<div id="allow-gift-messages-for-order-container" class="gift-messages-order hidden">
3336
<fieldset class="fieldset">
3437
<p><?php /* @escapeNotVerified */ echo __('Leave this box blank if you don\'t want to leave a gift message for the entire order.') ?></p>
@@ -52,13 +55,12 @@
5255
</div>
5356
</fieldset>
5457
<script>
55-
require(['jquery'], function(jQuery){
56-
57-
jQuery('#add-gift-options-<?php /* @escapeNotVerified */ echo $block->getEntity()->getId() ?>')
58-
.add('#add-gift-options-for-order-<?php /* @escapeNotVerified */ echo $block->getEntity()->getId() ?>').removeClass('hidden');
59-
60-
});
61-
</script>
58+
require(['jquery'], function(jQuery){
59+
jQuery('#add-gift-options-<?php /* @escapeNotVerified */ echo $block->getEntity()->getId() ?>')
60+
.add('#add-gift-options-for-order-<?php /* @escapeNotVerified */ echo $block->getEntity()->getId() ?>')
61+
.removeClass('hidden');
62+
});
63+
</script>
6264
</div>
6365
</dd>
6466
<?php endif ?>
@@ -87,7 +89,10 @@ require(['jquery'], function(jQuery){
8789
<div class="options">
8890
<div class="options-items-container" id="options-items-container-<?php /* @escapeNotVerified */ echo $block->getEntity()->getId() ?>-<?php /* @escapeNotVerified */ echo $_item->getId() ?>"></div>
8991
<?php if ($block->isItemMessagesAvailable($_item)): ?>
90-
<a href="#" class="action activate message" data-mage-init='{"toggleAdvanced": {"selectorsToggleClass":"hidden", "toggleContainers":"#gift-messages-for-item-container-<?php /* @escapeNotVerified */ echo $_item->getId() ?>"}}'><?php /* @escapeNotVerified */ echo __('Gift Message') ?></a>
92+
<button class="action action-gift"
93+
data-mage-init='{"toggleAdvanced": {"selectorsToggleClass":"hidden", "toggleContainers":"#gift-messages-for-item-container-<?php /* @escapeNotVerified */ echo $_item->getId() ?>"}}'>
94+
<span><?php /* @escapeNotVerified */ echo __('Gift Message') ?></span>
95+
</button>
9196
<div id="gift-messages-for-item-container-<?php /* @escapeNotVerified */ echo $_item->getId() ?>" class="block message hidden">
9297
<fieldset class="fieldset">
9398
<p><?php /* @escapeNotVerified */ echo __('Leave a box blank if you don\'t want to add a gift message for that item.') ?></p>
@@ -118,24 +123,23 @@ require(['jquery'], function(jQuery){
118123
</ol>
119124
</dd>
120125
<script>
121-
require(['jquery'], function(jQuery){
122-
123-
jQuery('#add-gift-options-<?php /* @escapeNotVerified */ echo $block->getEntity()->getId() ?>')
124-
.add('#add-gift-options-for-items-<?php /* @escapeNotVerified */ echo $block->getEntity()->getId() ?>').removeClass('hidden');
125-
126-
});
127-
</script>
126+
require(['jquery'], function(jQuery){
127+
jQuery('#add-gift-options-<?php /* @escapeNotVerified */ echo $block->getEntity()->getId() ?>')
128+
.add('#add-gift-options-for-items-<?php /* @escapeNotVerified */ echo $block->getEntity()->getId() ?>')
129+
.removeClass('hidden');
130+
});
131+
</script>
128132
<?php endif; ?>
129133
<dt class="extra-options-container" id="extra-options-container-<?php /* @escapeNotVerified */ echo $block->getEntity()->getId() ?>"></dt>
130134
</dl>
131135
</fieldset>
132-
<script type="text/x-magento-init">
133-
{
134-
"#allow_gift_options, #allow_gift_options_for_order, #allow_gift_options_for_items": {
135-
"giftOptions": {}
136+
<script type="text/x-magento-init">
137+
{
138+
"#allow_gift_options, #allow_gift_options_for_order, #allow_gift_options_for_items": {
139+
"giftOptions": {}
140+
}
136141
}
137-
}
138-
</script>
142+
</script>
139143
<?php break; ?>
140144

141145
<?php case 'multishipping_address': ?>
@@ -159,7 +163,10 @@ require(['jquery'], function(jQuery){
159163
<div class="options-order-container" id="options-order-container-<?php /* @escapeNotVerified */ echo $block->getEntity()->getId() ?>"></div>
160164
<?php if ($block->isMessagesAvailable()): ?>
161165
<?php $_giftMessage = true; ?>
162-
<a href="#" class="action activate message" data-mage-init='{"toggleAdvanced": {"selectorsToggleClass":"hidden", "toggleContainers":"#gift-messages-for-order-container-<?php /* @escapeNotVerified */ echo $block->getEntity()->getId() ?>"}}'><?php /* @escapeNotVerified */ echo __('Gift Message') ?></a>
166+
<button class="action action-gift"
167+
data-mage-init='{"toggleAdvanced": {"selectorsToggleClass":"hidden", "toggleContainers":"#gift-messages-for-order-container-<?php /* @escapeNotVerified */ echo $block->getEntity()->getId() ?>"}}'>
168+
<span><?php /* @escapeNotVerified */ echo __('Gift Message') ?></span>
169+
</button>
163170
<div id="gift-messages-for-order-container-<?php /* @escapeNotVerified */ echo $block->getEntity()->getId() ?>" class="gift-messages-order hidden">
164171
<fieldset class="fieldset">
165172
<p><?php /* @escapeNotVerified */ echo __('You can leave this box blank if you don\'t want to add a gift message for this address.') ?></p>
@@ -212,7 +219,10 @@ require(['jquery'], function(jQuery){
212219

213220
<?php if ($block->isItemMessagesAvailable($_item)): ?>
214221
<?php $_giftMessage = true; ?>
215-
<a href="#" class="action activate message" data-mage-init='{"toggleAdvanced": {"selectorsToggleClass":"hidden", "toggleContainers":"#gift-messages-for-item-container-<?php /* @escapeNotVerified */ echo $_item->getId() ?>"}}'><?php /* @escapeNotVerified */ echo __('Gift Message') ?></a>
222+
<button class="action action-gift"
223+
data-mage-init='{"toggleAdvanced": {"selectorsToggleClass":"hidden", "toggleContainers":"#gift-messages-for-item-container-<?php /* @escapeNotVerified */ echo $_item->getId() ?>"}}'>
224+
<span><?php /* @escapeNotVerified */ echo __('Gift Message') ?></span>
225+
</button>
216226
<div id="gift-messages-for-item-container-<?php /* @escapeNotVerified */ echo $_item->getId() ?>" class="block message hidden">
217227
<fieldset class="fieldset">
218228
<p><?php /* @escapeNotVerified */ echo __('You can leave this box blank if you don\'t want to add a gift message for the item.') ?></p>
@@ -247,13 +257,13 @@ require(['jquery'], function(jQuery){
247257
<dt class="extra-options-container" id="extra-options-container-<?php /* @escapeNotVerified */ echo $block->getEntity()->getId() ?>"></dt>
248258
</dl>
249259
</fieldset>
250-
<script type="text/x-magento-init">
251-
{
252-
"#allow_gift_options_<?php /* @escapeNotVerified */ echo $block->getEntity()->getId() ?>, #allow_gift_options_for_order_<?php /* @escapeNotVerified */ echo $block->getEntity()->getId() ?>, #allow_gift_options_for_items_<?php /* @escapeNotVerified */ echo $block->getEntity()->getId() ?>": {
253-
"giftOptions": {}
260+
<script type="text/x-magento-init">
261+
{
262+
"#allow_gift_options_<?php /* @escapeNotVerified */ echo $block->getEntity()->getId() ?>, #allow_gift_options_for_order_<?php /* @escapeNotVerified */ echo $block->getEntity()->getId() ?>, #allow_gift_options_for_items_<?php /* @escapeNotVerified */ echo $block->getEntity()->getId() ?>": {
263+
"giftOptions": {}
264+
}
254265
}
255-
}
256-
</script>
266+
</script>
257267
<?php break; ?>
258268
<?php endswitch ?>
259269
<?php if ($_giftMessage): ?>

app/code/Magento/GiftMessage/view/frontend/web/template/gift-message-item-level.html

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,13 @@
55
*/
66
-->
77
<!-- ko if: isActive() || hasActiveOptions() -->
8-
<a href="#"
9-
class="action action-gift"
10-
data-bind="
11-
click: $data.toggleFormBlockVisibility.bind($data),
12-
css: {_active: formBlockVisibility() || resultBlockVisibility()}
13-
">
8+
<button class="action action-gift"
9+
data-bind="
10+
click: $data.toggleFormBlockVisibility.bind($data),
11+
css: {_active: formBlockVisibility() || resultBlockVisibility()}
12+
">
1413
<span data-bind="i18n: 'Gift options'"></span>
15-
</a>
14+
</button>
1615
<div class="gift-content" data-bind="css: {_active: formBlockVisibility() || resultBlockVisibility()}"> <!-- add class "active" to display the content -->
1716
<!-- ko ifnot: resultBlockVisibility() -->
1817
<div class="gift-options">

app/design/frontend/Magento/blank/Magento_Checkout/web/css/source/module/_cart.less

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,7 @@
276276
text-align: center;
277277
white-space: nowrap;
278278
width: 33%;
279+
279280
&:before {
280281
content: attr(data-th) ':';
281282
display: block;

0 commit comments

Comments
 (0)