Foxy Forum Status

We're no longer responding to questions via our forum, but we will keep it up for historical reasons. If you can't find the answer you're looking for, please visit our knowledge base or contact us. If there's enough interest in the future, we may bring the forum back.

Overloading displayShippingAddress

cowtancowtan Member
in Help edited May 2013
Hi - I'm wanting to overload the function that displays and hides the Shipping Address block so that at the same time, it hides and displays another block. In my checkout template I've added the following code -
function displayCheckoutPicture(obj) {
	if (obj.checked) {
	} else {

	var htmlPicture = '<div id="totseat_checkout_picture"></div>';
	FC.checkout.overload("displayShippingAddress", "displayCheckoutPicture", null);

As far as I can tell, looking at what happens in firebug, the additional function is being run but doesn't seem to be successfully setting the visibility of the #totseat_checkout_picture block. It seems that if the new div is hidden the first time the code is run then it shows the block (which it shouldn't) and then it stays visible regardless of what happens with the checkbox. So it seems as if it thinks that obj.checked is false all the time.

Any idea what's going on?

  • fc_adamfc_adam FoxyCart Team

    With overload, the arguments to the original function are passed in an array - so you'll need to check "obj[0].checked" instead.
  • cowtancowtan Member
    Great. Thanks Adam.
Sign In or Register to comment.