title: How can I defer or async javascript in OpenCart
body: <p>I have OpenCart application. Javascripts are loaded in settings.php inside path '/catalog/controller//settings.php with similar codes as:</p>
  
  <pre><code> $this-&gt;document-&gt;addScript('catalog/view/theme/&lt;theme&gt;/lib/lazy/jquery.lazy.1.6.min.js');
      $this-&gt;journal2-&gt;minifier-&gt;addScript('catalog/view/theme/&lt;theme&gt;/lib/actual/jquery.actual.min.js', 'header');
      $this-&gt;journal2-&gt;minifier-&gt;addScript('catalog/view/theme/&lt;theme&gt;/lib/hover-intent/jquery.hoverIntent.min.js', 'footer');
  </code></pre>
  
  <p>Here, 'theme' means theme name that is installed. I want to defer or async these javascript loading in OpenCart, how can I do it?</p>
  
  <p>I know that addScript syntax has 1s parameter as file, second location, 3rd defer and 4th async where defer and async can be boolean.
  I have tried statement as below to see defer false and async true:</p>
  
  <pre><code> $this-&gt;journal2-&gt;minifier-&gt;addScript('catalog/view/theme/&lt;theme&gt;/lib/hover-intent/jquery.hoverIntent.min.js', 'footer', false, true);
  </code></pre>
  
  <p>but I am not sure if this will work or not. Please suggest</p>