init
This commit is contained in:
@@ -0,0 +1,329 @@
|
||||
.legacy-order-bind-customer-modal .modal-inner-wrap {
|
||||
max-width: 560px;
|
||||
}
|
||||
|
||||
.legacy-order-bind-customer-modal .admin__control-text {
|
||||
margin-top: 8px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.legacy-order-bind-customer-modal .note {
|
||||
color: #777;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.legacy-order-view-modal .modal-inner-wrap {
|
||||
max-width: 1100px;
|
||||
width: 80%;
|
||||
}
|
||||
|
||||
.legacy-order-view-modal .modal-content {
|
||||
background: #f5f6f7;
|
||||
padding: 20px 24px 28px;
|
||||
}
|
||||
|
||||
.legacy-order-modal-loading {
|
||||
color: #777;
|
||||
padding: 60px 20px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.legacy-order-summary {
|
||||
background: linear-gradient(135deg, #282d32 0%, #3b4248 100%);
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 8px 24px rgba(25, 31, 36, .14);
|
||||
color: #fff;
|
||||
overflow: hidden;
|
||||
margin-bottom: 16px;
|
||||
padding: 20px 24px;
|
||||
}
|
||||
|
||||
.legacy-order-summary__header {
|
||||
align-items: center;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.legacy-order-summary__header > div:first-child > span,
|
||||
.legacy-order-summary__total > span {
|
||||
color: #ffb175;
|
||||
display: block;
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
letter-spacing: .08em;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.legacy-order-summary__header h2 {
|
||||
color: #fff;
|
||||
font-size: 22px;
|
||||
margin: 5px 0 0;
|
||||
}
|
||||
|
||||
.legacy-order-summary__total {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.legacy-order-summary__total strong {
|
||||
display: block;
|
||||
font-size: 22px;
|
||||
margin-top: 4px;
|
||||
}
|
||||
|
||||
.legacy-order-summary__grid,
|
||||
.legacy-order-summary__statuses {
|
||||
display: grid;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.legacy-order-summary__grid {
|
||||
grid-template-columns: repeat(4, minmax(0, 1fr));
|
||||
}
|
||||
|
||||
.legacy-order-summary__statuses {
|
||||
grid-template-columns: repeat(3, minmax(0, 1fr));
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
||||
.legacy-order-summary__grid > div,
|
||||
.legacy-order-summary__statuses > div {
|
||||
background: rgba(255, 255, 255, .08);
|
||||
border: 1px solid rgba(255, 255, 255, .1);
|
||||
border-radius: 6px;
|
||||
min-width: 0;
|
||||
padding: 10px 12px;
|
||||
}
|
||||
|
||||
.legacy-order-summary__grid span,
|
||||
.legacy-order-summary__statuses span {
|
||||
color: rgba(255, 255, 255, .6);
|
||||
display: block;
|
||||
font-size: 11px;
|
||||
margin-bottom: 6px;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.legacy-order-summary__grid strong,
|
||||
.legacy-order-summary__statuses strong {
|
||||
color: #fff;
|
||||
display: block;
|
||||
font-size: 14px;
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
|
||||
.legacy-order-summary__link-status {
|
||||
color: #82dcaa !important;
|
||||
}
|
||||
|
||||
.legacy-order-panel {
|
||||
background: #fff;
|
||||
border-radius: 6px;
|
||||
box-shadow: 0 3px 14px rgba(25, 31, 36, .05);
|
||||
box-sizing: border-box;
|
||||
margin-bottom: 16px;
|
||||
padding: 16px 20px 18px;
|
||||
}
|
||||
|
||||
.legacy-order-panel > .admin__page-section-title {
|
||||
align-items: center;
|
||||
border-bottom: 1px solid #e5e5e5;
|
||||
display: flex;
|
||||
margin-bottom: 13px;
|
||||
padding-bottom: 10px;
|
||||
}
|
||||
|
||||
.legacy-order-customer-link__actions,
|
||||
.legacy-order-customer-link__form {
|
||||
align-items: flex-end;
|
||||
display: flex;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.legacy-order-customer-link__form {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.legacy-order-customer-link__form > div {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.legacy-order-customer-link__form label {
|
||||
display: block;
|
||||
font-weight: 600;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
.legacy-order-customer-link__form input {
|
||||
height: 38px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.legacy-order-customer-link__form button,
|
||||
.legacy-order-customer-link__actions > form button {
|
||||
min-height: 38px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.legacy-order-items__count {
|
||||
align-items: center;
|
||||
background: #fff0e8;
|
||||
border-radius: 50%;
|
||||
color: #eb5202;
|
||||
display: inline-flex;
|
||||
font-size: 12px;
|
||||
font-weight: 700;
|
||||
height: 25px;
|
||||
justify-content: center;
|
||||
margin-left: 10px;
|
||||
width: 25px;
|
||||
}
|
||||
|
||||
.legacy-order-items table thead th {
|
||||
background: #f7f8f8;
|
||||
color: #777;
|
||||
font-size: 12px;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.legacy-order-items table td,
|
||||
.legacy-order-items table th {
|
||||
padding: 9px 12px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.legacy-order-items table th:nth-child(n+2),
|
||||
.legacy-order-items table td:nth-child(n+2) {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.legacy-order-items__qty {
|
||||
background: #f0f1f1;
|
||||
border-radius: 14px;
|
||||
display: inline-block;
|
||||
min-width: 22px;
|
||||
padding: 3px 8px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.legacy-order-totals table {
|
||||
margin-left: auto;
|
||||
max-width: 480px;
|
||||
}
|
||||
|
||||
.legacy-order-totals th,
|
||||
.legacy-order-totals td {
|
||||
padding: 5px 10px;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.legacy-order-totals__discount th,
|
||||
.legacy-order-totals__discount td {
|
||||
color: #16894b;
|
||||
}
|
||||
|
||||
.legacy-order-totals__discount small {
|
||||
background: #eaf8f0;
|
||||
border-radius: 3px;
|
||||
margin-left: 6px;
|
||||
padding: 2px 6px;
|
||||
}
|
||||
|
||||
.legacy-order-totals__grand th,
|
||||
.legacy-order-totals__grand td {
|
||||
border-top: 2px solid #333;
|
||||
color: #222;
|
||||
font-size: 18px;
|
||||
font-weight: 700;
|
||||
padding-top: 10px;
|
||||
}
|
||||
|
||||
.legacy-order-information {
|
||||
background: #fff;
|
||||
border-radius: 6px;
|
||||
box-sizing: border-box;
|
||||
margin-bottom: 16px;
|
||||
padding: 16px 20px 20px;
|
||||
}
|
||||
|
||||
.legacy-order-information .admin__page-section-title {
|
||||
border-bottom: 1px solid #e3e3e3;
|
||||
margin-bottom: 14px;
|
||||
padding-bottom: 10px;
|
||||
}
|
||||
|
||||
.legacy-order-information__grid {
|
||||
display: grid;
|
||||
gap: 12px;
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
}
|
||||
|
||||
.legacy-order-information__card {
|
||||
background: #f7f8f8;
|
||||
border: 1px solid #e2e4e4;
|
||||
border-radius: 8px;
|
||||
box-sizing: border-box;
|
||||
min-height: 120px;
|
||||
padding: 16px 18px;
|
||||
}
|
||||
|
||||
.legacy-order-information__card h3 {
|
||||
color: #262626;
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
margin: 0 0 9px;
|
||||
}
|
||||
|
||||
.legacy-order-information__card address,
|
||||
.legacy-order-information__card p {
|
||||
color: #666;
|
||||
font-size: 14px;
|
||||
font-style: normal;
|
||||
line-height: 1.45;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.legacy-order-information__card small {
|
||||
color: #999;
|
||||
display: block;
|
||||
font-size: 13px;
|
||||
margin-top: 5px;
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
|
||||
@media (max-width: 900px) {
|
||||
.legacy-order-view-modal .modal-inner-wrap {
|
||||
width: 94%;
|
||||
}
|
||||
|
||||
.legacy-order-summary__grid {
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
}
|
||||
|
||||
.legacy-order-customer-link__actions,
|
||||
.legacy-order-customer-link__form {
|
||||
align-items: stretch;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.legacy-order-information__grid {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 600px) {
|
||||
.legacy-order-summary__header {
|
||||
align-items: flex-start;
|
||||
flex-direction: column;
|
||||
gap: 18px;
|
||||
}
|
||||
|
||||
.legacy-order-summary__total {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.legacy-order-summary__grid,
|
||||
.legacy-order-summary__statuses {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
define([
|
||||
'jquery',
|
||||
'Magento_Ui/js/grid/columns/actions',
|
||||
'Magento_Ui/js/modal/modal',
|
||||
'mage/translate'
|
||||
], function ($, Actions, modal, $t) {
|
||||
'use strict';
|
||||
|
||||
return Actions.extend({
|
||||
getActionHandler: function (action) {
|
||||
if (action.modal) {
|
||||
return this.openLegacyOrderModal.bind(this, action);
|
||||
}
|
||||
|
||||
return this._super(action);
|
||||
},
|
||||
|
||||
openLegacyOrderModal: function (action) {
|
||||
var $dialog = $('#legacy-order-view-modal');
|
||||
|
||||
if (!$dialog.length) {
|
||||
$dialog = $('<div id="legacy-order-view-modal"/>').appendTo('body');
|
||||
modal({
|
||||
type: 'popup',
|
||||
title: $t('Legacy Order Details'),
|
||||
responsive: true,
|
||||
innerScroll: true,
|
||||
modalClass: 'legacy-order-view-modal',
|
||||
buttons: []
|
||||
}, $dialog);
|
||||
}
|
||||
|
||||
$dialog.html('<div class="legacy-order-modal-loading">' + $t('Loading...') + '</div>');
|
||||
$dialog.modal('openModal');
|
||||
|
||||
$.ajax({
|
||||
url: action.href,
|
||||
type: 'GET',
|
||||
dataType: 'html',
|
||||
showLoader: true
|
||||
}).done(function (html) {
|
||||
$dialog.html(html);
|
||||
}).fail(function () {
|
||||
$dialog.html('<div class="message message-error error"><div>' +
|
||||
$t('Unable to load the legacy order details.') +
|
||||
'</div></div>');
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,98 @@
|
||||
define([
|
||||
'jquery',
|
||||
'Magento_Ui/js/grid/massactions',
|
||||
'Magento_Ui/js/modal/modal',
|
||||
'Magento_Ui/js/modal/alert',
|
||||
'mageUtils',
|
||||
'mage/translate'
|
||||
], function ($, Massactions, modal, alert, utils, $t) {
|
||||
'use strict';
|
||||
|
||||
return Massactions.extend({
|
||||
applyAction: function (actionIndex) {
|
||||
if (actionIndex === 'bind_customer') {
|
||||
this.openBindCustomerModal();
|
||||
this.close();
|
||||
return this;
|
||||
}
|
||||
|
||||
return this._super(actionIndex);
|
||||
},
|
||||
|
||||
openBindCustomerModal: function () {
|
||||
var data = this.getSelections(),
|
||||
action = this.getAction('bind_customer'),
|
||||
$dialog = $('#legacy-order-bind-customer-modal'),
|
||||
self = this;
|
||||
|
||||
if (!data || !data.total) {
|
||||
alert({content: this.noItemsMsg});
|
||||
return;
|
||||
}
|
||||
|
||||
if (!$dialog.length) {
|
||||
$dialog = $(
|
||||
'<div id="legacy-order-bind-customer-modal">' +
|
||||
'<label class="admin__field-label" for="legacy-order-mass-customer"><span>' +
|
||||
$t('Customer ID or Email') +
|
||||
'</span></label>' +
|
||||
'<input id="legacy-order-mass-customer" class="admin__control-text" type="text" />' +
|
||||
'<p class="note">' +
|
||||
$t('All selected orders will be linked to the matching customer in each order website.') +
|
||||
'</p></div>'
|
||||
).appendTo('body');
|
||||
|
||||
modal({
|
||||
type: 'popup',
|
||||
title: $t('Bind Customer'),
|
||||
responsive: true,
|
||||
modalClass: 'legacy-order-bind-customer-modal',
|
||||
buttons: [{
|
||||
text: $t('Cancel'),
|
||||
class: 'action-secondary',
|
||||
click: function () {
|
||||
this.closeModal();
|
||||
}
|
||||
}, {
|
||||
text: $t('Bind Customer'),
|
||||
class: 'action-primary',
|
||||
click: function () {
|
||||
self.submitCustomerBinding(
|
||||
$dialog.data('action'),
|
||||
$dialog.data('selections'),
|
||||
$dialog,
|
||||
this
|
||||
);
|
||||
}
|
||||
}]
|
||||
}, $dialog);
|
||||
}
|
||||
|
||||
$dialog.data('action', action).data('selections', data);
|
||||
$dialog.find('input').val('');
|
||||
$dialog.modal('openModal');
|
||||
window.setTimeout(function () {
|
||||
$dialog.find('input').trigger('focus');
|
||||
}, 100);
|
||||
},
|
||||
|
||||
submitCustomerBinding: function (action, data, $dialog, modalInstance) {
|
||||
var customer = $.trim($dialog.find('input').val()),
|
||||
itemsType,
|
||||
params = {};
|
||||
|
||||
if (!customer) {
|
||||
alert({content: $t('Enter a customer ID or email.')});
|
||||
return;
|
||||
}
|
||||
|
||||
itemsType = data.excludeMode ? 'excluded' : 'selected';
|
||||
params[itemsType] = Array.isArray(data[itemsType]) && data[itemsType].length ?
|
||||
data[itemsType] : false;
|
||||
$.extend(params, data.params || {});
|
||||
params.customer = customer;
|
||||
modalInstance.closeModal();
|
||||
utils.submit({url: action.url, data: params});
|
||||
}
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user