elameno Posted October 12, 2012 Share Posted October 12, 2012 (edited) Shopping cart contents all disappear whenever a user clicks on "Log in" or "Checkout". I realize that this is because the contents of the cart cookie are not being made available across the two subdomains (in this case "www" and "secure"). In Prestashp 1.4 there was an option in the tools to add a subdomain that took care of this issue. In Prestashop 1.5 I don't see those options. Has anyone been able to figure this out? Does it require the multistore functionality to be enabled? Edited October 25, 2012 by elameno (see edit history) 1 Link to comment Share on other sites More sharing options...
elameno Posted October 12, 2012 Author Share Posted October 12, 2012 Well digging into the code I found this "fix". I don't know the Prestashop core all that well so it may be inadvisable to add this, but this seemed to fix my problem of my shopping cart contents disappearing when the user clicked a link that switched them over to the SSL subdomain. Keep in mind that I'm looking at the Prestashop 1.5.1 code. In the config/config.inc.phe file at line 123 you will see code that looks like this: if (Context::getContext()->shop->getGroup()->share_order) $cookie = new Cookie('ps-sg'.Context::getContext()->shop->getGroup()->id, '', $cookieLifetime, Context::getContext()->shop->getUrlsSharedCart()); else $cookie = new Cookie('ps-s'.Context::getContext()->shop->id, '', $cookieLifetime); I inserted an "else if" statement in there which looks to see if the ssl domain and the main store domain are not the same. If not then it passes the two domains into the Cookie constructor as the final parameter. Here's the code after the hack fix (including the other two branches of the if/then/else. if (Context::getContext()->shop->getGroup()->share_order) $cookie = new Cookie('ps-sg'.Context::getContext()->shop->getGroup()->id, '', $cookieLifetime, Context::getContext()->shop->getUrlsSharedCart()); else if(Context::getContext()->shop->domain != Context::getContext()->shop->domain_ssl) $cookie = new Cookie('ps-s'.Context::getContext()->shop->id, '', $cookieLifetime, array(Context::getContext()->shop->domain, Context::getContext()->shop->domain_ssl)); else $cookie = new Cookie('ps-s'.Context::getContext()->shop->id, '', $cookieLifetime); Seems to solve my problems. Though I know not whether it will create any others. 2 Link to comment Share on other sites More sharing options...
Bejo Posted October 18, 2012 Share Posted October 18, 2012 (edited) I got error warning like this : Error occurred: Please refer to logs: PayPal response: TIMESTAMP -> 2012-10-18T09:21:08Z L_ERRORCODE0 -> 10605 L_SHORTMESSAGE0 -> Transaction refused because of an invalid argument. See additional error messages for details. L_LONGMESSAGE0 -> Currency is not supported L_SEVERITYCODE0 -> Error so i can not check out with this module!! Anybody know what should i do? please I disable EN language and change the default with ID language!!! thank you! Edited October 18, 2012 by jesen (see edit history) Link to comment Share on other sites More sharing options...
mmony Posted October 25, 2012 Share Posted October 25, 2012 I had the same problem as you and the above code worked in 1.5.1 but now it doesn't in 1.5.2. Anyone know how to create a subdomain in 1.5.0 to deal with this. Apparently, do so should fix the problem. Link to comment Share on other sites More sharing options...
elameno Posted October 25, 2012 Author Share Posted October 25, 2012 I don't have the time to look at the 1.5.2 code right now. Sorry! I hope the developers tune into this issue and help us out with a permanent fix! Link to comment Share on other sites More sharing options...
benjamin utterback Posted October 25, 2012 Share Posted October 25, 2012 Hello all, this issue is still persistent in version 1.5.2? Also, jesen, is your problem related to this topic? If not, please post this in a separate topic and we will be happy to help. Link to comment Share on other sites More sharing options...
elameno Posted October 25, 2012 Author Share Posted October 25, 2012 The "fix" I put in place for 1.5.1 may be considered hackish, so I'd love for the development team to take a look and see if there's a better way to permanently fix the problem. I haven't verified that the problem still exists in 1.5.2 so I can't comment there. mmony? In 1.4 there was a page in the back office to add subdomains so the cookies would persist across the subdomains added. That page is gone now and it'd be fantastic to have access to it again, or be given another way to accomplish the same thing. Link to comment Share on other sites More sharing options...
mmony Posted October 25, 2012 Share Posted October 25, 2012 Yes. This issue is definitely still persistent in 1.5.2 and now the hack above doesn't even work. This is a big problem. Link to comment Share on other sites More sharing options...
benjamin utterback Posted October 25, 2012 Share Posted October 25, 2012 Hello mmony, thank you for the confirmation. I suggest you post this issue in the The Forge . Let me know the ticket number and I will do my best to report this accordingly. Link to comment Share on other sites More sharing options...
mmony Posted October 25, 2012 Share Posted October 25, 2012 Hi Benjamin, I had just posted it to the forge. Here is the ticket number: PSCFV-5260 I'm launching tomorrow (or least I was suppose to) so it's really critical I can get a work-around for this. Thanks Link to comment Share on other sites More sharing options...
elameno Posted October 25, 2012 Author Share Posted October 25, 2012 And I just voted for it! Link to comment Share on other sites More sharing options...
elameno Posted November 5, 2012 Author Share Posted November 5, 2012 I haven't seen any activity on this issue in the forums or the bug tracker. Have any of you found a solution for 1.5.2.0 on this yet? Link to comment Share on other sites More sharing options...
benjamin utterback Posted November 5, 2012 Share Posted November 5, 2012 Hello, I wasn't able to reproduce the issue. Was this an upgraded store from 1.5.1? Link to comment Share on other sites More sharing options...
elameno Posted November 5, 2012 Author Share Posted November 5, 2012 I haven't upgraded to 1.5.2.0 yet so I couldn't tell you about that release. I have my hack fix that makes this work in 1.5.1.0 but at some point I'd like to upgrade. I'm waiting to hear of some progress on these critical features I need before I do. My 1.5.1.0 install was a fresh install and the issue happens when the "Shop Domain" and "SSL domain" names use different subdomains. In my case I'm using: Shop Domain = www.domainhere.com SSL Domain = secure.domainhere.com Link to comment Share on other sites More sharing options...
benjamin utterback Posted November 5, 2012 Share Posted November 5, 2012 Hello, elameno I suggest to install 1.5.2 on a sub-domain and let me know if the ssl problem still exists. Link to comment Share on other sites More sharing options...
elameno Posted November 5, 2012 Author Share Posted November 5, 2012 I ran a clean install of 1.5.2.0 on my home machine and have the same problem when switching between subdomains (www to secure and vice versa). Link to comment Share on other sites More sharing options...
elameno Posted November 5, 2012 Author Share Posted November 5, 2012 I have also verified that the above fix that I posted still works in 1.5.2.0 Link to comment Share on other sites More sharing options...
rturner Posted December 3, 2012 Share Posted December 3, 2012 I know this thread is a month old, but I just wanted to mention that elameno's fix worked perfectly for me, setting up ssl in a 1.5.2 multi-shop environment. 1 Link to comment Share on other sites More sharing options...
El Patron Posted September 15, 2013 Share Posted September 15, 2013 Hi Benjamin, I had just posted it to the forge. Here is the ticket number: PSCFV-5260 I'm launching tomorrow (or least I was suppose to) so it's really critical I can get a work-around for this. Thanks After review of this post I wanted to follow up that this forge report was closed as 'Fixed'. http://forge.prestashop.com/browse/PSCFV-5260 I was looking into this as a customer has a 1.5.4.1 shop running as a subdomain, then switching to another subdomain and oddity of order status on return from PayPal order history. This may differ to OP in that they ssl goes from cTLD to subdomain. Link to comment Share on other sites More sharing options...
benjamin utterback Posted September 16, 2013 Share Posted September 16, 2013 Hi Fred, that is correct, this issue was fixed with elameno's forum fix on the forge link you provided. I think that you are having a separate issue with your client. Thanks for the update on the status. I'll go ahead and mark this as SOLVED. 1 Link to comment Share on other sites More sharing options...
Recommended Posts