type:
snippet
category:
checkout
name:
Making the the shipping and payment fields hidden until a valid selection is made for guest/login step of checkout
versions:
0.6.0,
0.7.0,
0.7.1,
0.7.2,
1.0
reference:
http://forum.foxycart.com/comments.php?DiscussionID=4022&page=1
tags:
snippets,
checkout,
advance
date:
2011-05-27

Making the the shipping and payment fields hidden until a valid selection is made for guest/login step of checkout

Making the the shipping and payment fields hidden until a valid selection is made for guest/login step of checkout, adding the functionality that was present pre 050.

<script type="text/javascript" charset="utf-8">
  jQuery(document).ready(function() {
    jQuery("#fc_data_entry_container").hide();
 
    jQuery(document).ajaxComplete(function(event, request, settings) {
      toggleDataEntry();
    });
 
    jQuery("#is_anonymous_0, #is_anonymous_1").click(function(){
      toggleDataEntry();
    });
  })
 
  function toggleDataEntry() {
    if (jQuery("#is_anonymous_0").is(":checked")) {
      if (jQuery("#customer_id").val() != "0") {
        jQuery("#fc_data_entry_container").show();
      } else {
        if ($("#customer_password2").is(":visible")) {
          jQuery("#fc_data_entry_container").show();
        } else {
          jQuery("#fc_data_entry_container").hide();
        }
      }
		} else {
      jQuery("#fc_data_entry_container").show();
		}
  }
</script>

Related Forum Discussions

snippets/checkout/making_shipping_and_payment_fields_hidden.txt · Last modified: 2013/03/20 21:17 by adam
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki