Post by JNeuhoff » Wed Apr 13, 2016 6:08 pm

@theme: If you use the Override Engine on OpenCart 2.2.0.0 can you please upgrade it to the 6.5.6 version which has important bugfixes. It should solve your THE PAGE YOU REQUESTED CANNOT BE FOUND error.

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


User avatar
Expert Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by snowrat » Thu Apr 14, 2016 5:33 am

I just added the override opencart-2-2-0-0-override-engine-6-5-6.zip 2.2.0.0 into my Miwishop version of Opencart within Joomla and it has broken the site at 365mountains.net
I cannot see any of the front end and cannot see anything for Mijoshop/Opencart in either front or in the back
Can anyone help please?

Newbie

Posts

Joined
Wed Dec 03, 2014 3:05 am

Post by JNeuhoff » Thu Apr 14, 2016 5:55 am

Sorry, the Override Engine is for OpenCart only, I have never tested it for MijoShop nor for MiwoShop.

At the very least you should post here the error messages you get in your server's error_log, or OpenCart's error.log.

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


User avatar
Expert Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by snowrat » Thu Apr 14, 2016 7:21 pm

JNeuhoff wrote:Sorry, the Override Engine is for OpenCart only, I have never tested it for MijoShop nor for MiwoShop.

At the very least you should post here the error messages you get in your server's error_log, or OpenCart's error.log.
Ah, okay. I have since found out that Mijoshop incorporates Opencart 2.0.1.1.
When I use the Extension Installer to input the zip file for this mod I get a warning about files to be overwritten, then a warning about server issue not finding a file.
It then hangs at this point... Mofidication: This process may take long time, The modification is being scripted. Please wait!

Then at the front end I get this error.
Fatal error: Cannot redeclare utf8_strlen() (previously declared in D:\xampp\htdocs\365mountains\libraries\vendor\joomla\string\src\phputf8\mbstring\core.php:23) in D:\xampp\htdocs\365mountains\components\com_mijoshop\opencart\system\helper\utf8.php on line 5

Here is thre mysql log...
2016-04-14 13:06:53 940 [ERROR] mysqld.exe: Table '.\365mountains\base_mijoshop_zone' is marked as crashed and should be repaired
2016-04-14 13:06:53 940 [Warning] Checking table: '.\365mountains\base_mijoshop_zone'

Apache error log..
[Thu Apr 14 13:12:56.812270 2016] [:error] [pid 2504:tid 1656] [client ::1:5415] PHP Fatal error: Cannot redeclare utf8_strlen() (previously declared in D:\\xampp\\htdocs\\365mountains\\libraries\\vendor\\joomla\\string\\src\\phputf8\\mbstring\\core.php:23) in D:\\xampp\\htdocs\\365mountains\\components\\com_mijoshop\\opencart\\system\\helper\\utf8.php on line 5
[Thu Apr 14 13:13:31.188237 2016] [:error] [pid 2504:tid 1656] [client ::1:5420] PHP Fatal error: Cannot redeclare utf8_strlen() (previously declared in D:\\xampp\\htdocs\\365mountains\\libraries\\vendor\\joomla\\string\\src\\phputf8\\mbstring\\core.php:23) in D:\\xampp\\htdocs\\365mountains\\components\\com_mijoshop\\opencart\\system\\helper\\utf8.php on line 5, referer: http://localhost/365mountains/administr ... 97a3dfc5e7

Newbie

Posts

Joined
Wed Dec 03, 2014 3:05 am

User avatar
Expert Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by bobi88 » Thu Apr 28, 2016 3:14 am

Hi, I am using OC 2.2, and the Override 6.5.7, after installing Override Engine, I install VQmod v2.6.1-opencart, after installing VQmod, i got errors :
Fatal error: Uncaught exception 'ReflectionException' with message 'Class Customer does not exist' in C:\wamp64\www\opencart2.2\system\engine\factory.php on line 500
ReflectionException: Class Customer does not exist in C:\wamp64\www\opencart2.2\system\engine\factory.php on line 500

Do you know any solution for these errors ? thank you !

Newbie

Posts

Joined
Thu Apr 28, 2016 3:10 am

Post by JNeuhoff » Fri Apr 29, 2016 10:51 pm

bobi88 wrote:Hi, I am using OC 2.2, and the Override 6.5.7, after installing Override Engine, I install VQmod v2.6.1-opencart, after installing VQmod, i got errors :
Fatal error: Uncaught exception 'ReflectionException' with message 'Class Customer does not exist' in C:\wamp64\www\opencart2.2\system\engine\factory.php on line 500
ReflectionException: Class Customer does not exist in C:\wamp64\www\opencart2.2\system\engine\factory.php on line 500

Do you know any solution for these errors ? thank you !
There is indeed no class 'Customer' in OpenCart 2.2.0.0, it should be 'Cart\Customer'. I suggest you clear the vqmod/*.cache and vqmod/cache caches, and then try again. If the error comes back then you either have an old VQmod XML script, or an override class, not having been properly ported to OpenCart 2.2.0.0. The 'Cart\Customer' class is now in system/library/cart/customer.php, not in system/library/customer.php.

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


User avatar
Expert Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by IndigoStarfish » Mon Jun 13, 2016 9:32 pm

Great mod. Love it.

Came across an issue when using your mod with VQMod (OC 2.2.0.0, VQ 2.6.1, OE 6.5.7).

Code: Select all

system/engine/factory.php
#415		// load original class file (possibly modified by vqmod)
#416		$file = $this->modCheck( $file );
#417		require_once( $file );
#418
#419		// get latest file date of original and override files
#420		$date = $this->findLatestFileDate( $file, $modFiles );
#421
#422		// find namespace for class
#423		$namespace = $this->findNameSpace( $file );
In factory.php on line #423 where you get the namespace for the file, you do so after the file path is potentially modified to a vqmod cache path on line #416
e.g. system/library/cart/cart.php -> vqmod/vqcache/vq2-system_library_cart_cart.php

When this is the case, the findNameSpace function is unable to get the correct namespace for the class being loaded and so throws a fatal error when attempting to construct the class. ($namespace = '', instead of $namespace = 'cart').

Code: Select all

Fatal error: Uncaught exception 'ReflectionException' with message 'Class Cart does not exist' in /home/example/public_html/system/engine/factory.php:500
I believe it will be sufficient to just move lines #422-423 above #415.

Hope this helps.


Posts

Joined
Mon Jun 13, 2016 9:20 pm

User avatar
Expert Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by TurabG » Fri Jul 01, 2016 10:09 pm

When this override is used, can also modifications be installed that require vQmod? Or will they still require vQmod? If they will still require vQmod, then I missed the point of this modifications.

Actually I am a developer and the idea came nice to me; but I am still trying to understand it better.

Newbie

Posts

Joined
Fri Jul 01, 2016 10:07 pm

Post by JNeuhoff » Thu Jul 07, 2016 4:20 pm

You can have both the Override Engine and a VQmod installed on your OpenCart. Some extensions require the Override Engine, others make use of VQmod.

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


User avatar
Expert Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by JNeuhoff » Wed Aug 03, 2016 6:27 am

Now available for OpenCart 2.3.0.2.

Note: There won't be a release for 2.3.0.0 nor for 2.3.0.1 because these OpenCart releases failed to include important bugfixes from the beta-release, and are superseded by 2.3.0.2.

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


User avatar
Expert Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by KontYentE » Sun Sep 04, 2016 3:52 pm

Hi everyone...

I'm NOT new to Opencart anymore, (since August 2015) but new to OVERRIDE
Override Engine works great on me with version 2.3.0.2 under a new temporary domain http://www.swissempire.com

I just upgraded from version 2.1.0.1 (New installation) and while converting my 3rd party modules (my own modules) which can be seen under http://www.transfer.plus (might not work some times due to experiments, but please have a look, and yesss this is OC still under 2.1.0.1), i came across this preRender situation.
It doesn't seem to be such a difficult thing to understand, however is not working very well on me either. :crazy:

Here is an example:
I need to add a new checkbox to catalog/category_form.tpl right under the $entry_top.

So initially i created a category_form.tpl under my override folder, which didn't work (of course !!!)
so after understanding the preRender function, I changed the controller (category.php) under my override folder and add this to it:

Code: Select all

<?php
class addon3_ControllerCatalogCategory extends ControllerCatalogCategory {
//ADDON3
	public function preRender( $template_buffer, $template_name, &$data ) {
	    if ($template_name != 'catalog/category_form.tpl') {
	        return parent::preRender( $template_buffer, $template_name, $data );
    	}	
		
/* LINGUAGEM PARA CHECKBOX CITY */
		$data['entry_city'] = $this->language->get('entry_city');
/* LINGUAGEM PARA TOOLTIP AJUDA */
		$data['help_city'] = $this->language->get('help_city');
			// modify template file
		$template_buffer = str_replace(
			'<?php echo $entry_top; ?>','<?php echo $entry_city; ?>',$template_buffer
		);
		return parent::preRender( $template_buffer, $template_name, $data );
	}
So even if the language file is not loaded, something would have to happen like getting a (entry_city) instead of (Top) but it didn't.

Could some of you please have a short look and help? O0
Just to clarify, i'm doing this under OC 2.3.0.2 and using the apropriate Override Engine as well.
Thanks

Image


Newbie

Posts

Joined
Sun Sep 04, 2016 3:30 pm
Location - Zurich

Post by JNeuhoff » Mon Sep 05, 2016 5:54 am

I can't see anything wrong in your example code which simply replaces entry_top with your entry_city. Can you provide more details of what exactly is going wrong?

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


User avatar
Expert Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by KontYentE » Mon Sep 05, 2016 6:37 pm

yes of course....
I have some more details about this..
I've figured out that the get(config_template) does no longer exists in OC 2302 and that now there is a new name for the same content (config_theme).
Well, that's easy to fix, however the TPL file i'm about to change doesn't belong to the public catalog theme but the admin catalog theme, which doesn't require to figure out which theme as been selected as default. So i suppose the correct call would be:

Code: Select all

class addon2_ControllerCatalogCategory extends ControllerCatalogCategory {

public function preRender( $template_buffer, $template_name, &$data ) {
        if ($template_name != '/admin/view/template/common/category_form.tpl') {
            return parent::preRender( $template_buffer, $template_name, $data );
        }
       
        // add new controller variables


            $this->language->load('catalog/category');
            $data['breadcrumbs'] = array();

		$data['breadcrumbs'][] = array(
			'text' => $this->language->get('text_home'),
			'href' => $this->url->link('common/dashboard_2', 'token=' . $this->session->data['token'], 'SSL')
		);

        return parent::preRender( $template_buffer, $template_name, $data );
    }
}
in this case i want to change the route to "dashboar_2".
Would this be the right way overrite it?

Image


Newbie

Posts

Joined
Sun Sep 04, 2016 3:30 pm
Location - Zurich

Post by KontYentE » Mon Sep 05, 2016 6:49 pm

I got it ;D

Just add to call it the same way the controller does it.
However this was a preRender test on version OC 2101
Later I'll test the OC2302 and post it here as well.

class addon2_ControllerCatalogCategory extends ControllerCatalogCategory {

Code: Select all

public function preRender( $template_buffer, $template_name, &$data ) {
        if ($template_name != 'catalog/category_form.tpl') {
            return parent::preRender( $template_buffer, $template_name, $data );
        }
        $this->language->load('catalog/category');

		$data['breadcrumbs'] = array();

		$data['breadcrumbs'][] = array(
			'text' => $this->language->get('text_home'),
			'href' => $this->url->link('common/dashboard_2', 'token=' . $this->session->data['token'], 'SSL')
		);
        return parent::preRender( $template_buffer, $template_name, $data );
    }
}

Image


Newbie

Posts

Joined
Sun Sep 04, 2016 3:30 pm
Location - Zurich

Post by KontYentE » Mon Sep 05, 2016 11:13 pm

So, as promised i'm sharing the tests on OC 2.3.0.2

Had some difficulties searching for a multi-line string at the str_replace function, but just follow the example in case you would like to modify your category_form.tpl or product_form.tpl in your admin folder.

Code: Select all

<?php
class addon3_ControllerCatalogCategory extends ControllerCatalogCategory {

	public function preRender( $template_buffer, $template_name, &$data ) {
        if ($template_name != 'catalog/category_form.tpl') {
            return parent::preRender( $template_buffer, $template_name, $data );
        }
        $this->language->load('catalog/category');
/* LINGUAGEM PARA CHECKBOX CITY */
		$data['entry_city'] = $this->language->get('entry_city');
/* LINGUAGEM PARA TOOLTIP AJUDA */
		$data['help_city'] = $this->language->get('help_city');
			// modify template file

/* REQUEST O VALOR DE CITY */

		if (isset($this->request->post['city'])) {
			$data['city'] = $this->request->post['city'];
		} elseif (!empty($category_info)) {
			$data['city'] = $category_info['city'];
		} else {
			$data['city'] = 0;
		}
// END 
	
				$template_buffer = str_replace('
              <div class="form-group">
                <label class="col-sm-2 control-label"><?php echo $entry_image; ?></label>
                <div class="col-sm-10"><a href="" id="thumb-image" data-toggle="image" class="img-thumbnail"><img src="<?php echo $thumb; ?>" alt="" title="" data-placeholder="<?php echo $placeholder; ?>" /></a>
                  <input type="hidden" name="image" value="<?php echo $image; ?>" id="input-image" />
                </div>
              </div>',
            '<div class="form-group">
                <label class="col-sm-2 control-label"><?php echo $entry_image; ?></label>
                <div class="col-sm-10"><a href="" id="thumb-image" data-toggle="image" class="img-thumbnail"><img src="<?php echo $thumb; ?>" alt="" title="" data-placeholder="<?php echo $placeholder; ?>" /></a>
                  <input type="hidden" name="image" value="<?php echo $image; ?>" id="input-image" />
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-2 control-label" for="input-city"><span data-toggle="tooltip" title="<?php echo $help_city; ?>"><?php echo $entry_city; ?></span></label>
                <div class="col-sm-10">
                  <div class="checkbox">
                    <label>
                      <?php if ($city) { ?>
                      <input type="checkbox" name="city" value="1" checked="checked" id="input-city" />
                      <?php } else { ?>
                      <input type="checkbox" name="city" value="1" id="input-city" />
                      <?php } ?>
                      &nbsp; </label>
                  </div>
                </div>
              </div>',
				$template_buffer
			);


        return parent::preRender( $template_buffer, $template_name, $data );
    }
}
I've used the preRender to insert another checkbox.

VERY IMPORTANT: You don't have to copy all the controller file (category_form.tpl in this case) otherwise you might end up overwriting some variables previously set. (this happened with me before :|)

I hope this helps someone out there in the some situation :crazy:

Image


Newbie

Posts

Joined
Sun Sep 04, 2016 3:30 pm
Location - Zurich

Post by keraknasi » Wed Nov 23, 2016 9:22 am

Can someone explain to me how to use override engine? i cannot find example to my question - how to access $this->error when i want to overrride validateForm()? ex. i want to add username field in admin, and add validating username exist in database

Newbie

Posts

Joined
Tue Nov 22, 2016 11:36 pm

Post by JNeuhoff » Sat Nov 26, 2016 5:56 am

keraknasi wrote:Can someone explain to me how to use override engine? i cannot find example to my question - how to access $this->error when i want to overrride validateForm()? ex. i want to add username field in admin, and add validating username exist in database
Unfortunately the $this->error is private, therefore cannot be accessed from an extended class. However, in an overridden validateForm method you can store additional validation errors in session variables, e.g. $this->session->data['error_username']. Then, in the preRender method, do something like this:

Code: Select all

	// overridden method
	public function preRender( $template_buffer, $template_name, &$data ) {
		// ......
		if (!isset($this->session->data['error_username'])) {
			$data['error_username'] = $this->session->data['error_username'];
			unset($this->session->data['error_username']);
		}
		// .....
		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


User avatar
Expert Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by keraknasi » Tue Dec 06, 2016 5:49 pm

JNeuhoff wrote:
keraknasi wrote:Can someone explain to me how to use override engine? i cannot find example to my question - how to access $this->error when i want to overrride validateForm()? ex. i want to add username field in admin, and add validating username exist in database
Unfortunately the $this->error is private, therefore cannot be accessed from an extended class. However, in an overridden validateForm method you can store additional validation errors in session variables, e.g. $this->session->data['error_username']. Then, in the preRender method, do something like this:

Code: Select all

	// overridden method
	public function preRender( $template_buffer, $template_name, &$data ) {
		// ......
		if (!isset($this->session->data['error_username'])) {
			$data['error_username'] = $this->session->data['error_username'];
			unset($this->session->data['error_username']);
		}
		// .....
		return parent::preRender( $template_buffer, $template_name, $data );
	}
ok thanks, and then how about when i am about to replace some code in controller index? ex. i want to add new menu under sale in admin menu opencart Version 2.3.0.2

this is code that i made, but still not working

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')) {
			$sale[] = array(
				'name'	   => $this->language->get('text_convert_coin'),
				'href'     => $this->url->link('convert/coin', 'token=' . $this->session->data['token'], true),
				'children' => array()
			);
		}

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

Newbie

Posts

Joined
Tue Nov 22, 2016 11:36 pm
Who is online

Users browsing this forum: No registered users and 17 guests