Page 8 of 17

Re: [RELEASED] Override Engine for OpenCart

Posted: Sun Mar 09, 2014 12:54 am
by irrelevnt
JNeuhoff wrote:
irrelevnt wrote: Now the web interface now gives blank screen - view source reveals no code, (nothing was received)

There is nothing in system/logs
There is nothing in the web server error log.
The access log just has the GET with an ok (200) result.

Is there anything I can enable to get some sort of log or error out of it in order to locate the problem?
Have re-run the VQmod installer after installing the Override Engine?
Where's the VQmod installer, and do I need to use it? I've not run it at all - I'm starting from scratch, and as a total newbie to OC - I'm just trying to install the override engine in order to install the import tool on a fresh install of OC.. The moment I complete install the Override engine, I lose access to both front end and admin web pages, with no errors generated that I can find.

Re: [RELEASED] Override Engine for OpenCart

Posted: Sun Mar 09, 2014 1:30 am
by JNeuhoff
irrelevnt wrote: Where's the VQmod installer, and do I need to use it? I've not run it at all - I'm starting from scratch, and as a total newbie to OC - I'm just trying to install the override engine in order to install the import tool on a fresh install of OC.. The moment I complete install the Override engine, I lose access to both front end and admin web pages, with no errors generated that I can find.
Assuming you did a fresh install of OpenCart 1.5.6.1 and the Override Engine, I am honestly unable to reproduce your error, and it is strange that you have no entries whatsoever in any of your error logs.

Re: [RELEASED] Override Engine for OpenCart

Posted: Mon Mar 10, 2014 8:20 pm
by JNeuhoff
If you want to completely replace the rewrite method in your extension, no other 3rd party extension will be able to extend the same ControllerCommonSeoUrl class (see controller/common/seo_url.php). If that's OK for your purposes, I suggest something like this
(file override/myextension/catalog/controller/common/seo_url.php)

Code: Select all

final class myextension_ControllerCommonSeoUrl extends ControllerCommonSeoUrl {

	// overridden method 
	public function rewrite($link) {
		// .....
		// doesn't call parent hence it must contain complete replacement code
		// .....
		$link = .... whatever ....
		return $link;
	}

}

Re: [RELEASED] Override Engine for OpenCart

Posted: Sat Mar 15, 2014 3:10 am
by onivan
parkookk wrote:I have tried exactly as instructed and got blank page, then maybe its the vqmod so I renamed it and still get blank page.
I made a sub-domain and installed OC 1.5.4.1 (I need to keep my old extensions running fine) and all was fine then tried installing override engine 5.3 and got the same blank page. then restored everything back to normal and installed override engine 5.2 and got the blank page!!!!!!!!

Every thing was working fine till Sunday and I think its my host provider!! What do you think?

I Goggled and nothing!
I am really puzzled please helppppppppp! ???
I faced the same problem. I've got opencart 1.5.6 with "override engine" which worked very well. Yesterday I moved it to a different hosting where it instantly gave a blank page with ANY errors or output. I've installed a clean OC 1.5.6 -- it worked well, but after installing override engine -- a blank page. After 8+ hours of tracing all the function calls I've found the reason:
In /system/engine/controller.php at line 151 called:

Code: Select all

			require("var://".$template_id);
This function makes use of a custom protocol var:// registered in factory.php. But in newer servers they install the Suhosin which by default prohibits this behavior.

So, I've asked a support of the hosting to add this protocol var:// to whitelist as described here: http://stackoverflow.com/questions/6018 ... blank-page

Code: Select all

suhosin.executor.include.whitelist = var://
After this everything is working like a charm!

Hope it would save somebody's day or two!

Sorry for bad English.

Re: [RELEASED] Override Engine for OpenCart

Posted: Mon Mar 17, 2014 2:01 am
by JNeuhoff
onivan wrote: This function makes use of a custom protocol var:// registered in factory.php. But in newer servers they install the Suhosin which by default prohibits this behavior.

So, I've asked a support of the hosting to add this protocol var:// to whitelist as described here: http://stackoverflow.com/questions/6018 ... blank-page

Code: Select all

suhosin.executor.include.whitelist = var://
After this everything is working like a charm!

Hope it would save somebody's day or two!

Sorry for bad English.
The next version of the Override Engine won't use the VariableStream anymore, instead it will use cached files.

Re: [RELEASED] Override Engine for OpenCart

Posted: Wed Apr 02, 2014 3:48 pm
by mpeti
I've installed the Override Engine plugin on OpenCart 1.5.6
Sometime it throw an uncaugh exception with messege like "Class Currency does not exist".
Not always currency, but Loader, Tax.. etc. core class files missing for the engines factory class.
How can I solve this problem? Anybody have an idea?

Thanks in advance.

- mpeti -

Re: [RELEASED] Override Engine for OpenCart

Posted: Wed Apr 02, 2014 10:31 pm
by JNeuhoff
mpeti wrote:I've installed the Override Engine plugin on OpenCart 1.5.6
Sometime it throw an uncaugh exception with messege like "Class Currency does not exist".
Not always currency, but Loader, Tax.. etc. core class files missing for the engines factory class.
How can I solve this problem? Anybody have an idea?

Thanks in advance.

- mpeti -
Unless you can provide us with some more details on exactly how you got this error, I am unable to reproduce your error. It loads the Currency class from system/library/currency.php just fine.

Re: [RELEASED] Override Engine for OpenCart

Posted: Mon Apr 07, 2014 3:26 am
by IP_CAM
This is a reply to -@Anthony1632- to his comment on the OC MOD-Page:

Im am following this thread, because for some time, I have my toughts about heavy implementation of VQMOD's into a OpenCart. It may be a great Idea to have such an Option, because one can install additional options in easy and relatively foolproof way.

But going deeper into this VQMOD matter, and as I believe to understand how it works, I realize the relatively heavy Serverload required just to 'produce' one single Opencart Webpage. It required a Multi-Page Pre-Caching, until a ready-to-go Page is finanized, as more VQMOD's exist, as longer it takes, this, because of x-repeated times going trough thos MOD's, figuring out wich one possibly has any >information< to be changed to the page built.

No wonder, users write about slow loading time, waiting multiple Seconds until a single page finally shows up on a Screen. I imagine, that many OC-Users are similar to me, at first, they fill up their VQMOD Sub with all kinds of downloaded stuff, even fully unaware of the fact, that NOT all MODS are created to interact with Others. Then, they wonder about all kinds of problems occuring when visiting the Shop.

I AM NOT (yet) very familiar with PHP Coding, neither do I really understand how the VQMOD-Stuff is implemented into the OC-Core. But beeing related to (hobby-type) Perl-Coding since the mid 90'es, I still have my (http://www.everyauction.info) Site, I have a certain knowledge how a Server interacts with Online Software.

And despite of the fact, that today's Servers are MUCH more powerfull compared with what we had 10 Years ago, still, if someone plans to build a successfull high Performance Platform, one should IMPLEMENT, whatever is needed, into the Source. This should save a considerable amount of Server Resousses and loading Time.

From this point of View, I could fully agree to see some development like an Override Engine, because this could really speed up Opencart a a truly professional High Perfiormance System, even on cheap Shared Servers with xxx other Inhabitants, using the same I/O's.

I am NOT disqualifying the VQMOD Idea, it's a great way to test Modifications without harming the System. At least as long as VQMOD's DO NOT actively manipulate the System DB. But since I already experienced exactly this Problem, I now check every VQMO before uploading it to the Server, because JUST removing it after a Failure or Execution- Error is NO GUARANTEE that the System will work smooth again, if a MOD has added or modified parts of an existing DB. At least in my case, it did not.

Beeing SWISS and widely unaware of (soft-technical) english, I tried to make this content as understandable as possible.

best regards,

Ernie

Re: [RELEASED] Override Engine for OpenCart

Posted: Fri Apr 11, 2014 6:47 pm
by dfumagalli
@Above

- Override Engine has little to do with vQMod. It's actually another way to customize OpenCart.

- My biggest e-commerce site features Override Engine (several classes) and about 60 vQMods.
It scores 100% on Google Page Speed...

Re: [RELEASED] Override Engine for OpenCart

Posted: Sun Apr 20, 2014 1:12 am
by bill62
Hi

is the: opencart-1-5-6-1-override-engine-6-1

is OK with OpenCart Version 1.5.6.3

Re: [RELEASED] Override Engine for OpenCart

Posted: Sun Apr 20, 2014 4:37 am
by JNeuhoff
bill62 wrote:Hi

is the: opencart-1-5-6-1-override-engine-6-1

is OK with OpenCart Version 1.5.6.3
I haven't had a chance yet to test it for this new version, will do it during the next few days.

Update: I have run a quick filediff for 1.5.6.1. and 1.5.6.3 for the relevant files changed by the Override Engine, they are still the same, so the Override Engine for 1.5.6.1 should run just fine on 1.5.6.3!

Re: [RELEASED] Override Engine for OpenCart

Posted: Sun Apr 20, 2014 6:56 am
by Ampeter
Is there any way to debug .tpl files when using override engine?

Re: [RELEASED] Override Engine for OpenCart

Posted: Sun Apr 20, 2014 8:56 pm
by JNeuhoff
The next release will cache any modified class and template files in a system/cache/override folder, making it easier to debug. Debugging PHP files read in through a variable stream can be cumbersome (see e.g. http://stackoverflow.com/questions/2016 ... dy-defined), hence the planned caching feature for the next release.

Re: [RELEASED] Override Engine for OpenCart

Posted: Fri May 02, 2014 4:44 pm
by dfumagalli
I am experiencing an issue with date when sending order emails to customers.

I am posting it here because this OC has OE installed so it can't qualify for the official "1.5.6 bugs" thread and because the language and other PHP files are indeed modified by OE.


Basically what happens is this: in the order email we have the order date.

Expected value:

(other text, logo etc.)
...
Date Added: 02/05/2014

This is what I get using "clean" OC and also when I use my Unit Tests Linux shell command line test file.


Instead, the website sends this:

Date Added: 02am31UTC_f2014Fri, 02 May 2014 07:58:38 +000005am31_38072014Fri, 02 May 2014 07:58:38 +000031


that is a completely garbled mess.


I have investigated by adding some debug stuff in the relevant PHP file:
catalog/model/checkout/order.php

under

Code: Select all

$template->data['date_added'] = date($language->get('date_format_short'), strtotime($order_info['date_added']));
I have vQMod added:

Code: Select all

$template->data['debug01'] = $order_info['date_added'];
$template->data['debug02'] = strtotime($order_info['date_added']);
$template->data['debug03'] = $language->get('date_format_short');
$template->data['debug04'] = date($language->get('date_format_short'), strtotime($order_info['date_added']));

At the bottom of the corresponding template file:
catalog/view/theme/default/template/mail/order.tpl

I have added these simple lines:

Code: Select all

  <p style="margin-top: 0px; margin-bottom: 20px;"><?php echo 'Debug01: ' . $debug01; ?></p>
  <p style="margin-top: 0px; margin-bottom: 20px;"><?php echo 'Debug02: ' . $debug02; ?></p>
  <p style="margin-top: 0px; margin-bottom: 20px;"><?php echo 'Debug03: ' . $debug03; ?></p>
  <p style="margin-top: 0px; margin-bottom: 20px;"><?php echo 'Debug04: ' . $debug04; ?></p>

Output:

Code: Select all

Debug01: 2014-05-02 07:58:38
Debug02: 1399017518
Debug03: date_format_short
Debug04: 02am31UTC_f2014Fri, 02 May 2014 07:58:38 +000005am31_38072014Fri, 02 May 2014 07:58:38 +000031
It's evident that the culprit is Debug03, that is the language does not load the 'd/m/Y' alike format mask so it just returns the verbatim 'date_format_short' string, which in turn is used by date() and the latter interprets it as mask with the resulting garbled results.


Now, this happens with English (too), so no, it's not due to a missing translation entry. I have actually looked at the language PHP files and the entry is there indeed:

Code: Select all

// Locale
$_['code']                  = 'en';
$_['direction']             = 'ltr';
$_['date_format_short']     = 'd/m/Y';
too bad for some reason that stuff does not get loaded.

In Order.php line 271:

Code: Select all

// Send out order confirmation mail
$language = $this->factory->newLanguage($order_info['language_directory']);
$language->load($order_info['language_filename']);
$language->load('mail/order');
it should indeed load the base translation file (second line in the snippet) but it does not happen.

Reading the code more in detail it looks like $order_info comes from getOrder($order_id).

That function has an "else" statement:

Code: Select all

$this->load->model('localisation/language');
			
			$language_info = $this->model_localisation_language->getLanguage($order_query->row['language_id']);
			
			if ($language_info) {
				$language_code = $language_info['code'];
				$language_filename = $language_info['filename'];
				$language_directory = $language_info['directory'];
			} else {
				$language_code = '';
				$language_filename = '';
				$language_directory = '';
			}
For some reason it could pick the "else" branch and return an empty set of values.

Now, to get why this happens, it's a mystery. Expecially since it happens for English as well.

Re: [RELEASED] Override Engine for OpenCart

Posted: Fri May 02, 2014 6:47 pm
by JNeuhoff
dfumagalli: This could be an issue with the language fallback built into the Override Engine. If you send me a PM with your FTP and OpenCart login details I can take a look at it.

Re: [RELEASED] Override Engine for OpenCart

Posted: Sat May 03, 2014 4:49 am
by dfumagalli
JNeuhoff wrote:dfumagalli: This could be an issue with the language fallback built into the Override Engine. If you send me a PM with your FTP and OpenCart login details I can take a look at it.
Thank you very much!

I am going to send you FTP credentials ASAP.

In the mean time, this is a very detailed sequence of a debug session I have done earlier.


/catalog/model/checkout/order.php function confirm()
where the language "bits" are gathered. In the example I have italian but english leads to the same results.

Image


same function before the email is sent. If you click and zoom the image you can see the values being correctly assigned.

Image


Here's what the language localization query returns:

Image


Here's OE modded language.php in action: function argument

Image


Various steps inside

Image


Notice how the returned array is empty? This happens for English. It's odd, because both the website and the sent emails are correctly translated.

Image


Another function you probably know very well:

Image


Here's OE's modcheck():

Image


Here's vQMod own override function returning a fat nothing from require_once()!

Image

Image

Re: [RELEASED] Override Engine for OpenCart

Posted: Mon May 05, 2014 12:31 am
by JNeuhoff
dfumagalli: In file system/factory.php, in method loadLanguage, I replaced the require_once statements with require statements, it is working now fine, just tested it.

I'll create an updated release of the Override Engine with this bugfix.

Thank you for reporting this bug.

Re: [RELEASED] Override Engine for OpenCart

Posted: Wed Jun 25, 2014 12:51 am
by openmandrake
Hi,

great work! is the override engine somewhere available from a git repository?

best,

Re: [RELEASED] Override Engine for OpenCart

Posted: Wed Jun 25, 2014 3:36 am
by JNeuhoff
openmandrake wrote:Hi,

great work! is the override engine somewhere available from a git repository?

best,
No, it's not on a git repository. I find git too user unfriendly, and it tends to be in my way when developing software. However, I am planning on uploading an OpenCart 2.0 fork, with the Override Engine and VQMod included, to my git repository as soon as OpenCart 2.0 is released.

The Override Engine is already done for OpenCart 2.0, just waiting for Daniel to release OpenCart 2.0.

Re: [RELEASED] Override Engine for OpenCart

Posted: Thu Jul 03, 2014 5:36 pm
by dfumagalli
Hello,

I have an issue that might be related to me using OE but I am not sure so I ask you if you have any past experience about it.

Basically, on a 1.5.6 OC with SEO URLs enabled, OC won't show "pretty" error 404 pages but always shows:

Code: Select all

Notice: Cannot find controller class file for route '99-red-roses-teddy-bear' in /var/www/domain.tld/public_html/system/engine/factory.php on line 152
In order to show this error "on command", I just willingly added a "99" before a legit SEO URL.

Since I know OE mods factory.php, then it's why I am asking you if you got any idea.

Thanks in advance