Post by weilik » Tue Jan 17, 2017 1:35 pm

Hi. I am trying to insert some codes (for Analytics purposes specifically Facebook Pixels) in between <head></head> so I read up in the forums that I should insert within header.tpl (located in /catalog/view/theme/journal2/template/common)

Yes, I have Journal 2 installed on OC v2.1.0.2. Do not have any other mods.

Problem is I cannot comprehend where the in between <head> lines start as my header.tpl seems to be sputtering gibberish. I have taken liberty to reproduce it as per below.

Code: Select all

Journal Installation Error
Make sure you have uploaded all Journal files to your server and successfully replaced system/engine/front.php file.
Please read this: here.
'; exit(); } if (!$currency) { $this->journal2->html_classes->addClass('no-currency'); } if (!$language) { $this->journal2->html_classes->addClass('no-language'); } ?> journal2->settings->get('responsive_design', '1') === '1'): ?> journal2->settings->get('pinch_zoom', '1') === '1'): ?> journal2->settings->get('blog_meta_title')): ?> journal2->settings->get('share_metas', array()) as $sm): ?> ="" content="" /> journal2->settings->get('blog_blog_feed_url')): ?> journal2->minifier->addStyle($style['href']); ?> journal2->google_fonts->getFonts() as $font): ?> journal2->minifier->addScript($script, 'header'); ?> journal2->minifier->addStyle('catalog/view/theme/journal2/css/hint.min.css'); $this->journal2->minifier->addStyle('catalog/view/theme/journal2/css/journal.css'); $this->journal2->minifier->addStyle('catalog/view/theme/journal2/css/features.css'); $this->journal2->minifier->addStyle('catalog/view/theme/journal2/css/header.css'); $this->journal2->minifier->addStyle('catalog/view/theme/journal2/css/module.css'); $this->journal2->minifier->addStyle('catalog/view/theme/journal2/css/pages.css'); $this->journal2->minifier->addStyle('catalog/view/theme/journal2/css/account.css'); $this->journal2->minifier->addStyle('catalog/view/theme/journal2/css/blog-manager.css'); $this->journal2->minifier->addStyle('catalog/view/theme/journal2/css/side-column.css'); $this->journal2->minifier->addStyle('catalog/view/theme/journal2/css/product.css'); $this->journal2->minifier->addStyle('catalog/view/theme/journal2/css/category.css'); $this->journal2->minifier->addStyle('catalog/view/theme/journal2/css/footer.css'); $this->journal2->minifier->addStyle('catalog/view/theme/journal2/css/icons.css'); if ($this->journal2->settings->get('responsive_design')) { $this->journal2->minifier->addStyle('catalog/view/theme/journal2/css/responsive.css'); } $this->journal2->minifier->addStyle('catalog/view/theme/journal2/css/flex.css'); $this->journal2->minifier->addStyle('catalog/view/theme/journal2/css/rtl.css'); ?> journal2->minifier->css(); ?> journal2->cache->getDeveloperMode() || !$this->journal2->minifier->getMinifyCss()): ?> journal2->minifier->addScript('catalog/view/theme/journal2/js/journal.js', 'header'); ?> journal2->minifier->loadGoogleRecaptcha()): ?> journal2->minifier->js('header'); ?> journal2->settings->get('config_header_modules')): ?> journal2->settings->get('config_header_modules'); ?> journal2->settings->get('header_type', 'default'); if ($header_type === 'extended') { $header_type = 'default'; } if ($header_type === 'compact') { $header_type = 'compact'; } if ($header_type === 'center') { $header_type = 'center'; } if ($header_type === 'mega') { $header_type = 'mega'; } if (class_exists('VQMod')) { global $vqmod; if ($vqmod !== null) { require $vqmod->modCheck(DIR_TEMPLATE . $this->config->get('config_template') . "/template/journal2/headers/{$header_type}.tpl"); } else { require VQMod::modCheck(DIR_TEMPLATE . $this->config->get('config_template') . "/template/journal2/headers/{$header_type}.tpl"); } } else { require DIR_TEMPLATE . $this->config->get('config_template') . "/template/journal2/headers/{$header_type}.tpl"; } ?> journal2->settings->get('config_top_modules')): ?>
journal2->settings->get('config_top_modules'); ?> 
Can anyone please help enlighten me? My site does not have any installation error whatsoever. It is running fine.

Regards,
Lee

Newbie

Posts

Joined
Fri Feb 26, 2016 4:27 pm

Post by viethemes » Tue Jan 17, 2017 3:28 pm

You can use my free extension Custom JS to insert your code into the header.

http://www.viethemes.com - OpenCart turtorials, news, tips and stricks, extension

Our extensions:
Visual Theme Editor - Powerful tool for customizing style of any theme visually
Live Theme Editor - Customize layout, colors, backgrounds, fonts of the default theme
Theme Animation - Animation Editor for any theme

Extra Positions PRO, Custom JavaScript, Custom CSS and others


User avatar
Active Member

Posts

Joined
Thu Jan 08, 2015 12:17 pm


Post by thekrotek » Tue Jan 17, 2017 5:56 pm

You can always do a simple Search in Files - every decent editor has this function. In your example, you could just search for "</head>" in unpacked Journal theme folder and find out, which file contains it. Using this simple technique, you can find any string in any extension or OpenCart itself.

Try it yourself. It's easy and fun :-)

Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com


User avatar
Expert Member

Posts

Joined
Sun Jul 03, 2016 12:24 am

Who is online

Users browsing this forum: No registered users and 2 guests