Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
snippets:shipping:multiple_flat_rates [2012/07/13 00:43] – [Changelog] adamsnippets:shipping:multiple_flat_rates [2017/04/26 07:02] (current) – external edit 127.0.0.1
Line 1: Line 1:
 ---- dataentry snippet ---- ---- dataentry snippet ----
-type          : snippet #do not change this line +type          : snippet # do not change this line 
-category      : shipping #mention the category like 'shipping', 'checkout' etc +category      : shipping # mention the category like 'shipping', 'checkout' etc 
-name          : Multiple Flat Rate #the name of the snippet +name          : Multiple Flat Rate # the name of the snippet 
-description   :  #description about snippet +description   :  # description about snippet 
-versions_tags : 0.6.0, 0.7.0, 0.7.1, 0.7.2 #compatible versions +versions_tags : 0.6.0, 0.7.0, 0.7.1, 0.7.2, 1.0, 1.1 # compatible versions 
-reference_url : http://forum.foxycart.com/comments.php?DiscussionID=3132&page=1 #Item_0            # External link +reference_url : http://forum.foxycart.com/comments.php?DiscussionID=3132&page=1 # Item_0            # External link 
-tags_tags     : snippets, shipping, advance #tags, separated by commas. +tags_tags     : snippets, shipping, advance # tags, separated by commas. 
-date_dt       : 2011-05-25 #the date in YYYY-MM-DD format+date_dt       : 2011-05-25 # the date in YYYY-MM-DD format
 ---- ----
 +
 +
 ====== Multiple Custom Flat Rate Shipping Options  ====== ====== Multiple Custom Flat Rate Shipping Options  ======
  
-<WRAP center round important 60%> +<WRAP center round important 80%> 
-Note that applying javascript shipping modifications using either live or flat rates where you are setting custom values has been found to not work as expected for subscription based products where you need the shipping to apply to each subscription renewal. We are currently working on a fix for this issue for version 0.7.2++**Versions 0.7.1 and older**: Note that applying javascript shipping modifications using either live or flat rates where you are setting custom values has been found to not work as expected for subscription based products where you need the shipping to apply to each subscription renewal. fix is in place for versions 0.7.2 and newer. 
 +</WRAP> 
 +<WRAP center round important 80%> 
 +**Using version 2.0?** There is a new snippet available for our latest version, [[v:2.0:snippets:flat_rate_shipping_modification|available from here]]. 
 +</WRAP> 
 +<WRAP center round info 80%> 
 +**If you're using handling fees** note that you can't overwrite handling fees using javascript on the checkout to provide free shipping. While it will appear that the shipping is $0 on the checkout, the handling fees will be added back in server-side, and the customer will see a shipping fee that matches the handling fee cost you have set in the administration.
 </WRAP> </WRAP>
  
Line 35: Line 43:
 ==== Step 3: Add Javascript ==== ==== Step 3: Add Javascript ====
  
-Add the following right before the closing ''</head>'' tag in your checkout template:+Add the following right before the closing ''</head>'' tag in your checkout template (we will add code to the "customShippingLogic" function later):
  
 <code javascript><script type="text/javascript" charset="utf-8"> <code javascript><script type="text/javascript" charset="utf-8">
Line 49: Line 57:
     /* BEGIN CUSTOM SHIPPING LOGIC */     /* BEGIN CUSTOM SHIPPING LOGIC */
          
-    +    // ... add your custom logic here
          
     /* END CUSTOM SHIPPING LOGIC */     /* END CUSTOM SHIPPING LOGIC */
Line 59: Line 67:
 <script type="text/javascript" charset="utf-8"> <script type="text/javascript" charset="utf-8">
   //<![CDATA[   //<![CDATA[
-  /* Multiple Flat Rate Shipping Options Logic v2.*/+  /* Multiple Flat Rate Shipping Options Logic v2.*/
      
   jQuery(document).ready(function() {   jQuery(document).ready(function() {
-    jQuery("input[name=shipping_service]").live('click', function(){+    jQuery("#fc_custom_shipping_methods_container").on('click', 'input[name=shipping_service]', function(){
       shipping_service_description = jQuery(this).siblings(".fc_shipping_carrier").html();       shipping_service_description = jQuery(this).siblings(".fc_shipping_carrier").html();
       shipping_service_description += ((shipping_service_description == "") ? '' : ' ');       shipping_service_description += ((shipping_service_description == "") ? '' : ' ');
Line 245: Line 253:
 ===== Related Forum Discussions ===== ===== Related Forum Discussions =====
  
-  * http://forum.foxycart.com/comments.php?DiscussionID=3132&page=1+  * https://forum.foxycart.com/discussion/3132
  
 ===== Changelog ===== ===== Changelog =====
Line 256: Line 264:
   * 2012/04/12 - v2.2 - Added checks in the addShippingOption() function to account for undefined carriers and services   * 2012/04/12 - v2.2 - Added checks in the addShippingOption() function to account for undefined carriers and services
   * 2012/07/13 - v2.3 - Added checks in onLocationChange updateTaxes overload to not run if it is being run as part of validateAndSubmit to prevent checkout being blocked.   * 2012/07/13 - v2.3 - Added checks in onLocationChange updateTaxes overload to not run if it is being run as part of validateAndSubmit to prevent checkout being blocked.
 +  * 2013/05/18 - v2.4 - Updated script to use .on() instead of .live()

Site Tools