Skip to content

Instantly share code, notes, and snippets.

@standa
Created April 5, 2018 11:10
Show Gist options
  • Save standa/eb11405dcaafced36348fe61fe1d83ff to your computer and use it in GitHub Desktop.
Save standa/eb11405dcaafced36348fe61fe1d83ff to your computer and use it in GitHub Desktop.
Apply a callback to orders you see in /admin/orders grid
var description = 'GoExpress delay of delivery for all the parcels from 3.04, because of Easter';
$('.data-admin input[name="orderIds[]"]').each((k,v) => {
var orderId = v.value
var data = new FormData()
data.append('order-report-type', 7) // DELAY
data.append('order-report-description', description)
var request = new XMLHttpRequest();
request.open("POST", "/admin/order-report/report/orderId/"+orderId);
request.send(data);
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment