Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
snippets:shipping:remove_day_timeframe_from_usps_rates [2013/08/07 02:51] – adam | snippets:shipping:remove_day_timeframe_from_usps_rates [2017/04/26 07:02] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 13: | Line 13: | ||
====== Remove days timeframe from USPS rates ====== | ====== Remove days timeframe from USPS rates ====== | ||
+ | |||
+ | <WRAP center round important 80%> | ||
+ | **Using version 2.0?** There is a new snippet available for our latest version, [[v: | ||
+ | </ | ||
Recently USPS reworked their priority rates to make it clearer how long a given rate will take in transit. This can be confusing for customers, especially if the products you sell don't ship straight away. This snippet removes the " | Recently USPS reworked their priority rates to make it clearer how long a given rate will take in transit. This can be confusing for customers, especially if the products you sell don't ship straight away. This snippet removes the " | ||
Line 24: | Line 28: | ||
<script type=" | <script type=" | ||
jQuery(document).ready(function() { | jQuery(document).ready(function() { | ||
- | jQuery(document).ajaxComplete(function(event, | + | |
- | if (settings.url.indexOf(' | + | if (settings.url.indexOf(' |
- | jQuery(" | + | |
- | var reg = /\d-day/i; | + | } |
- | var service = jQuery(this).html(); | + | }); |
- | if (reg.test(service)) { | + | |
- | jQuery(this).html(service.replace(reg, | + | // Run on page load in case rates already exist |
- | } | + | |
- | }) | + | |
- | } | + | |
- | }); | + | |
}); | }); | ||
+ | |||
+ | function UpdateUSPSRates() { | ||
+ | jQuery(" | ||
+ | var reg = /\d-day/i; | ||
+ | var service = jQuery(this).html(); | ||
+ | if (reg.test(service)) { | ||
+ | jQuery(this).html(service.replace(reg, | ||
+ | } | ||
+ | var saved_service = jQuery("# | ||
+ | if (reg.test(saved_service)) { | ||
+ | jQuery("# | ||
+ | } | ||
+ | }); | ||
+ | } | ||
</ | </ | ||
</ | </ |