0
我啓用SSL對我的Prestashop 1.6:如何更改HTTP到HTTPS在的Prestashop 1.6加入購物車
Preferences > General > Enable SSL
Preferences > General > Enable SSL on all pages
在.htaccess我用下面的代碼:
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
# ~~start~~ Do not remove this comment, Prestashop will keep automatically the code outside this comment when .htaccess will be generated again
前
一切看起來不錯,但在網頁頁面源代碼仍然看到:
<a class="button ajax_add_to_cart_button btn btn-default" href="http://www.myeshop.com/cart?add=1&id_product=9&token=2db68311c3192a52b4eca5bc1b2c218f" rel="nofollow" title="Add to cart" data-id-product="9"> <span>Add to cart</span> </a>
href鏈接加入購物車按鈕指向http而不是https。 你能幫我嗎? Registers Jan
感謝Melvita爲您的快速響應。我把你的源代碼放到'themes/my_theme/js/modules/blockcart/ajax-cart.js'中。當我在我的谷歌瀏覽器中使用_Inspect_時,我在_Add to cart_ button中看到https。但是,如果我顯示所有的網頁源代碼,我仍然看到http而不是https:( – JanZitniak
是的,因爲我告訴你這是一個讓你找到更好的解決方案的訣竅,Javascript不是你問題的最佳答案。如果你看到http的源代碼,當你在執行Js之前看到源代碼時,可能會發生這種情況,但是你需要再次糾正它,而不需要Js,很抱歉,如果沒有源代碼和代碼,它很難給出更多的建議,希望你找到一個solution.cheers – Melvita