Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

Issue with echo from ajax function WordPress


Hello I know this site is intended to be for wordpress questions, but maybe someone can figure this out. On my magento site when I click add to cart "ajax function" if someone isn't logged in, it echos the facebook login button, each time I press to add to cart it will add another duplicate facebook login button until the person logs in.


Answers (3)


Arnav Joy answers:

can you show me the url of the site where this problem exists?


Gabriel Reguly answers:

Hi liv,

The issue does not exist at the plugin demo site[[LINK href=""]][[/LINK]]

Perhaps it is something else?

Anyway, as a solution I would add a cookie to avoid displaying twice the Facebook login button.

But, sorry, $10 is not much of a prize for this task.


liv comments:

No-one is forcing you to help for $10 Gabriel.

liv comments:

I was assuming it just just a small issue with code that was echoing it when the ajax function is submitted.

Gabriel Reguly comments:

Hi liv,

Thanks for assuring me that I am not forced to help you.

Yes, it probably is a small issue with the code, and a cookie would be my solution for it.

Other experts might suggest to just check if some ID is already present at the DOM.

See, the original author most likely has assumed that people would be logging in at the first button and did not bothered to check if it was already displayed or not.

That is not an uncommon thing to happen with AJAX.


liv comments:

How much would it cost you for you to create this cookie my good sir.


Pavel Petrov answers:

If I were to fix this I`d find the ajax response(The easiest way to do this is Network tab in Firebug). If you give me the link to your site I can take a look and try to find the problem, I have some previous experience in magento...