Last active
March 24, 2018 00:40
-
-
Save arlopezg/348479ae440e30dd37f255c5fbb95889 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| saveProducts = (arr) => { | |
| const products = new Array() | |
| console.log("Received products:", arr) | |
| arr.products.map((product) => | |
| products.push({ | |
| 'id': product.id, | |
| 'options': product.options, | |
| 'type': product.product_type, | |
| 'handle': product.handle, | |
| 'title': product.title, | |
| 'variants': product.variants, | |
| 'images': product.images | |
| }) | |
| ) | |
| console.log("Saved data:", products) | |
| // write data to HTML | |
| } | |
| jQuery.getJSON('/admin/products.json/', saveProducts) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment