feat: add custom/not_specified shipping modes with cost input for ML publish
- build_item_payload supports shipping_cost for custom mode with costs array - Add shipping mode selector: me2, custom, not_specified - Show shipping cost input when custom is selected - Backend passes shipping_cost through custom_data to payload builder
This commit is contained in:
@@ -993,9 +993,20 @@
|
||||
}
|
||||
});
|
||||
|
||||
window.onMeliShippingChange = function() {
|
||||
var mode = document.getElementById('meliShippingMode').value;
|
||||
var costField = document.getElementById('meliShippingCostField');
|
||||
if (costField) costField.style.display = (mode === 'custom') ? 'block' : 'none';
|
||||
};
|
||||
|
||||
function _collectMeliCustomData() {
|
||||
var ids = Array.from(selectedItems);
|
||||
var customData = { titles: {}, prices: {}, stocks: {}, attributes: {} };
|
||||
var mode = document.getElementById('meliShippingMode').value;
|
||||
if (mode === 'custom') {
|
||||
var costEl = document.getElementById('meliShippingCost');
|
||||
if (costEl) customData.shipping_cost = parseFloat(costEl.value) || 0;
|
||||
}
|
||||
ids.forEach(function(id) {
|
||||
var titleEl = document.getElementById('meliTitle-' + id);
|
||||
var priceEl = document.getElementById('meliPrice-' + id);
|
||||
|
||||
Reference in New Issue
Block a user