The Foxy forums are on the move!

We're in the process of moving our forums over to a new system, and so these forums are now read-only.
If you have a question about your store in the meantime, please don't hesitate to reach out to us via email.

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.