We will be off from 27/1 (Monday) to 31/1 (Friday) (GMT +7) for our Tet Holiday (Lunar New Year) in our country

Commit 856fcfbe authored by Rik ter Beek's avatar Rik ter Beek

#97 solve issue that agreement checkbox is not passed to server

parent 8966bb0a
......@@ -27,9 +27,10 @@ define(
'mage/storage',
'Magento_Checkout/js/model/error-processor',
'Magento_Customer/js/model/customer',
'Magento_Checkout/js/model/full-screen-loader'
'Magento_Checkout/js/model/full-screen-loader',
'Magento_CheckoutAgreements/js/model/agreements-assigner'
],
function ($, quote, urlBuilder, storage, errorProcessor, customer, fullScreenLoader) {
function ($, quote, urlBuilder, storage, errorProcessor, customer, fullScreenLoader, agreementsAssigner) {
'use strict';
var agreementsConfig = window.checkoutConfig.checkoutAgreements;
......@@ -40,18 +41,8 @@ define(
paymentData = quote.paymentMethod();
// check if agreement is enabled if so add it to payload
if (agreementsConfig.isEnabled) {
var agreementForm = $('.payment-method._active form[data-role=checkout-agreements]'),
agreementData = agreementForm.serializeArray(),
agreementIds = [];
agreementData.forEach(function(item) {
agreementIds.push(item.value);
});
paymentData.extension_attributes = {agreement_ids: agreementIds};
}
// use core code to assign the agreement
agreementsAssigner(paymentData);
/** Checkout for guest and registered customer. */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment