Post by rahul1235 » Thu May 28, 2020 2:07 pm

Hi. I want to modify header.twig in opencart 3x. I went to :

catalog/view/theme/journal2/common/header.twig


and modified the script to defer the js

Code: Select all

{% for script in scripts %}
{{- journal2.minifier.addScript(script, 'header', true, false) -}}
{% endfor %}
but it doesn't work. I cleared the cache and all. I also put a comment above to know if it is being picked up and it is picked up but script did not contain defer attribute after change.

I also tried this:

{% for script in scripts %}
<script src= ....... syntax
{% endfor %}


but it didn't work. I really want to know from where all the different JS in the header is coming. Its reducing pagespeed score.

Newbie

Posts

Joined
Sat May 23, 2020 12:57 am

Post by paulfeakins » Thu May 28, 2020 7:45 pm

Ask Journal.

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Legendary Member

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom
Who is online

Users browsing this forum: No registered users and 8 guests