Jump to content

News Module Broke After Ssl Enabled


Recommended Posts

The module name is News, Blog, Articles.  It's no longer listed on Prestashop's website.  The developer has not responded to my emails.  I contacted Prestashop Customer Support and they were extremely unhelpful.  I told them "I can't reach the developer through the module download page."  Their response was to contact the developer through the addon site.  Nice of them to tell me to use the form I've already had no success with. 

 

The issue I'm having is that the Ajax loader breaks when I have SSL enabled. Chrome lists the error as Mixed Content and says This request has been blocked; the content must be served over HTTPS

 

TPL Snippet

<a href="{$link->getModuleLink('news', 'list',
          [
             'cat_news' => "{$cats->id}",
             'page_cat' => 0,
             'rewrite'  => "{$cats->rewrite}"
          ]
           ,false)}"title="{$cats->title|truncate:50:'...'|escape:html:'UTF-8'}">
           {$cats->title|escape:html:'UTF-8'}
</a>

What the button looks like

<a alt="Next News" class="newsPager page_more"
href="http://domain.com/news/list/4-2/news.html?search_news=&tag_news="
onclick="news_ajax('http://domain.com/news/list/4-2/news.html?search_news=&tag_news=&ajaxnewslist=1');return false;">
Show more
</a>

How can I force the url to use the HTTPS for the button?

 

Prestashop Version: 1.6.1.1

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

try changing false to true in the TPL file.  that parameter controls the usage of HTTPS

           ,false)}"title="{$cats->title|truncate:50:'...'|escape:html:'UTF-8'}">
           ,true)}"title="{$cats->title|truncate:50:'...'|escape:html:'UTF-8'}">
Link to comment
Share on other sites

It works! Tested in Firefox and Chrome.  I looked at the Link class and I think I see what you did here.  But how did you know that false meant for SSL?  Does it basically go in order?

public function getModuleLink(
$module, <-news
$controller = 'default', <-list
array $params = array(), <-cat_news, page_cat, rewrite
$ssl = null, <-false
$id_lang = null, 
$id_shop = null, 
$relative_protocol = false)
Edited by nbarnum (see edit history)
Link to comment
Share on other sites

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...