Jump to content

$link->getPageLink in modules is not giving me https urls


Recommended Posts

Im trying to figure out why i get ssl errors in chrome/safari ect
I have used {$base_dir_ssl} where appropriate, but some modules use {$link->getPageLink
some of these links are not using https?
is there a secure version of {$link->getPageLink

Thanks

Link to comment
Share on other sites

Im trying to figure out why i get ssl errors in chrome/safari ect
I have used {$base_dir_ssl} where appropriate, but some modules use {$link->getPageLink
some of these links are not using https?
is there a secure version of {$link->getPageLink

Thanks





getPageLink('/', false)}">{l s='Home'}
getPageLink('/blog', false)}">{l s='Blog'}
getPageLink('order.php', true)}">{l s='Cart'}
getPageLink('contact-form.php', true)}">{l s='Contact'}

 



Notice the true and false when pulling a page? True ='s Secure URL & False ='s Regular URL.

Now I have a question! I am linking a link on different kind of website in a folder call blog with /blog in the link above. My question is how do I link an external website in my maintenance.tpl?



You see in this code I am trying to direct the users to google. This is an error according to the prestashop validator. So what would be the correct code to link a external website?




Please Googlethe results.


  • Like 2
Link to comment
Share on other sites

  • 1 year later...
  • 6 months later...
  • 2 weeks later...
  • 1 year later...

Old thread, but today I ran into this. It only affected SSL in Chrome, IE was fine. I have no idea why Chrome cared about the search link.

 

In my theme blockseach-top.tpl

 

I had to change

<form method="get" action="{$link->getPageLink('search')}" id="searchbox">

 

To

<form method="get" action="{$link->getPageLink('/search',true)}" id="searchbox">

Edited by Bill Dalton (see edit history)
  • Like 3
Link to comment
Share on other sites

  • 2 months later...
  • 7 months later...
Voici ma contribution pour ce super module, afin que celui-ci prenne en compte plus de page.

 

Reste les pages search (résultat de recherche), manufacturer (la page qui listes les marques) et contact (formulaire de contact) qui ne fonctionnent pas avec la fonction getPageLink.

 

Pour info je suis sous PS 1.5.6.2

 



{if $page_name == 'category'}{foreach $languages as $lang}
<link rel="alternate" hreflang="{$lang.language_code}" href="{$link->getCategoryLink($smarty.get.id_category, null, $lang.id_lang,null,null )}" />
{/foreach}{elseif $page_name == 'product'}{foreach $languages as $lang}
<link rel="alternate" hreflang="{$lang.language_code}" href="{$link->getProductLink($smarty.get.id_product, null, null, null, $lang.id_lang, null, 0, false)}" />
{/foreach}{elseif $page_name == 'cms'}{foreach $languages as $lang}
<link rel="alternate" hreflang="{$lang.language_code}" href="{$link->getCMSLink($smarty.get.id_cms, null, false, $lang.id_lang)}" />
{/foreach}{elseif $page_name == 'manufacturer'} {foreach $languages as $lang}
<link rel="alternate" hreflang="{$lang.language_code}" href="{$link->getManufacturerLink($smarty.get.id_manufacturer, null, $lang.id_lang , null)}" />
{/foreach}{elseif $page_name == 'best-sales'} {foreach $languages as $lang}
<link rel="alternate" hreflang="{$lang.language_code}" href="{$link->getPageLink('best-sales.php', null, $lang.id_lang,null,null )}" />
{/foreach}{elseif $page_name == 'prices-drop'} {foreach $languages as $lang}
<link rel="alternate" hreflang="{$lang.language_code}" href="{$link->getPageLink('prices-drop.php', null, $lang.id_lang,null,null )}" />
{/foreach}{elseif $page_name == 'new-products'} {foreach $languages as $lang}
<link rel="alternate" hreflang="{$lang.language_code}" href="{$link->getPageLink('new-products.php', null, $lang.id_lang,null,null )}" />
{/foreach}{elseif $page_name == 'sitemap'} {foreach $languages as $lang}
<link rel="alternate" hreflang="{$lang.language_code}" href="{$link->getPageLink('sitemap.php', null, $lang.id_lang,null,null )}" />
{/foreach}{elseif $page_name == 'manufacturer'} {foreach $languages as $lang}
<link rel="alternate" hreflang="{$lang.language_code}" href="{$link->getPageLink('manufacturer', true)}" />
{/foreach}{elseif $page_name == 'search'} {foreach $languages as $lang}
<link rel="alternate" hreflang="{$lang.language_code}" href="{$link->getPageLink('search',true)}" />
{/foreach}{elseif $page_name == 'contact'} {foreach $languages as $lang}
<link rel="alternate" hreflang="{$lang.language_code}" href="{$link->getPageLink('contact', true)}" />
{/foreach}{else}
<link rel="alternate" hreflang="fr" href="http://www.domain.com/fr/" />
<link rel="alternate" hreflang="en-us" href="http://www.domain.com/en/" />
{/if}

Edited by SPKF (see edit history)
Link to comment
Share on other sites

  • 1 year later...

Old thread, but today I ran into this. It only affected SSL in Chrome, IE was fine. I have no idea why Chrome cared about the search link.

 

In my theme blockseach-top.tpl

 

I had to change

<form method="get" action="{$link->getPageLink('search')}" id="searchbox">

 

To

<form method="get" action="{$link->getPageLink('/search',true)}" id="searchbox">

 

Thanks this solve the problem !

  • Like 1
Link to comment
Share on other sites

  • 2 months later...

Old thread, but today I ran into this. It only affected SSL in Chrome, IE was fine. I have no idea why Chrome cared about the search link.

 

In my theme blockseach-top.tpl

 

I had to change

<form method="get" action="{$link->getPageLink('search')}" id="searchbox">

 

To

<form method="get" action="{$link->getPageLink('/search',true)}" id="searchbox">

 

This solution WORKS.

Link to comment
Share on other sites

  • 2 months later...

We got the problem in product-list.tpl , add to cart button don't get https

 

i think the problem is here

 

 <a class="csbutton ajax_add_to_cart_button csdefault" rel="ajax_id_product_{$product.id_product}" href="{$link->getPageLink('cart.php')}?qty=1&id_product={$product.id_product}&token={$static_token}&add" title=""><span class="in_button">{l s='Add to cart'}</span></a>

Link to comment
Share on other sites

  • 3 weeks later...

We got the problem in product-list.tpl , add to cart button don't get https

 

i think the problem is here

 

 <a class="csbutton ajax_add_to_cart_button csdefault" rel="ajax_id_product_{$product.id_product}" href="{$link->getPageLink('cart.php')}?qty=1&id_product={$product.id_product}&token={$static_token}&add" title=""><span class="in_button">{l s='Add to cart'}</span></a>

 

 

Hi guys,
 
I have the same issue. Add to cart button get http instead of https. Only on main page (other pages get ssl protocol properly). Problem with product-list.tpl and group-category.tpl. Code looks the same like above. Any sugesstion how to force ssl here?

 

 

EDIT:

 

i didn't found solution but after change http://placehold.it to https in shop template main page is secure now, so "add to cart" button without https was not a problem :)

Edited by borkson (see edit history)
Link to comment
Share on other sites

  • 1 month later...

I have the same problem, I can not get the links to be shown with https.

<a href="{$product.link}" title="{$product.name|escape:html:'UTF-8'}" class="product_image"><img src="{$link->getImageLink($product.link_rewrite, $product.id_image, 'home_default')}" alt="{$product.name|escape:html:'UTF-8'}" />{if isset($product.new) && $product.new == 1}<span class="new">{l s='New' mod='blockleoprodcarousel'}</span>{/if}</a> 


 

Someone with a brilliant idea?

Thanks :)

Link to comment
Share on other sites

I have the same problem, I can not get the links to be shown with https.

 

<a href="{$product.link}" title="{$product.name|escape:html:'UTF-8'}" class="product_image"><img src="{$link->getImageLink($product.link_rewrite, $product.id_image, 'home_default')}" alt="{$product.name|escape:html:'UTF-8'}" />{if isset($product.new) && $product.new == 1}<span class="new">{l s='New' mod='blockleoprodcarousel'}</span>{/if}</a> 

 

 

Someone with a brilliant idea?

 

Thanks :)

what exactly have you tried to do to get it to work?  you have a valid SSL certificate installed?  you enabled SSL in Prestashop back office?

Link to comment
Share on other sites

what exactly have you tried to do to get it to work?  you have a valid SSL certificate installed?  you enabled SSL in Prestashop back office?

Hi bellini13 thank you for answering.

I have enabled ssl from the backoffice and on the server.

I have also forced the redirection of ssl from the backoffice.

But the links to the products of some of the modules index, and much of the rest of the page point to http links.

The images, on the other hand, are loaded with https links.

Google recognizes my page as with mixed content and does not appear green padlock.

 

Link to comment
Share on other sites

Yeah I found one like that just the other day. In the "Feeder" module I found 'feedUrl' => Tools::getShopDomain and that created a link that was http not https. I fixed it in feeder.php by changing,

 

'feedUrl' => Tools::getShopDomain

 

to

 

'feedUrl' => Tools::getShopDomainSsl

 

May be that there is a better way, but it worked for me.

Link to comment
Share on other sites

Here is another I recently found in my theme. My logo link was http, this didn't cause an error because the link to logo image was ssl. But having the link to "Home" not SSL caused a redirect to the SSL version every time. 

 

The fix in my case was to edit header.tpl

 

Change:

<a id="header_logo" href="{$base_dir}" title="{$shop_name|escape:'htmlall':'UTF-8'}">
 
To:
<a id="header_logo" href="{$content_dir}" title="{$shop_name|escape:'htmlall':'UTF-8'}">
Link to comment
Share on other sites

  • 6 months later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...