WordPress.org

Support

Support » Plugins and Hacks » [Resolved] eshop – "add to cart" button not working with HTTPS

[Resolved] eshop – "add to cart" button not working with HTTPS

  • Hi,

    I have installed the “WordPress HTTPS (SSL)” plugin, and it works very well, except there is one issue. I don’t know if it is due to the HTTPS plugin, or eshop. So, when I turn ON the “Add to cart, without going to cart page.” from the eshop settings. Then the “add to cart” button does not work from the product pages. I have also brought this to the attention of the developer of “WordPress HTTPS (SSL)”.

    Any help is greatly appreciated.

    Thank you in advance,

    Mo

    http://wordpress.org/extend/plugins/eshop/

Viewing 15 replies - 1 through 15 (of 24 total)
  • Plugin Author elfin
    Participant

    @elfin

    are you using a shared certificate? if so then that may be the cause.

    are you using http for the product page, or is it just the cart the checkout pages? again if so that may be the cause, try it with the product page also with https.

    Thanks for the fast reply. As suggested, I tried the product page in https and it worked perfectly. However, this basically means I need to put the entire site in https. Is there a work around or a way to force the add to cart button to work from a non secure page ?

    FYI: this is not a shared certificate.

    Thank you,

    Mo

    Plugin Author elfin
    Participant

    @elfin

    I haven’t been able to test with HTTPS, but I may have a solution – I’ll try and get that in the next release. keep an eye on the readme.

    esmi
    Forum Moderator

    @esmi

    I doubt this will ever work effectively. If you end up with a mixture of http and https links on a page, your site will trigger all kinds of warnings in web browsers.

    But, you know what is interesting is that if you turn OFF (no) the “Add to cart, without going to cart page.” from the eshop settings, then the “Add to Cart” button works even from a none secure product page.

    Plugin Author elfin
    Participant

    @elfin

    hmm, so you can add to the cart and checkout without an issue with https on checkout page, but products on http? If so it changes what I can even attempt to fix.

    I was hoping my last post would have simplified it, since the only thing seems to change is the redirect to the shopping-cart page. The form instance seems to be the same in each case. I am not a programmer, but in both cases the button is posting to https://domain.com/shopping-cart, so what does really change between the cases?

    esmi
    Forum Moderator

    @esmi

    in both cases the button is posting to https://domain.com/shopping-cart,

    For that to be the case, the entire site would have to be running using https.

    esmi, that is not the case. The entire site is not running https. All I can suggest is to install both plugins and see for yourself what it is doing. I may be wrong, but I really think there is a simple explanation and maybe a fix. I’d hoped the author of WordPress HTTPS would get in on this conversation, for a better picture of what is happening.

    Thanks,

    Mo

    Plugin Author elfin
    Participant

    @elfin

    We cannot test with the plugin – but I have a general idea how it works. But you did not confirm the answer to my question

    so you can add to the cart and checkout without an issue with https on checkout page, but products on http?

    When I get chance to look at this properly. I’ll see if anything I can think of is actually doable. I’ll let you know.

    Hi,

    If I understand your question right, the answer is yes. So far in testing, everything works correctly as it should except the original issue.

    So, when I turn ON the “Add to cart, without going to cart page.” from the eshop settings. Then the “add to cart” button does not work from the product pages.

    If I turn OFF the “Add to cart, without going to cart page” in settings, then the “add to cart” button works with product page both in http and https.

    If I turn it ON, then the “add to cart” button doesn’t work with products page in http, but works in https. In this case (being on) everything else work (all the links within the shopping cart widget, and on the page), and also from shopping-cart itself everything works.

    Hope I didn’t ramble on, and if I did I hope I made sense. I’ll be more than happy to give you admin rights to the site if you like.

    Thank you,

    Mo

    I’m the author for WordPress HTTPS. You say that when the product page is HTTP, it “doesn’t work”. What happens? Check your browser’s console for JavaScript errors. I’m pretty sure you’re getting a security violation since you can’t make HTTPS AJAX calls from a HTTP page without adding a special header.

    header("Access-Control-Allow-Origin: https://www.mysite.com");

    http://en.wikipedia.org/wiki/Cross-Origin_Resource_Sharing

    Mike,
    Thanks for your response. To answer your question;

    What happens?

    The “Add to Cart” button acts like a link when you go over it, but when you click on it nothing happens.

    Also, not sure where the code you included in your post should go.

    Mo

    Plugin Author elfin
    Participant

    @elfin

    Mvied, thanks for posting that, it is a AJAX call so that may well fix things.

    I’m actually going to add this into my plugin as well. I can see this being useful in many cases.

Viewing 15 replies - 1 through 15 (of 24 total)
  • The topic ‘[Resolved] eshop – "add to cart" button not working with HTTPS’ is closed to new replies.