Skip to content

Instantly share code, notes, and snippets.

@xmcp123
Created March 1, 2018 01:35
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save xmcp123/d7574b372146fcef52955134256abb59 to your computer and use it in GitHub Desktop.
Save xmcp123/d7574b372146fcef52955134256abb59 to your computer and use it in GitHub Desktop.
Delete all orders from a shopify store admin panel.
//Run this from /admin/orders/. Paste it into the javascript console and press enter.
function delete_all()
{
l = $("[name*=order_ids_]");
console.log("Found "+l.length+" checkboxes");
for(i=0; i<l.length; i++)
{
name = $(l[i]).attr("name");
if(name.indexOf("order_ids_") > -1)
{
d = name.split("order_ids_");
u = '/admin/orders/'+d[1];
console.log("Posting delete to "+u);
$.post({'url':u, 'data':{'_method':'delete'}})
console.log(d[1]);
}
}
}
delete_all();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment