Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| snippets:shipping:handling_fee_on_orders_under_100_dollar [2011/05/27 20:27] – [Data entry] sami.fiaz | snippets:shipping:handling_fee_on_orders_under_100_dollar [2017/04/26 07:02] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 4: | Line 4: | ||
| name : Handling fee on orders under $100, free if over, live rates included. #the name of the snippet | name : Handling fee on orders under $100, free if over, live rates included. #the name of the snippet | ||
| description | description | ||
| - | versions_tags : #compatible versions | + | versions_tags : 0.6.0, 0.7.0, 0.7.1, 0.7.2, 1.0 #compatible versions |
| reference_url : http:// | reference_url : http:// | ||
| tags_tags | tags_tags | ||
| Line 10: | Line 10: | ||
| ---- | ---- | ||
| - | ===== Handling fee on orders under $100, free if over, live rates included. | + | ====== Handling fee on orders under $100, free if over, live rates included. |
| - | TEXT GOES HERE!!! | + | <WRAP center round important 80%> |
| + | **Using version 2.0?** There is a new snippet available for our latest version, [[v: | ||
| + | </ | ||
| + | This javascript allows you to add different amounts to shipping costs based on the carrier that the customer has chosen. This particular setup also provides free shipping if the order is over a certain price. | ||
| + | ===== Step 1: Javascript ===== | ||
| + | Paste the following right before the closing ''</ | ||
| + | |||
| + | <code javascript> | ||
| + | <script type=" | ||
| + | function updateMyShippingCost() { | ||
| + | // Grab current shipping cost (from live rates) | ||
| + | var shippingCost = FC.checkout.config.orderShipping; | ||
| + | | ||
| + | // Grab currently selected shipping option | ||
| + | var carrier = $(" | ||
| + | if ( carrier != null ) { // something is selected | ||
| + | if ( carrier == " | ||
| + | shippingCost += 10; | ||
| + | } else if ( carrier == " | ||
| + | shippingCost += 3.5; | ||
| + | if (fc_json.total_price >= 100) { // Free shipping! | ||
| + | shippingCost = 0; | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | // Update the shipping cost with the updated figures | ||
| + | FC.checkout.config.orderShipping = shippingCost; | ||
| + | } | ||
| + | |||
| + | jQuery(document).ready(function(){ | ||
| + | // set the custom function to run before the updatePriceDisplay function | ||
| + | FC.checkout.overload(" | ||
| + | }); | ||
| + | </ | ||
| + | </ | ||
| ===== Related Forum Discussions ===== | ===== Related Forum Discussions ===== | ||
| * http:// | * http:// | ||