maryb66 Posted October 14, 2016 Share Posted October 14, 2016 (edited) I'm using Prestashop v1.5.4 (yes I know it's an old version I can't upgrade) and changing from http to https everywhere. My .htaccess rewrite is working fine. Images are loading with https fine. Menus are all using https the links to other pages Except the product list (product-list.tpl) page is listing the links to the product pages with http not https So <a href="{$product.link|escape:'htmlall':'UTF-8'}"> is giving me http not https Where ever there's a link to a product page it's http not https Also in module Product Also Buy the $productLink gives me http not https xml sitemap is also saying http on the product pages Any tips how to fixThanks Edited October 14, 2016 by maryb66 (see edit history) Link to comment Share on other sites More sharing options...
bellini13 Posted October 15, 2016 Share Posted October 15, 2016 Inside of the Link class, is a function getProductLink, and there they have hardcoded the use of http $url = 'http://'.$shop->domain.$shop->getBaseURI().$this->getLangLink($id_lang); Link to comment Share on other sites More sharing options...
loupiloop Posted September 25, 2017 Share Posted September 25, 2017 Hello Please , where is this line ? bye Link to comment Share on other sites More sharing options...
ewinch Posted September 26, 2017 Share Posted September 26, 2017 In PrestaShop v1.5.4 Do they have this choice in the admin? Prefrences>General>Enable SSL on all pages I am using v1.6.1 and it was a very easy change for me. Figured maybe it could be an easy fix for you. ~E Link to comment Share on other sites More sharing options...
loupiloop Posted September 26, 2017 Share Posted September 26, 2017 Hi Yes, i activate the ssl on all pages. The problem is that some pictures of modules homefeature, blockbestseller and "Nouveaux produits" on the Homepage are not in https url. They have "http" The code in product.tpl : <img class="replace-2x img-responsive" src="{$link->getImageLink($product.link_rewrite, $product.id_image, 'home_default')|escape:'html':'UTF-8'}" alt="{if !empty($product.legend)}{$product.legend|escape:'html':'UTF-8'}{else}{$product.name|escape:'html':'UTF-8'}{/if}" title="{if !empty($product.legend)}{$product.legend|escape:'html':'UTF-8'}{else}{$product.name|escape:'html':'UTF-8'}{/if}" {if isset($homeSize)} width="{$homeSize.width}" height="{$homeSize.height}"{/if} itemprop="image" /> I don't know where can i add a "https" in the img url. Thanks Link to comment Share on other sites More sharing options...
bellini13 Posted September 26, 2017 Share Posted September 26, 2017 Hi Yes, i activate the ssl on all pages. The problem is that some pictures of modules homefeature, blockbestseller and "Nouveaux produits" on the Homepage are not in https url. They have "http" The code in product.tpl : <img class="replace-2x img-responsive" src="{$link->getImageLink($product.link_rewrite, $product.id_image, 'home_default')|escape:'html':'UTF-8'}" alt="{if !empty($product.legend)}{$product.legend|escape:'html':'UTF-8'}{else}{$product.name|escape:'html':'UTF-8'}{/if}" title="{if !empty($product.legend)}{$product.legend|escape:'html':'UTF-8'}{else}{$product.name|escape:'html':'UTF-8'}{/if}" {if isset($homeSize)} width="{$homeSize.width}" height="{$homeSize.height}"{/if} itemprop="image" /> I don't know where can i add a "https" in the img url. Thanks What version of Prestashop are you using? (that will determine how you fix this issue) Are you using the default theme included with Prestashop, or a custom theme? If a custom theme, then you should contact your theme provider for support. Link to comment Share on other sites More sharing options...
loupiloop Posted September 26, 2017 Share Posted September 26, 2017 (edited) I have this thème prestashop : default-bootstrap version 1.0 Et la version de PS est la 1.6.1.11 J'ai trouvé déjà une piste dans le fichier ajax_img.php d'un module. Mais il reste encore quelques erreurs que je dois trouver. insecure script 'http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js'. This request has been blocked; the content must be served over HTTPS. Merrci Edited September 26, 2017 by loupiloop (see edit history) Link to comment Share on other sites More sharing options...
bellini13 Posted September 28, 2017 Share Posted September 28, 2017 This issue would need a deeper level of debugging to solve. The template code looks correct, so I suspect the issue is in your older version of Prestashop (PS v1.6.1.10). It is possible this issue has been since fixed Link to comment Share on other sites More sharing options...
Heinrich.M Posted September 29, 2017 Share Posted September 29, 2017 (edited) I notice the exactly same error a week ago on our site. PS 1.6.15 Shoply theme. For testing purpose I replaced /theme/shoply/product.tpl, /theme/shoply/js/the product js and /controllers/product controller with Prestas' original. The problem remained?! This is really critical and needs a fix. a quick fix could be to set SSL only for the cart pages etc., so the "mixed content" warning would go away and page might be a bit faster loading. BUT I do not know if this could trigger issues with htacces since we got a dozen rewrites in it or with GoogleSearchConsole and 404er errors or so Edited September 29, 2017 by Heinrich.M (see edit history) Link to comment Share on other sites More sharing options...
Scully Posted September 29, 2017 Share Posted September 29, 2017 Heinrich, I cannot confirm this behavior. Not for 1.6.1.13 and also not for 1.6.1.15. I would guess your problem is caused by your theme. A workaround would be to fix by .htacess with the following rules before the prestashop stuff starts: #### SCULLYS REDIRECT EVERYTHING TO SSL! #### RewriteCond %{HTTPS} off RewriteRule (.*) https://%{HTTP_HOST}/$1 [L,R=301] #### DONE! #### And by the way: The product links are generated by ../classes/Link.php and there within function getProductLink. At around line 5 or 6 within this function you see $url = $this->getBaseLink($id_shop, null, $relative_protocol).$this->getLangLink($id_lang, null, $id_shop); which is a call to getBaseLink, in there you should see this code.... if ($ssl === null) { if ($force_ssl === null) { $force_ssl = (Configuration::get('PS_SSL_ENABLED') && Configuration::get('PS_SSL_ENABLED_EVERYWHERE')); } $ssl = $force_ssl; } ... if ($relative_protocol) { $base = '//'.($ssl && $this->ssl_enable ? $shop->domain_ssl : $shop->domain); } else { $base = (($ssl && $this->ssl_enable) ? 'https://'.$shop->domain_ssl : 'http://'.$shop->domain); } Which is forcing the SSL protocol. 2 Link to comment Share on other sites More sharing options...
loupiloop Posted September 29, 2017 Share Posted September 29, 2017 Thanks for your answer I really don't find where this file is charged ...... requested an insecure script 'http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js'. This content should also be served over HTTPS...... Link to comment Share on other sites More sharing options...
Scully Posted September 29, 2017 Share Posted September 29, 2017 Now we are mixing two different problems. Media server / CDN is different from what we have discussed at the beginning. It might be a bug. But you did not give any information on the initial issue and my hints. Link to comment Share on other sites More sharing options...
loupiloop Posted September 29, 2017 Share Posted September 29, 2017 Sorry I didn't see your long answer. For the problem with the "getProductLink" , it was finally a problem of cdn. I desactivate it and reactivate and empty the cache. And i know have any error in https on my images. The last problem is the script oj the bootstrap JS... 'http://maxcdn.bootst...ootstrap.min.js'. Thank you Link to comment Share on other sites More sharing options...
Scully Posted September 30, 2017 Share Posted September 30, 2017 It might be hardcoded somewhere, header.tpl as example. We don't see/have source code or an URL so we can't say more. Link to comment Share on other sites More sharing options...
loupiloop Posted September 30, 2017 Share Posted September 30, 2017 I don't find the bug A find just a line in this file : www\shop\cache\cachefs\d09e877cb9c0e4c7797a7d9c2ceeb260: 3 <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> 5: <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>";s:7:"id_lang";s:1:"2";s:8:"id_store";s:1:"1";} I change http in https, but ii doesn't work. the site is macktenfashion_com Thanks Link to comment Share on other sites More sharing options...
Scully Posted September 30, 2017 Share Posted September 30, 2017 I change http in https, but ii doesn't work. Explaining precisely helps to understand. What did you change? The file in the the cache path? And by the way.... the domain macktenfashion_com doesn't work. Link to comment Share on other sites More sharing options...
loupiloop Posted October 1, 2017 Share Posted October 1, 2017 <Hello Yes, i change the https in the cache file. There is always a mixed content with the js file, but it may figure that the site is now on https... cool, but i don't understand Do you see a securised site : macktenfashion'dot'com ? thanks Link to comment Share on other sites More sharing options...
loupiloop Posted October 1, 2017 Share Posted October 1, 2017 Hi It's ok now. I find where the js file of bootstrap was. In modules on backoffice, it was a text js module simple and i change http to https in the url and now i don't have any problems with mixed content ! Happy to find it 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