WordPress.org

Ready to get started?Download WordPress

Forums

eShop
[resolved] eshop - "add to cart" button not working with HTTPS (25 posts)

  1. webmerch
    Member
    Posted 1 year ago #

    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/

  2. elfin
    Moderator
    Plugin Author

    Posted 1 year ago #

    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.

  3. webmerch
    Member
    Posted 1 year ago #

    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

  4. elfin
    Moderator
    Plugin Author

    Posted 1 year ago #

    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.

  5. esmi
    Forum Moderator
    Posted 1 year ago #

    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.

  6. webmerch
    Member
    Posted 1 year ago #

    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.

  7. elfin
    Moderator
    Plugin Author

    Posted 1 year ago #

    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.

  8. webmerch
    Member
    Posted 1 year ago #

    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?

  9. esmi
    Forum Moderator
    Posted 1 year ago #

    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.

  10. webmerch
    Member
    Posted 1 year ago #

    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

  11. elfin
    Moderator
    Plugin Author

    Posted 1 year ago #

    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.

  12. webmerch
    Member
    Posted 1 year ago #

    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

  13. Mvied
    Member
    Posted 1 year ago #

    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

  14. webmerch
    Member
    Posted 1 year ago #

    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

  15. elfin
    Moderator
    Plugin Author

    Posted 1 year ago #

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

  16. Mvied
    Member
    Posted 1 year ago #

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

  17. elfin
    Moderator
    Plugin Author

    Posted 1 year ago #

    I'll leave off doing anything for now, webmerch - can you test when that plugin is updated and let us know here please.

  18. webmerch
    Member
    Posted 1 year ago #

    Elfin, no problem I'll let you know what happens.

    Just a thought though, as mentioned before I am not a programmer, but doesn't the "add to cart" button use an AJAX call when the (.... without going to cart) setting is off? and it works like this. I am sure its more complicated than I make it out to be in my head.

    Thanks,

    Mo

  19. elfin
    Moderator
    Plugin Author

    Posted 1 year ago #

    It is only used when you don't go to the cart when adding a product, and to update the cart widget.

  20. webmerch
    Member
    Posted 1 year ago #

    Got it. I'll keep you posted.

    Thanks,

    Mo

  21. esmi
    Forum Moderator
    Posted 1 year ago #

    As there has not been an update to this topic for a while, I can only assume that the issue has now been resolved and I am now marking it as such. If this is incorrect, please feel free to change the topic's status and/or post a followup.

  22. webmerch
    Member
    Posted 1 year ago #

    Elfin Its been a while since this post, but to continue the discussion. Mvied did add header("Access-Control-Allow-Origin: https://www.mysite.com"); to the HTTPS plugin. But, since your update Version 6.3.4, the "your cart" on the right side of the page disappears when you add to cart. Of course this only happens when HTTPS plugin is activated. You can see what I mean at http://www.simasfoods.com/wp .

  23. elfin
    Moderator
    Plugin Author

    Posted 1 year ago #

    Hmm, I don't have a server to test it on so cannot replicate issues. There is a solution, but as I'd be coding blind, ie cannot test, it isn't something that i could release.

  24. webmerch
    Member
    Posted 1 year ago #

    do you just need WP Control panel access? and how can I get login info to you?

  25. Mvied
    Member
    Posted 1 year ago #

    I wanted to mention that in version 3.3.5 of WordPress HTTPS, I added some conflict fixes for a few popular E-commerce plugins. Typically, the only conflicts with my plugin are the E-commerce plugins' SSL settings. I didn't add anything for eShop, but am willing if there is a conflict of some kind.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic