Last active
December 10, 2017 04:05
-
-
Save shelldandy/aca6d3c37ddf23ad4811a2b37603a366 to your computer and use it in GitHub Desktop.
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
// Paste in console on the product list in the admin | |
// EXAMPLE | |
// https://************.myshopify.com/admin/products | |
// Select all the links to product pages | |
function downloadSP (name) { | |
$(`tbody td a[href^="/admin/${name}"]`).each(function (index) { | |
const me = $(this) | |
// Grab the original href | |
const url = me.attr('href') | |
const name = me.text().split(' ').join('_').split('.').join('_') | |
// apprend .json | |
me.attr('href', `${url}.json`) | |
// add download attribute with the name of the product | |
me.attr('download', index + '-' + name) | |
}) | |
} | |
// Now just click each one | |
// Profit! |
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
// Paste in console on the product list in the admin | |
// EXAMPLE | |
// https://************.myshopify.com/admin/products | |
// Select all the links to product pages | |
$('tbody td a[href^="/admin/products"]').each(function (index) { | |
const me = $(this) | |
// Grab the original href | |
const url = me.attr('href') | |
const name = me.text().split(' ').join('_').split('.').join('_') | |
// apprend .json | |
me.attr('href', `${url}.json`) | |
// add download attribute with the name of the product | |
me.attr('download', index + '-' + name) | |
}) | |
// Now just click each one | |
// Profit! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment