Jump to content

PS 1.6.0.8 Theme problem


Recommended Posts

Hello,

 

I have got a problem with my themes after the upgrade to 1.6.0.8. When i select the defealt theme everything works fine. But when i select my custom theme my navigation dropdown is broken. And all the others links and roll-overs doesn't work correct anymore...

 

Greets,

Wesley 

Link to comment
Share on other sites

Check if you have bottom code in your templates header.tpl:

{if isset($js_defer) && !$js_defer && isset($js_files) && isset($js_def)}
    {$js_def}
    {foreach from=$js_files item=js_uri}
    <script type="text/javascript" src="{$js_uri|escape:'html':'UTF-8'}"></script>
    {/foreach}
{/if}

If not, put it just after this code:

{if isset($css_files)}
    {foreach from=$css_files key=css_uri item=media}
        <link rel="stylesheet" href="{$css_uri|escape:'html':'UTF-8'}" type="text/css" media="{$media|escape:'html':'UTF-8'}" />
    {/foreach}
{/if}
  • Like 1
Link to comment
Share on other sites

I have used the rollback option but right now i have updated it again. See www.koixl.com for the problem

Okay i am getting close... i have copied the topmenu.js from the defealt theme to my custom theme and it is almost working correctly. For one reason the css has been changed a little bit... One subcat hase been moved to another position without chancing the css... Not the biggest problem but i am asking myself why to update anymore. Everytime i have got this little bugs over again.

 

Sorry for the bad english... We have got more footbal skills... :D  :D  :D 

 

Greets,

Wesley 

  • Like 1
Link to comment
Share on other sites

Hi,

 

Did someone find a solution ?

 

I am in the same situation : after upgrading from 1.6.0.5 to 1.6.0.8, my theme does not work correctly anymore, like if JS was disabled : no more rollover menu, no more popup galleries on product page, etc.

 

The theme was bought on Prestashop Addons 10 days ago, from a certified developer, so I think the mistake probably is on Prestashop... What happened to the JS between 1.6.0.5 and 1.6.0.8 ???

Link to comment
Share on other sites

I had the same exact problem. After upgrading my staging server from 1.6.0.6 to 1.6.0.8 my top menu, slider and other JS related modules did not function properly in the FO. Viewing the source of my FO homepage revealed that all of my previous JS scripts (including jQuery) were missing!

 

It was dioniz solution here that helped me discover the cause of the missing JS. My custom edited theme (copied from Bootstrap v1.6.0.6) now seems to work, but I am planning to take a more comprehensive approach.

 

I'm using an awesome free tool (https://sourcegear.com/diffmerge/) to do the following:

  1. Compare for changed files between Bootstrap v1.6.0.6 theme and my custom theme, so I know what I changed (mostly .tpl)
  2. Start with latest Bootstrap theme and replicate above changes, so I'll have all new / changed functionality

Not doing the same for CSS.. WAAAY too many changes to do that!Hope this helps.

  • Like 1
Link to comment
Share on other sites

Rom, I can't believe they added a feature to disable moving JS to the bottom.. I had a piece of tracking code for my Marketing Automation system (www.getrainmaker.com) that had to stay intact and it took me a WEEK to make class override to skip that one.. All that work for nothing!! LOL

Link to comment
Share on other sites

Yan, since I'm online, I'll try to explain until Rom is able to respond—I know what it's like waiting when you have an issue :/

 

Prior to introducing the setting: Advanced settings > Performance, activate "Put JS at the end", PS always moved JS files and inlined scripts to the bottom of the page, even if you added them to header.tpl.

 

I expect if you enable the above, that functionality will continue. And if you disable, I expect any JS added to header.tpl (or anywhere else) will stay there, unchanged.

  • Like 1
Link to comment
Share on other sites

With js files at the end, sites are loading faster and your site will load even if external js fail to load.

Some theme's and modules didn't work with js at the end and there were many complaints about that.

That's why they made ti this way so you can have js at the beginning or at the end of file.

But to for that to work, they had to add code to header.tpl.

And if you made custom theme before 1.6.0.8, you need to add that code to your custom theme.

  • Like 1
Link to comment
Share on other sites

dioniz, just FYI for everyone: what happened to me was that my custom theme of course did not have the new code in header.tpl that PS 1.6.0.8 now uses for JS deferral and the result was NO JS anywhere in the FO, assuming the default setting of the new Advanced settings > Performance > "Put JS at the end" setting as I didn't even know it was added.

 

This must be breaking many people's themes as the default settings result in no JS at all!

Link to comment
Share on other sites

Hi Yan,

 

I stopped at solution 1, but about solution 2 this is what I understood :

 

On the topic I found, they give the code lines to add in themes/yourtheme/header.tpl :

http://www.prestashop.com/forums/topic/338300-solved-1607-no-js-files-loaded/#post_id_1707846

( message #8 from "El Patron" )

It seems those lines appeared recently in Prestashop and its default theme, and if you do not add them to your custom theme, you will get no JS at all.

In message #11, Dioniz explains the exact place to insert those lines

 

 

Solution 1 vs 2 :

 

If S1 works with your theme, go for it !

Like Abdulk & Dioniz explained, moving JS at the bottom of the code is a good habit to accelerate the rendering of a page, especially on mobile devices with slow connections and/or limited processing power...

 

If your theme just cannot work this way, then go for solution 2.

 

+ Solution 1.5 ( for your Marketing Automation system, Abdulk ?): I know it is not clean coding, but if you only need to include a specific JS file at the beginning of your code, you can still "hardcode" it alone in header.tpl, and let the rest at the bottom !

  • Like 2
Link to comment
Share on other sites

×
×
  • Create New...