Skip to content

Commit

Permalink
🔃 [EngCom] Public Pull Requests - 2.1-develop
Browse files Browse the repository at this point in the history
Accepted Public Pull Requests:
 - #13549: Backport of MAGETWO-80198 for Magento 2.1: Fix issue #10565 #10575 (by @hostep)
 - #13543: Backport of MAGETWO-69379 for Magento 2.1: use payment method name to� (by @hostep)


Fixed GitHub Issues:
 - #10565: Magento ver. 2.1.8 New Product with Custom attribute set not working (reported by @gilbertsohal) has been fixed in #13549 by @hostep in 2.1-develop branch
   Related commits:
     1. d95e15c

 - #6207: Checkbox IDs for Terms and Conditions should be unique in Checkout (reported by @bka) has been fixed in #13543 by @hostep in 2.1-develop branch
   Related commits:
     1. 6ec9e22
  • Loading branch information
magento-engcom-team authored Feb 21, 2018
2 parents afbc7d6 + 785b207 commit 6164f8e
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,26 @@ define(
agreementsModal.showModal();
},

/**
* build a unique id for the term checkbox
*
* @param {Object} context - the ko context
* @param {Number} agreementId
*/
getCheckboxId: function (context, agreementId) {
var paymentMethodName = '',
paymentMethodRenderer = context.$parents[1];

// corresponding payment method fetched from parent context
if (paymentMethodRenderer) {
// item looks like this: {title: "Check / Money order", method: "checkmo"}
paymentMethodName = paymentMethodRenderer.item ?
paymentMethodRenderer.item.method : '';
}

return 'agreement_' + paymentMethodName + '_' + agreementId;
},

/**
* Init modal window for rendered element
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
<div class="checkout-agreement required">
<input type="checkbox" class="required-entry"
data-bind="attr: {
'id': 'agreement_' + agreementId,
'id': $parent.getCheckboxId($parentContext, agreementId),
'name': 'agreement[' + agreementId + ']',
'value': agreementId
}"/>
<label data-bind="attr: {'for': 'agreement_' + agreementId}">
<label data-bind="attr: {'for': $parent.getCheckboxId($parentContext, agreementId)}">
<button type="button"
class="action action-show"
data-bind="click: function(data, event) { return $parent.showContent(data, event) }"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ define([
* @param {Array} data - current component value
*/
setPrepareToSendData: function (data) {
if (!data.length) {
if (_.isUndefined(data) || !data.length) {
data = '';
}

Expand Down

0 comments on commit 6164f8e

Please sign in to comment.