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

Issue with echo from ajax function WordPress

  • REFUNDED

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.

Plugin: http://www.magentocommerce.com/magento-connect/facebookfreebelvg-4448.html

Answers (3)

2012-09-19

Arnav Joy answers:

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

2012-09-19

Gabriel Reguly answers:

Hi liv,

The issue does not exist at the plugin demo site http://store.belvg.com/demo/facebookfree/checkout/cart/[[LINK href="http://store.belvg.com/demo/facebookfree/checkout/cart/"]][[/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.

Regards,
Gabriel


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.

Regards,
Gabriel


liv comments:

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

2012-09-19

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...