Post by JNeuhoff » Tue Dec 06, 2016 11:24 pm

I think this should work:

Code: Select all

<?php
class add_convert_coin_menu_ControllerCommonColumnLeft extends ControllerCommonColumnLeft {
	 public function preRender( $template_buffer, $template_name, &$data ) {
			if ($template_name != 'common/column_left.tpl') {
				 return parent::preRender( $template_buffer, $template_name, $data );
			}

			$this->load->language('common/column_left');

			if ($this->user->hasPermission('access', 'convert/coin')) {
				$convert_coin_menu = array(
					'name'     => $this->language->get('text_convert_coin'),
					'href'     => $this->url->link('convert/coin', 'token=' . $this->session->data['token'], true),
					'children' => array()
				);
				$sales_menu = null;
				foreach ($data['menus'] as $i=>$menu) {
					if ($menu['id']=='menu-sale') {
						$sales_menu = $menu;
						$sales_menu['children'][] = $convert_coin_menu;
						$data['menus'][$i] = $sales_menu;
						break;
					}
				}
				if (!$sales_menu) {
					$sales_menu = array(
						'id'       => 'menu-sale',
						'icon'	   => 'fa-shopping-cart', 
						'name'	   => $this->language->get('text_sale'),
						'href'     => '',
						'children' => array( $convert_coin_menu )
					);
					$data['menus'][] = $sales_menu;
				}
			}

			return parent::preRender( $template_buffer, $template_name, $data );
	 }
		
?>

MHC Web Design
Override Engine * Integrated VQMod * Multilingual SEO * Instant Option Price Calculator * TrustPilot Reviews * Download Options * Free Download Buttons * Export/Import Tool * Template Switcher PHP/Twig


User avatar
Expert Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by keraknasi » Wed Dec 07, 2016 12:56 am

JNeuhoff wrote:I think this should work:

Code: Select all

<?php
class add_convert_coin_menu_ControllerCommonColumnLeft extends ControllerCommonColumnLeft {
	 public function preRender( $template_buffer, $template_name, &$data ) {
			if ($template_name != 'common/column_left.tpl') {
				 return parent::preRender( $template_buffer, $template_name, $data );
			}

			$this->load->language('common/column_left');

			if ($this->user->hasPermission('access', 'convert/coin')) {
				$convert_coin_menu = array(
					'name'     => $this->language->get('text_convert_coin'),
					'href'     => $this->url->link('convert/coin', 'token=' . $this->session->data['token'], true),
					'children' => array()
				);
				$sales_menu = null;
				foreach ($data['menus'] as $i=>$menu) {
					if ($menu['id']=='menu-sale') {
						$sales_menu = $menu;
						$sales_menu['children'][] = $convert_coin_menu;
						$data['menus'][$i] = $sales_menu;
						break;
					}
				}
				if (!$sales_menu) {
					$sales_menu = array(
						'id'       => 'menu-sale',
						'icon'	   => 'fa-shopping-cart', 
						'name'	   => $this->language->get('text_sale'),
						'href'     => '',
						'children' => array( $convert_coin_menu )
					);
					$data['menus'][] = $sales_menu;
				}
			}

			return parent::preRender( $template_buffer, $template_name, $data );
	 }
		
?>
nice, it works. thanks for you fast response to solve my problem

Newbie

Posts

Joined
Tue Nov 22, 2016 11:36 pm

Post by arnocn » Sat Jul 08, 2017 4:42 pm

hello,
I use OC2.0.3.1, i move my site to the new server today, before the move, the site worked fine. but in the new server, i get this error:
Fatal error: Class 'Factory' not found in /the site root/index.php on line 54

the code of the line 54 and 55 in index.php is:
$config = $factory->newConfig();
$registry->set('config', $config);

Anyone know what may cause the problem?
Thanks in advance.

Newbie

Posts

Joined
Sat Jul 08, 2017 4:40 pm

Post by JNeuhoff » Sun Jul 09, 2017 12:20 am

Make sure the file 'system/engine/factory.php' is there, and that the system/startup.php includes this file.

MHC Web Design
Override Engine * Integrated VQMod * Multilingual SEO * Instant Option Price Calculator * TrustPilot Reviews * Download Options * Free Download Buttons * Export/Import Tool * Template Switcher PHP/Twig


User avatar
Expert Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by arnocn » Tue Jul 11, 2017 7:13 pm

@JNeuhoff
Hi, thanks for your reply.
I checked, the file 'system/engine/factory.php' is there.
and in file system/startup.php, i can see this code:
require_once(DIR_SYSTEM . 'engine/factory.php');

The site was working fine before i move it to the new server.
The problem only exist on the new server.

Any more suggestion?

Thanks!

Newbie

Posts

Joined
Sat Jul 08, 2017 4:40 pm

Post by arnocn » Wed Jul 12, 2017 12:40 am

Hi,

Thank you for your kind reply.
The problem is solved now! I realized there is mistake in file config.php and admin/config.php. :-[
I did not write correct folder/root, and after i correct it, everything is working fine now.

Newbie

Posts

Joined
Sat Jul 08, 2017 4:40 pm
Who is online

Users browsing this forum: Yahoo [Bot] and 11 guests