Post by JNeuhoff » Fri Jun 14, 2013 7:08 pm

boon wrote:After ovverride installation . My front page got blank, Admin Page was working fine.

WHAT I DID :

I replaced front page index.php with old one. only this change.

Its working fine now.. I can see my website .

MY QUESTION:

I DID correct thing?
No, it's not correct, replacing the index.php with the old one won't do it.

You should have some error messages in your Opencart's system/logs/error.txt, or in your server's error_log (ask your web host for it, if you don't have access to it).

Also, are you using any other extensions?

MHC Web Design
Override Engine * Integrated VQMod * Unused Images Manager * Instant Option Price Calculator * TrustPilot Reviews * Google Rich Snippets * Google Tag Manager * Export/Import Tool * Template Switcher PHP/Twig


User avatar
Expert Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by JNeuhoff » Tue Jun 25, 2013 10:47 pm

Just a quick reminder for anyone who wants support to be more specific in problem descriptions.

E.g. if someone comes with something as vague like this:
i just installed opencart over ride
this is what happend to my site

it wont open
or
I get a blank page
I'll will just ignore them from now.

The least we'd expect is log entries from Opencart's system/logs/error.txt and the server's error_log, as well as details of the Opencart version used, and any other extensions installed for Opencart. Without this, we won't help!

MHC Web Design
Override Engine * Integrated VQMod * Unused Images Manager * Instant Option Price Calculator * TrustPilot Reviews * Google Rich Snippets * Google Tag Manager * Export/Import Tool * Template Switcher PHP/Twig


User avatar
Expert Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by zkvvoob » Thu Jun 27, 2013 3:14 pm

Hi guys,

Could someone please help me: after installing Override Engine, the admin interface is OK, but when I try to access to shop front I get this message:

Notice: Cannot find language file '/var/www/clients/client1/web3/web/shop/catalog/language/english/bulgarian.php' in /var/www/clients/client1/web3/web/shop/system/engine/factory.php on line 455

As you can see, it's quite strange to want to find a Bulgarian language in the English directory. I don't know what has caused this. Open Card had been running without any problems before the installation of Override Engine.

Thanks in advance!

P.S. Disabling Bulgarian from Settings got me back the access to the store. However, I'd really like to be able to display the shop in my language. Any ideas? Please?

Newbie

Posts

Joined
Fri May 24, 2013 5:34 pm

Post by JNeuhoff » Thu Jun 27, 2013 5:08 pm

zkvvoob wrote:Hi guys,

Could someone please help me: after installing Override Engine, the admin interface is OK, but when I try to access to shop front I get this message:

Notice: Cannot find language file '/var/www/clients/client1/web3/web/shop/catalog/language/english/bulgarian.php' in /var/www/clients/client1/web3/web/shop/system/engine/factory.php on line 455

As you can see, it's quite strange to want to find a Bulgarian language in the English directory. I don't know what has caused this. Open Card had been running without any problems before the installation of Override Engine.

Thanks in advance!

P.S. Disabling Bulgarian from Settings got me back the access to the store. However, I'd really like to be able to display the shop in my language. Any ideas? Please?
In file system/engine/factory.php, replace line 448 as shown below, and let me know wether that fixes your problem:

old:

Code: Select all

$filepath = $default . '/' . $path . '.php';
new:

Code: Select all

$filepath = (strpos( $path, '/', 0 )===FALSE) ? $default . '/english.php' : $default . '/' . $path . '.php';

MHC Web Design
Override Engine * Integrated VQMod * Unused Images Manager * Instant Option Price Calculator * TrustPilot Reviews * Google Rich Snippets * Google Tag Manager * Export/Import Tool * Template Switcher PHP/Twig


User avatar
Expert Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by henkvalk » Tue Jul 09, 2013 9:27 pm

JNeuhoff wrote:
zkvvoob wrote:Hi guys,

Could someone please help me: after installing Override Engine, the admin interface is OK, but when I try to access to shop front I get this message:

Notice: Cannot find language file '/var/www/clients/client1/web3/web/shop/catalog/language/english/bulgarian.php' in /var/www/clients/client1/web3/web/shop/system/engine/factory.php on line 455

As you can see, it's quite strange to want to find a Bulgarian language in the English directory. I don't know what has caused this. Open Card had been running without any problems before the installation of Override Engine.

Thanks in advance!

P.S. Disabling Bulgarian from Settings got me back the access to the store. However, I'd really like to be able to display the shop in my language. Any ideas? Please?
In file system/engine/factory.php, replace line 448 as shown below, and let me know wether that fixes your problem:

old:

Code: Select all

$filepath = $default . '/' . $path . '.php';
new:

Code: Select all

$filepath = (strpos( $path, '/', 0 )===FALSE) ? $default . '/english.php' : $default . '/' . $path . '.php';
I had the same error. I replaced the old code for:
new:

Code: Select all

$filepath = $directory. '/' . $path . '.php';

Newbie

Posts

Joined
Tue Jul 09, 2013 7:03 pm

Post by JNeuhoff » Tue Jul 09, 2013 11:56 pm

henkvalk wrote: I had the same error. I replaced the old code for:
new:

Code: Select all

$filepath = $directory. '/' . $path . '.php';
While your solution might work, it's not the right one. The idea was to first load load the English language files, then e.g. Bulgarian, to make sure that the English language can be used as a fallback in case of some missing non-English (e.g. Bulgarian file).

Have you tested my suggested fix for line 448, as show below?

Code: Select all

$filepath = (strpos( $path, '/', 0 )===FALSE) ? $default . '/english.php' : $default . '/' . $path . '.php';

MHC Web Design
Override Engine * Integrated VQMod * Unused Images Manager * Instant Option Price Calculator * TrustPilot Reviews * Google Rich Snippets * Google Tag Manager * Export/Import Tool * Template Switcher PHP/Twig


User avatar
Expert Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by Daldot » Thu Jul 18, 2013 5:57 pm

How do I uninstall??

The entire website is now messed up!

Newbie

Posts

Joined
Wed Jun 26, 2013 5:27 pm

Post by Qphoria » Thu Jul 18, 2013 10:40 pm

Probably best to just ask how to properly install or fix your install. Upon new install there should be visual changes if there are no override mods in place.

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by JNeuhoff » Fri Jul 19, 2013 4:57 pm

Daldot wrote:How do I uninstall??

The entire website is now messed up!
There are a number of backup files renamed to *.php.original which need to be restored, e.g.

admin/index.php
catalog/model/checkout/order.php
catalog/model/checkout/voucher.php
index.php
system/engine/action.php
system/engine/controller.php
system/engine/front.php
system/engine/loader.php
system/library/language.php
system/startup.php

Having said that, perhaps we could help you fix your installation problem if you give us more details, e.g. error log entries?

MHC Web Design
Override Engine * Integrated VQMod * Unused Images Manager * Instant Option Price Calculator * TrustPilot Reviews * Google Rich Snippets * Google Tag Manager * Export/Import Tool * Template Switcher PHP/Twig


User avatar
Expert Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by JNeuhoff » Mon Jul 29, 2013 1:38 am

The Override Engine is now available for OpenCart 1.5.6.

The Opencart extensions site itself is broken at the moment, we were unable to upload the updated zip file to there. Please use our own download site.

Update: Now available from the OpenCart extensions site.

MHC Web Design
Override Engine * Integrated VQMod * Unused Images Manager * Instant Option Price Calculator * TrustPilot Reviews * Google Rich Snippets * Google Tag Manager * Export/Import Tool * Template Switcher PHP/Twig


User avatar
Expert Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by JNeuhoff » Sun Aug 25, 2013 3:55 am

We have now released version 6.0 of the Override Engine.

This version fixes a bug in order to suppport vqmod version 2.4.0 or later.

MHC Web Design
Override Engine * Integrated VQMod * Unused Images Manager * Instant Option Price Calculator * TrustPilot Reviews * Google Rich Snippets * Google Tag Manager * Export/Import Tool * Template Switcher PHP/Twig


User avatar
Expert Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by dfumagalli » Tue Aug 27, 2013 12:36 am

Hello,

first of all I'd like to warmly thank Qphoria, AvanOsch and JNeuhoff.

Qphoria for creating vQMod or "the practical approach to modding a non-mod friendly architecture".
AvanOsch for creating vQModerator or "how to make vQModding visual and easy as cheese".
JNeuhoff for creating a "proper object oriented extension mechanism".

I am using vQMod (through vQModerator) with great success.
Now I'd like to start using JNeuhoff's framework and I have a couple of questions:

1) How often is it updated after a new version of Open Cart? Because I'd hate to stay stuck with an old Open Cart version because the framework is not compatible.
I am expecially worried by the installation overwriting core files. I'd rather have used a vQModded set of Override Engine install files so that in case of a "0.01" Open Cart patch, I am less prone getting everything broken up.

2) Are there some simple examples of how to implement extensions? I don't mean something as complete as DIY Module Builder but at least something with a demo or something.

3) Is this Override Engine powerful enough to let me implement some deep Model customizations? In particular I have to create an extension that in one international, worldwide store it lets me support Geozone based prices for each product. We aim at having 180 or so geozones each with its own different price listing (in dollars, users of course may click other currencies).

Thanks in advance and keep with the good work guys!

Heavy OpenCart Customizations. Current project in progress: fleurworld.com


Active Member

Posts

Joined
Tue Aug 20, 2013 3:34 am

Post by JNeuhoff » Tue Aug 27, 2013 5:34 am

dfumagalli:

To answer your questions:

1) It is updated with every new OpenCart release, we have been doing it since 1.5.4.x when the Override Eingine was released.

2) There are a some examples, like these:
Banner Images Sort Order
Banner Options
Slide Show Options

3) You should be able to do some extensive model customization without problems, we have done it for many live web sites.

MHC Web Design
Override Engine * Integrated VQMod * Unused Images Manager * Instant Option Price Calculator * TrustPilot Reviews * Google Rich Snippets * Google Tag Manager * Export/Import Tool * Template Switcher PHP/Twig


User avatar
Expert Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by dfumagalli » Tue Aug 27, 2013 7:41 pm

Thank you for your prompt reply.

I noticed that (sadly) it has not gained a lot of traction on the modders base.

I think I can understand why: they have to update its core like vQMods programmers have to do at each Open Cart update. But the real gotcha imo is another: while vQMod = dirty, quick work that easily breaks at a new Open Cart release, Override Engine certainly involves more knowledge and effort than "slapping a search & replace together".

This additional effort is not counter-balanced by the benefit I hoped to see: ability for an Override Engine mod to work across multiple Open Cart release, ideally work across a whole minor.

So, if we have to continuously release new OE mods like vQModders have to yet we have also to pur in more effort... what's the deal? I can easily keep coding for OE because I like software being extended in a "proper way" (I am traditionalist, I am programmer since early 90s) but those who are just in for the specific task or for the money are not going to stick.

Heavy OpenCart Customizations. Current project in progress: fleurworld.com


Active Member

Posts

Joined
Tue Aug 20, 2013 3:34 am

Post by dfumagalli » Wed Aug 28, 2013 12:42 am

Some questions about Override Engine (OE).

Hello, I am reading the FAQs and they stimulated my curiosity about a number of points.

1) FAQ Q2 really looks like proper Object Oriented Programming \o/.
However later on, at Q6, you begin talking about "Prerender" which to me it looks like a "catch all" method. Something that gets a whole buffer of stuff and the mod programmer has to sift through and extract his desired bits of data.
Couldn't this be improved? I mean, the ability to extend the core classes is great, don't mistake me. But the granularity is so small, there's a big chance that the next minor Open Cart update will change such "blob" of pre-rendered data, making the OE mod prone to break exactly like a vQMod one.
This is also a design factor I talked about in my previous post. I don't know the challenges involved into making OE but I know that if it has the same Achille's heel of vQMod, it won't gain the popularity it deserves.
In fact vQMod is established and relatively effort free to work with, so a "competitor" should bring in easily spotted strong points.

2) What do we inherit from, in order to implement a language override? I.e. imagine my widget gets a "Second name" string to translate to French. Could you please provide a tiny snippet of code?

3) What if I want to override a non default, custom template? I got a commercial one, including the right to updates. I'd like to "non destructively" inherit and use its functions so that when a new version comes out I don't have to re-customize all from scratch.

4) I don't get Q4. If I understand correctly, your frameworks automatically "chains" inherited methods from multiple classes.
I can see some issues with this and I'd love to know how to deal with them.
I want to create multiple extensions, which may eventually snap in and "cooperate". I.e. one would do its task by adding and managing a field. Another would further extend it and manage a second field related to the first.

- What's the order of chaining? I can't use the second field inheritance if I don't have the first field covered right? So how do I make sure I load the classes in order?

- What if I wanted to create truly independent classes (that is, not use the automatic chain)? If they are automatically chained, they extend each the previous one, while I might want each to "live in a sandbox".
This becomes expecially important in case I have to extend "Prerender", depending on the classes orders and mix or even just depending on the fact 1 year from now I remove an unused class, everything could break because each class could have participated and added its bits into the Prerender data.
Removing a class would alter the Prerender data and break its known patterns for my search and replace in another class.

Heavy OpenCart Customizations. Current project in progress: fleurworld.com


Active Member

Posts

Joined
Tue Aug 20, 2013 3:34 am

Post by JNeuhoff » Wed Aug 28, 2013 3:20 am

To quickly answer your questions:

1) Use an overridden preRender method for changing the template only. Use an overriden render method for adding or changing controller variables to be used in the modified template. And yes, there is no guarantee that modified templates will work in future Opencart releases, especially not for poorly designed templates which don't stick to Opencart conventions.

2) Language files are not classes, so you don't inherit from a parent class. But you can still override individual language text strings with your own modified text strings.

3) Use something like shown in the following example (assuming the 3rd party template is well behaved and needs to change common/header.tpl):

Code: Select all

<?php   
class google_analytics_tracking_ControllerCommonHeader extends ControllerCommonHeader {

	// overridden method
	protected function render() {
		$this->children[] = 'common/google_analytics_tracking';
		return parent::render();
	}


	// overridden method
	protected function preRender( $templateBuffer ) {
		// we are only interested in the common/header.tpl, can be from any well behaved web theme
		if (!$this->endsWith( $this->template, '/template/common/header.tpl' )) {
			return parent::preRender( $templateBuffer );
		}

		// replace  old Google Analytics with ours, it has more features
		$this->load->helper( 'modifier' );
		$search = '<?php echo $google_analytics; ?>';
		$add =  '<?php echo $google_analytics_tracking; ?>';
		$templateBuffer = Modifier::modifyStringBuffer( $templateBuffer,$search,$add,'replace' );
		return parent::preRender($templateBuffer);
	}


	private function endsWith( $haystack, $needle ) {
		if (strlen( $haystack ) < strlen( $needle )) {
			return FALSE;
		}
		return (substr( $haystack, strlen($haystack)-strlen($needle), strlen($needle) ) == $needle);
	}
}
?>
4) 3rd party addons or extensions are usually not aware of each other and should only extend Opencart core classes, as needed. They should never extend a class from another extension, nor rely on the order when the Override Engine dynamically creates the chain of class extensions (the latter only happens on the rare scenario where different 3rd party addons happen to extend the same Opencart core class).

MHC Web Design
Override Engine * Integrated VQMod * Unused Images Manager * Instant Option Price Calculator * TrustPilot Reviews * Google Rich Snippets * Google Tag Manager * Export/Import Tool * Template Switcher PHP/Twig


User avatar
Expert Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by dfumagalli » Wed Aug 28, 2013 4:03 pm

Thank you so much for taking all that time to write a detailed reply!

I am going to study the whole system in bigger depth. In the meanwhile it'd be so lovely if there were more of those "practical snippets" available. Have you ever thought to add a little "snippets galllery" to your website or somewhere else?

Heavy OpenCart Customizations. Current project in progress: fleurworld.com


Active Member

Posts

Joined
Tue Aug 20, 2013 3:34 am

Post by JNeuhoff » Wed Aug 28, 2013 5:02 pm

dfumagalli wrote:Thank you so much for taking all that time to write a detailed reply!

I am going to study the whole system in bigger depth. In the meanwhile it'd be so lovely if there were more of those "practical snippets" available. Have you ever thought to add a little "snippets galllery" to your website or somewhere else?
I'll have to upgrade my own website soon, so yes, adding a separate category for the Override Engine will be a good idea. We have loads of software items using the Override Engine, some of them are also in the Opencart extensions site, but many haven't yet been published because I have been very busy lately.

MHC Web Design
Override Engine * Integrated VQMod * Unused Images Manager * Instant Option Price Calculator * TrustPilot Reviews * Google Rich Snippets * Google Tag Manager * Export/Import Tool * Template Switcher PHP/Twig


User avatar
Expert Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by dfumagalli » Wed Aug 28, 2013 6:41 pm

Possible typo / bug:


OE's provided /index.php

// Version
define('VERSION', '1.5.5.1');


OE's provided /index.php.original

// Version
define('VERSION', '1.5.6');


Official 1.5.6 zip's /index.php

// Version
define('VERSION', '1.5.6');

Heavy OpenCart Customizations. Current project in progress: fleurworld.com


Active Member

Posts

Joined
Tue Aug 20, 2013 3:34 am

Post by JNeuhoff » Wed Aug 28, 2013 8:14 pm

dfumagalli wrote:Possible typo / bug:
Well spotted, I have now fixed the index.php files and released version 6.1 of the Override Engine. Please re-install.

MHC Web Design
Override Engine * Integrated VQMod * Unused Images Manager * Instant Option Price Calculator * TrustPilot Reviews * Google Rich Snippets * Google Tag Manager * Export/Import Tool * Template Switcher PHP/Twig


User avatar
Expert Member

Posts

Joined
Wed Dec 05, 2007 3:38 am

Who is online

Users browsing this forum: No registered users and 9 guests