Last active
June 20, 2021 12:07
-
-
Save printminion/2583a1f581a5972d3b5a1c414c0d6610 to your computer and use it in GitHub Desktop.
Bulk price update in shapeways.com
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
/** | |
* - goto your product edit page https://www.shapeways.com/product/edit/NNNNNN#pricing | |
* - goto pricing table | |
* - select all materials with checkbox in header | |
* - price input must appear in table header | |
* - open developer conosle of your browser F12 in Chrome | |
* - paste thhis code into console - press enter - values should update itself | |
* - voila | |
* - buy me a coffee https://www.buymeacoffee.com/printminion , https://paypal.me/printminion | |
*/ | |
var priceDelta = 1; // put your delta in dollars | |
if ($('[data-sw-material-pricing-row-checkbox]:checked').size()) { | |
console.warn("No materials selected. Please select prices to modify first"); | |
} | |
$('[data-sw-material-pricing-row-checkbox]:checked').each(function() { | |
var $materialRow = $(this).parents('[data-sw-material-pricing-row]'); | |
var sourceSum = $materialRow.find('[data-sw-material-total-price]').val(); | |
sourceSum = sourceSum.replace("$", ""); | |
var finalSum = parseFloat(sourceSum) + priceDelta; | |
console.log(sourceSum, finalSum) | |
$materialRow.find('[data-sw-material-total-price]').val(finalSum).trigger('focusout'); | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment