Is there any easy way to show a warning in the orders admin panel whenever client enters something into a non-required customization field? We've had a functionality like that through an (admittedly convoluted and no longer necessary) product designer module and it looked like this, but we've got rid of it and now when reinstalling the module it doesn't seem to work again - obviously even if it did that would not be ideal.
The code i found in that module:
js
if ($('#table-order').length && $('#table-order tbody').length
&& typeof tshirtecommerce_orders_url != 'undefined' && tshirtecommerce_orders_url != '') {
var orders = [];
$('#table-order tbody tr').each(function() {
var id_order = $(this).find('input[name="orderBox[]"]').val();
orders.push(id_order);
});
if (orders.length > 0) {
$.ajax({
type: 'post',
url: tshirtecommerce_orders_url,
data: {'orders': orders},
cache: false,
dataType: 'json',
}).done(function (jsons) {
$('#table-order tbody tr').each(function() {
var id_order = parseInt($(this).find('input[name="orderBox[]"]').val());
console.log(jsons[id_order]);
if (typeof jsons[id_order] != 'undefined' && parseInt(jsons[id_order]) > 0 && typeof tshirtecommerce_customization_product != 'undefined') {
$(this).children().eq(2).append('<br/><span class="tse_customization_text">'+tshirtecommerce_customization_product+'</span>');
}
});
});
}
}
}
css
background-color:#4CAF50;
display: inline-block;
color: #fff;
border-radius: .25em;
padding: 0 2px;
}
However I'm entirely unsure how to port that functionality.