Post by akaAndrew123 » Wed Jan 16, 2019 10:53 pm

Just installed Product Extra Tab from the market place, works great, but I would like to add a jquery.reel.js script to the tab. I cannot seem to call the jquery script on page load, I have added the path in catalog/controller/product/product.php but still doesn't load into the page. I must be putting it in the wrong file ?

Code: Select all

$this->document->setTitle($product_info['meta_title']);
      $this->document->setDescription($product_info['meta_description']);
      $this->document->setKeywords($product_info['meta_keyword']);
      $this->document->addLink($this->url->link('product/product', 'product_id=' . $this->request->get['product_id']), 'canonical');
      $this->document->addScript('catalog/view/javascript/jquery/jquery.reel.js');
      $this->document->addScript('catalog/view/javascript/jquery/magnific/jquery.magnific-popup.min.js');
      $this->document->addStyle('catalog/view/javascript/jquery/magnific/magnific-popup.css');
      $this->document->addScript('catalog/view/javascript/jquery/datetimepicker/moment/moment.min.js');
      $this->document->addScript('catalog/view/javascript/jquery/datetimepicker/moment/moment-with-locales.min.js');
      $this->document->addScript('catalog/view/javascript/jquery/datetimepicker/bootstrap-datetimepicker.min.js');
      $this->document->addStyle('catalog/view/javascript/jquery/datetimepicker/bootstrap-datetimepicker.min.css');
Last edited by akaAndrew123 on Thu Jan 17, 2019 1:16 am, edited 1 time in total.

Newbie

Posts

Joined
Wed Jan 16, 2019 7:40 pm

Post by OSWorX » Wed Jan 16, 2019 11:28 pm

Code: Select all

catalog/controller/product/product.php
would be the correct file.
But you wrote you are using an extension, therefore (as far as I can remember) you should add the js & css into the new controller.

Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.


User avatar
Guru Member
Online

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria

Post by akaAndrew123 » Thu Jan 17, 2019 12:01 am

Thanks for your reply, I have added the code to that file, in the new extension there are only two files added in catalog:
catalog/controller/extension/module
catalog/view/theme/default/template/extension/module

Newbie

Posts

Joined
Wed Jan 16, 2019 7:40 pm

Post by akaAndrew123 » Thu Jan 17, 2019 1:16 am

Got it, I added it to the header.php
catalog/controller/common/header.php

Newbie

Posts

Joined
Wed Jan 16, 2019 7:40 pm

Post by OSWorX » Thu Jan 17, 2019 1:52 am

akaAndrew123 wrote:
Thu Jan 17, 2019 1:16 am
Got it, I added it to the header.php
catalog/controller/common/header.php
Also possible, but now the (not always needed) files are loaded every time!
The new extension will have a controller

Code: Select all

catalog/controller/extension/module
is only the path to the controller file.

Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.


User avatar
Guru Member
Online

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria
Who is online

Users browsing this forum: JessiesBoutique, k2tec, SelfSus and 520 guests