Created
March 1, 2018 01:35
-
-
Save xmcp123/d7574b372146fcef52955134256abb59 to your computer and use it in GitHub Desktop.
Delete all orders from a shopify store admin panel.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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