teodor.boev Posted April 21, 2013 Share Posted April 21, 2013 (edited) Hi there I am new to presta so please dont kill me I have tried to activate SSL but I got a funny error message when I try to add a product to the cart the url in the settings is the same for both non-ssl and ssl domain Impossible to add the product to the cart. textStatus: 'error' errorThrown: '' responseText: could you please suggest why it doesnt work...as it should? Thanks in advance Teo Edited April 21, 2013 by teodor.boev (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted April 21, 2013 Share Posted April 21, 2013 you use default theme? Can you try to add something to cart with turned console on ? (firebug / f12 / fn+f12) if some errors appear, can you paste it here (or screenshot?) Link to comment Share on other sites More sharing options...
teodor.boev Posted April 21, 2013 Author Share Posted April 21, 2013 XMLHttpRequest cannot load http://www.domain.com/?controller=cart&ajax=true&token=df12941028491780cae13f0194e804ff&_=1366578505276. Origin https://www.domain.com is not allowed by Access-Control-Allow-Origin. XMLHttpRequest cannot load http://www.domain.com/. Origin https://www.domain.com is not allowed by Access-Control-Allow-Origin. Link to comment Share on other sites More sharing options...
vekia Posted April 21, 2013 Share Posted April 21, 2013 ok, the problem is that you access to your website with https:// and ajax tried to add product to cart via url which is without https:// you use default template? Link to comment Share on other sites More sharing options...
teodor.boev Posted April 21, 2013 Author Share Posted April 21, 2013 No I am not using the default template Link to comment Share on other sites More sharing options...
vekia Posted April 21, 2013 Share Posted April 21, 2013 ok, so the problem is probably with theme scripts.Which version of ps you use? Link to comment Share on other sites More sharing options...
teodor.boev Posted April 21, 2013 Author Share Posted April 21, 2013 (edited) 1.5.4.0 and the theme i'am using is http://warehouse.iqit-commerce.com/en/ Edited April 21, 2013 by teodor.boev (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted April 21, 2013 Share Posted April 21, 2013 Ok, you should check product-list.tpl file, can you find out there: <a class="exclusive ajax_add_to_cart_button" href="http://..." title="Add to cart">Add to cart</a> and how it looks in your product-list.tpl file? Link to comment Share on other sites More sharing options...
teodor.boev Posted April 21, 2013 Author Share Posted April 21, 2013 (edited) if thats the correct snippet .... <a class="button ajax_add_to_cart_button exclusive" rel="ajax_id_product_{$product.id_product|intval}" href="{$link->getPageLink('cart',false, NULL, "add&id_product={$product.id_product|intval}&token={$static_token}", false)}" title="{l s='Add to cart'}">{l s='Add to cart'}</a> Edited April 21, 2013 by teodor.boev (see edit history) Link to comment Share on other sites More sharing options...
teodor.boev Posted April 21, 2013 Author Share Posted April 21, 2013 Is there a way to force presta to do everything via SSL Link to comment Share on other sites More sharing options...
mauroj Posted October 10, 2013 Share Posted October 10, 2013 Is there a way to force presta to do everything via SSL Helo Teodor, Did you fix it? I have the same problem. Regards! Link to comment Share on other sites More sharing options...
vekia Posted October 10, 2013 Share Posted October 10, 2013 hello prestashop 1.5.6 has got feature to force ssl connection: it;s available under preferneces > general tab in your back office Link to comment Share on other sites More sharing options...
mauroj Posted October 10, 2013 Share Posted October 10, 2013 hello prestashop 1.5.6 has got feature to force ssl connection: it;s available under preferneces > general tab in your back office Many thanks Vekia, I just want to activate SSL in main page, customer account, etc.. but not in all the pages. I have the problem with the ajax cart when I redirect the main page to https. Regards!! Link to comment Share on other sites More sharing options...
vekia Posted October 10, 2013 Share Posted October 10, 2013 hello it will be a bit hard to create redirect only for certain pages, why not to use ssl on each page? in my opinion it's much better than ssl only for certain pages. im going to check code to find redirects Link to comment Share on other sites More sharing options...
mauroj Posted October 10, 2013 Share Posted October 10, 2013 hello it will be a bit hard to create redirect only for certain pages, why not to use ssl on each page? in my opinion it's much better than ssl only for certain pages. im going to check code to find redirects I enabled SSL for customer account identification and order processing, but I want the customer to come into the store to be redirected to https. I use PS 1.5.4.1, and my .htaccess contain: rewriteengine on rewritecond %{HTTPS} off rewritecond %{HTTP_HOST} ^www.domain.com$ [OR] rewritecond %{HTTP_HOST} ^domain.com$ rewriterule ^$ "https\:\/\/domain\.com\/" [R=301,L] However, with this redirection the ajax cart give me the next error: "XMLHttpRequest cannot load http://www.domain.com/?rand=1381215842360. Origin https://www.domain.com is not allowed by Access-Control-Allow-Origin." ¬¬ Many thanks in advance! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now