Skip to content

Instantly share code, notes, and snippets.

@gil--
Forked from xmcp123/shopify_delete_orders.js
Created December 18, 2018 21:58
Show Gist options
  • Save gil--/1722ad8efe8dd9313e957463c3d30120 to your computer and use it in GitHub Desktop.
Save gil--/1722ad8efe8dd9313e957463c3d30120 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