Page 13 of 17

Re: [RELEASED] Override Engine for OpenCart

Posted: Thu Apr 16, 2015 5:15 pm
by JNeuhoff
atnaples:

None of this has anything to do with the Override Engine.

catalog/model/checkout/order.php,
catalog/model/checkout/voucher.php,
catalog/model/openbay/ebay_order.php
admin/model/sale/voucher.php
system/library/openbay.php

are all buggy, and they all should use

Code: Select all

$language->load($order_info['language_directory']);
instead of

Code: Select all

$language->load('default')

As regards the admin/controller/extension/modification.php file:

This is about OCmod, which was changed again by Daniel, see e.g. this forum post

Re: [RELEASED] Override Engine for OpenCart

Posted: Thu Apr 16, 2015 9:58 pm
by atnaples
what about index.php

$language = $factory->newLanguage($languages[$code]['directory']);

if you look at 1.5.6.4, there are order.php and order.php.original in /catalog/model/checkout, but since 2.0.1 they are gone

Re: [RELEASED] Override Engine for OpenCart

Posted: Fri Apr 17, 2015 12:19 am
by JNeuhoff
atnaples wrote:what about index.php

$language = $factory->newLanguage($languages[$code]['directory']);

if you look at 1.5.6.4, there are order.php and order.php.original in /catalog/model/checkout, but since 2.0.1 they are gone
That's because there already is this code in library/language.php, in method load:

Code: Select all

	public function load($filename) {
		if (!empty($this->factory)) {
			$_ = $this->factory->loadLanguage($filename);
			$this->data = array_merge( $this->data, $_ );
			return $this->data;
		}
		.....
And the index.php has this:

Code: Select all

// Language
$language = $factory->newLanguage($languages[$code]['directory']);
$language->load($languages[$code]['directory']);
$registry->set('language', $language);

Re: [RELEASED] Override Engine for OpenCart

Posted: Tue Apr 21, 2015 9:49 pm
by atnaples
Could you guys to keep your override engine and vqmod compatible with the previous version?

For ex: Danial decided that ocmod does not need to support wild card (*) or parenthesis "{}" you could do it for *.vqmod.xml?

Re: [RELEASED] Override Engine for OpenCart

Posted: Wed Apr 22, 2015 4:23 pm
by JNeuhoff
Both our Override Engine and VQmod for OpenCart 2.x are backward compatible within the OpenCart 2.x line of versions. They are designed to be fully integrated into OpenCart and to work together with each other as well as with OCmod. And VQmod (be it our integrated version or Qphoria's/Jay's external version) continue to support the same wildcards as in previous versions.

Re: [RELEASED] Override Engine for OpenCart

Posted: Sat May 02, 2015 4:21 pm
by faiz555kr
Hi ,

After install the extension, I received this error message, please help!

Notice: Cannot find language file '/home3/myb365/public_html/domain.com/shop/catalog/language/english/default.php' in /home3/myb365/public_html/domain.com/shop/system/engine/factory.php on line 574

Re: [RELEASED] Override Engine for OpenCart

Posted: Sat May 02, 2015 4:25 pm
by faiz555kr
Hi ,

After install the extension, I received this error message, please help!

Notice: Cannot find language file '/home3/myb365/public_html/domain.com/shop/catalog/language/english/default.php' in /home3/myb365/public_html/domain.com/shop/system/engine/factory.php on line 574

Re: [RELEASED] Override Engine for OpenCart

Posted: Wed May 27, 2015 11:51 pm
by JonathanBray0292
Hi, when I upload the index.php form the override file the front end of my website doesn't work. I wonder if you could take a look for me.

Re: [RELEASED] Override Engine for OpenCart

Posted: Thu May 28, 2015 1:44 am
by JNeuhoff
JonathanBray0292 wrote:Hi, when I upload the index.php form the override file the front end of my website doesn't work. I wonder if you could take a look for me.
Send me a PM with your FTP and OpenCart admin details, and I'll take a look at it. Quite often people forget to clear the system/modifcation cache in the admin backend (Extensions > Modifications > Clear) before installing the Override Engine which then causes this problem.

Re: [RELEASED] Override Engine for OpenCart

Posted: Mon Jul 13, 2015 3:58 am
by steveking198
Hi,

First of all, thanks for your extension. I'm a PHP Developer and find it much more logical than using vQmod.

I've come across a possible bug although it may be me using it wrong.

My custom admin template won't override the default one and I've narrowed it down to the Factory class loadView method.

The check is if the called class starts with Controller, but if the controller is an extended one (in the override folder) then it's never going to start with controller, it's going to start with my_addon.

Example, when I var_dump $backtrace[2] which is what's being checked in that method, the class is my_addon_ControllerSettingSetting

Am I missing something here or is this a bug?

Cheers

Re: [RELEASED] Override Engine for OpenCart

Posted: Wed Jul 15, 2015 12:09 am
by JNeuhoff
As explained in my PM, I also post it here for the benefit of other users of the Override Engine:

Basically, when you plan to extend the admin/controller/catalog/product.php class, you'd most likely also want to want the modify the admin/view/template/catalog/product_form.tpl and admin/language/english/catalog/product.php files, hence you'd have these files:

override/mystuff/admin/controller/catalog/product.php
override/mystuff/admin/language/english/catalog/product.php

The override/mystuff/admin/controller/catalog/product.php usually is the one which modifies both the controller and the template, it has to look something like this:

Code: Select all

    <?php
    class mystuff_ControllerCatalogProduct extends ControllerCatalogProduct {

       // overridden method
       public function preRender( $template_buffer, $template_name, &$data ) {
          if ($template_name != 'catalog/product_form.tpl') {
             return parent::preRender( $template_buffer, $template_name, $data );
          }

          // add additional or modified controller variables
          $this->load->language('catalog/product');
          $this->load->model('catalog/product');
          $data['xxxx'] = ....;

          // modify the the template, to use the additional or modified variables
          $this->load->helper( 'modifier' );
          $search = '.....';
          $add = <<<'EOT'
    ..... template modifications ....
    EOT;
          $template_buffer = Modifier::modifyStringBuffer( $template_buffer,$search,$add,'after',0 );

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

Re: [RELEASED] Override Engine for OpenCart

Posted: Wed Jul 15, 2015 12:41 am
by straightlight
What it means above is that the extension class needs to be initiated first in order for the core class to integrate these add-ons. Otherwise, pre-loading the other way around would mean that any previous line of this method 'x' would not be modifiable.

@JNeuhoff: It would be great knowing in details, as demonstrated above, how other controllers with $this->load->controller can be used with the modified helper class as well as linking model classes by affecting the original SQL strings from the models (replace) without having to create a new SQL query.

Re: [RELEASED] Override Engine for OpenCart

Posted: Sun Jul 26, 2015 6:58 pm
by NNToan
Hello,

I'm wondering how could I override something in system folder?

Is it okay if I add new folder in override addon folder, something like this /override/opencart_slim_framework/system/slim
And from my override controller, eg: /override/opencart_slim_framework/catalog/controller/product/product.php, could I extend or call api from "slim" folder?

Re: [RELEASED] Override Engine for OpenCart

Posted: Mon Jul 27, 2015 7:57 pm
by JNeuhoff
No, your slim folder needs to be in 'system/slim'. Then you should be able to extend existing OpenCart core classes in your override/opencart_slim_framework, e.g. your /override/opencart_slim_framework/catalog/controller/product/product.php would start like this:

Code: Select all

<?php
class opencart_slim_framework_ControllerProductProduct extends ControllerProductProduct {
.....
}
?>

OverrideEngine not compatiable with PHP 5.6

Posted: Mon Jul 27, 2015 9:32 pm
by NNToan
I found a bug with Override Engine for OpenCart 2.0.3.1

It show me an error if I'm using PHP 5.6.X, everything will be fine if I'm using PHP 5.5 or lower

Code: Select all

Fatal error: Class "Factory" not found in /something/path/index.php line 50
??? ??? ??? ???

Re: [RELEASED] Override Engine for OpenCart

Posted: Tue Jul 28, 2015 2:36 am
by JNeuhoff
If you send me a PM with your OpenCart and FTP login details then I can take a look at it, otherwise I am unable to reproduce this error.

Re: [RELEASED] Override Engine for OpenCart

Posted: Tue Jul 28, 2015 5:41 pm
by NNToan
JNeuhoff wrote:If you send me a PM with your OpenCart and FTP login details then I can take a look at it, otherwise I am unable to reproduce this error.
Thanks for your response. I sent you a PM with information, and please consider about my last question. I think you deserve to get more.

Re: [RELEASED] Override Engine for OpenCart

Posted: Wed Jul 29, 2015 7:41 pm
by NNToan
This module is uncompatiable with theme Journal 2.

I do some small test and found, because Journal 2 modify loader.php to add __get and __set
But OverrideEngine itself come with __get and __set, so I remove that from ocmod.xml

And well, Journal 2 unable to use!

Could you explain why?

Re: [RELEASED] Override Engine for OpenCart

Posted: Fri Aug 28, 2015 2:23 am
by diegolupi
Hello,

I have a theme for version 2.x
and it is not working if I use Override Engine for OpenCart.

I'll have two stores with the same management, but different themes.
One must use the Override Engine for OpenCart, and the other not.

The theme should not use it gives me error.

As I can fix this?

Re: [RELEASED] Override Engine for OpenCart

Posted: Thu Oct 08, 2015 6:51 pm
by JNeuhoff
The Override Engine is now available for OpenCart 2.1.0.1