Skip to content

Instantly share code, notes, and snippets.

@kylewest
Created October 20, 2010 16:11
Show Gist options
  • Save kylewest/636726 to your computer and use it in GitHub Desktop.
Save kylewest/636726 to your computer and use it in GitHub Desktop.
RPMWare Free Shipping Javascript v2.0
<script type="text/javascript">
$(document).ready(function() {
var yourPriceLabel = $("#ctl00_MainContentPlaceHolder_YourPriceLabel");
if (yourPriceLabel.length) {
var itemPrice = parseFloat(yourPriceLabel.text().replace(/[^\d\.]+/g,""));
console.log(itemPrice);
if (itemPrice != NaN) {
// Replace "ENTER_YOUR_PRICE_HERE" with the starting price you want free shipping displayed. E.g. 150.00 or 123.45. Do NOT enter a dollar sign!
if (itemPrice >= 200) {
console.log("Item is eligible for free shipping");
// Show a message under the price. You may change "FREE SHIPPING" to whatever you like.
yourPriceLabel.after("<br/>FREE SHIPPING");
}
}
}
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment