Adjust a DevTools script to set Minimum and Maximum price on Amazon
Budget: €8 – €30 EUR
I need to adjust this Snippet of Chrome DevTools in order to:
- Change all Minimum Price to 1,00
- Change all Maximum Price to 10000,00
The task is very easy, I've already the code and I just need to adjust it:
rows = $('.mt-table').find('.mt-row');
for (i = 0; i < rows.length; i++) {
price = $(rows[i].children[13]).find('input').val();
min_price = $(rows[i].children[17]).find('input').val();
max_price = $(rows[i].children[18]).find('input').val();
if (max_price.length > 0) {
if (parseInt(max_price) < parseInt(price)) {
$(rows[i].children[18]).find('input').val(price);
$(rows[i].children[18]).find('input').change();
}
}
if (min_price.length > 0) {
if (parseInt(min_price) > parseInt(price)) {
$(rows[i].children[17]).find('input').val(price);
$(rows[i].children[17]).find('input').change();
}
}
}
- Change all Minimum Price to 1,00
- Change all Maximum Price to 10000,00
The task is very easy, I've already the code and I just need to adjust it:
rows = $('.mt-table').find('.mt-row');
for (i = 0; i < rows.length; i++) {
price = $(rows[i].children[13]).find('input').val();
min_price = $(rows[i].children[17]).find('input').val();
max_price = $(rows[i].children[18]).find('input').val();
if (max_price.length > 0) {
if (parseInt(max_price) < parseInt(price)) {
$(rows[i].children[18]).find('input').val(price);
$(rows[i].children[18]).find('input').change();
}
}
if (min_price.length > 0) {
if (parseInt(min_price) > parseInt(price)) {
$(rows[i].children[17]).find('input').val(price);
$(rows[i].children[17]).find('input').change();
}
}
}