Last active
October 19, 2016 16:17
-
-
Save nbarthelemy/8bbc0efb7984f5dab3e370550632b206 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
/********* CO Backend Console JS ********************/ | |
// move cart items to order | |
jQueryIWD('#sidebar_data_cart input[type=checkbox][title^=Add]').prop('checked', true); | |
// set a $0 custom price | |
jQueryIWD('[id^=item_use_custom_price_]').click(); | |
jQueryIWD('[id^=item_custom_price_]').each(function(){ this.value = 0 }); | |
// set price to tier 1 price point ( 12 units / half of retail ) | |
jQueryIWD('[id^=item_custom_price_]').each(function(){ | |
var v = parseFloat(jQueryIWD(this).val()); | |
var r = Math.round(v + ( v * 0.33333333 )); | |
this.value = r / 2; | |
}); | |
// set price to tier 2 price point ( 150 units / tier 1 + .25 ) | |
jQueryIWD('[id^=item_custom_price_]').each(function(){ | |
var v = parseFloat(jQueryIWD(this).val()); | |
var r = Math.round(v + ( v * 0.33333333 )); | |
this.value = ( r * .5 ) - .5; | |
}); | |
// set price to tier 3 price point ( 300 units / tier 1 + .5 ) | |
jQueryIWD('[id^=item_custom_price_]').each(function(){ | |
var v = parseFloat(jQueryIWD(this).val()); | |
var r = Math.round(v + ( v * 0.33333333 )); | |
this.value = ( r * .5 ) - .5; | |
}); | |
/********* Amazon Seller Central Console JS *********/ | |
// pull ASINs from manage inventory search | |
var a = []; $('[data-column=asin]').each(function(){ a.push($.trim($(this).text())); }); console.log(a.join("\n")); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment