-
-
Save MichaelLawton/ec73c321d62d1b4eaf0f51ca478ccd92 to your computer and use it in GitHub Desktop.
function deleteSavedItems() { | |
var query = document.querySelectorAll("#sc-saved-cart input[value=Delete]") | |
if (query.length) { | |
query[0].click(); | |
} | |
if (query.length > 1) { | |
setTimeout(deleteSavedItems,100); | |
} | |
else { | |
console.log('Finished'); | |
} | |
} | |
deleteSavedItems(); |
I've modified this to work in 2024:
function deleteSavedItems() {
var elements = document.querySelectorAll("input[name^='submit.delete.']");
if (elements.length > 0) {
elements.forEach(function(element) {
element.click();
});
setTimeout(deleteSavedItems, 100);
} else {
console.log('Finished');
}
}
deleteSavedItems();
Should you desire to move your items to a Wish List instead of deleting them for good, you can do so with a slight extension to the great script already provided by @MichaelLawton. You'll need to view the source of your Shopping Cart page to get the list/registry ID of your specific list to save them to (should look something like "#registry-XXXXXXXXXXXXX").
function moveToWishList() { var query = document.querySelectorAll("#sc-saved-cart input[value='Move to Wish List']") if (query.length) { query[0].click(); } var query2 = document.querySelectorAll("#registry-XXXXXXXXXXXXX a") if (query2.length) { query2[0].click(); } if (query.length > 1) { setTimeout(moveToWishList,5000); } else { console.log('Finished'); } } moveToWishList();
THANK YOU!! @PeterSchuebel , @MichaelLawton and @kyletmiller
Can we do/ add a similar script (direct or via Grease Monkey etc) or via an Extension to do this WishList action(s)?
Amazon Wishlists: Select and Move multiple items at same time from One/ Default Wishlist to others?
Have collected a lot of items on Default Wishlist and would like to MOVE and organize them.
As shown below, one has to select each item one at time from a Default Wishlist to MOVE it to other ones to Organize them.
I was hoping there was some way to select multiple and have them MOVE together to another list - many at one go; I am guessing some kind "multi select" using Checkmarks or something else.
Thoughts & ideas welcome.
I get "undefined" , Why?