Page 7 of 17
Re: [RELEASED] Override Engine for OpenCart
Posted: Thu Dec 12, 2013 11:33 pm
by JNeuhoff
Qphoria wrote:straightlight wrote:is it going to be by author from the system/cache folder ?
lol I think we can let this idea die.. it isn't planned to happen in any of the modification/override systems.
All I am planning to do is to replace instances of
VariableStream, which contain chain-extended classes, with cached class files in
system/cache.
Re: [RELEASED] Override Engine for OpenCart
Posted: Fri Jan 10, 2014 6:35 am
by JNeuhoff
The Override Engine is now available for OpenCart 1.5.6.1.
Re: [RELEASED] Override Engine for OpenCart
Posted: Tue Jan 28, 2014 5:12 pm
by goodspeed
I have a question about override engine.
When I copy product.php to override engine relative dir, the system will show more error message.
like this :
- Notice: Undefined variable: shippable in var://catalog_view_theme_default_template_product_product_tpl on line 312
Notice: Undefined variable: ms_digital_product in var://catalog_view_theme_default_template_product_product_tpl on line 315
Notice: Undefined variable: shippable in var://catalog_view_theme_default_template_product_product_tpl on line 318
Notice: Undefined variable: shippable in var://catalog_view_theme_default_template_product_product_tpl on line 325
Notice: Undefined variable: ms_digital_product in var://catalog_view_theme_default_template_product_product_tpl on line 328
Notice: Undefined variable: shippable in var://catalog_view_theme_default_template_product_product_tpl on line 331
The problem is vqmod can't change override engine files.
So the template file cannot get the variables from vqmod files.
Have any idea ?
Opencart 1.5.6.1
Multimerch 4.3
Override Engine 1.5.6.1
Vqmod 2.4.1
Sorry for my english.
Thank for your support.
Re: [RELEASED] Override Engine for OpenCart
Posted: Wed Jan 29, 2014 5:43 pm
by JNeuhoff
First of all, both the Override Engine and VQmod can co-exist on the same Opencart server.
If you also use a VQmod XML script to modify
product.php, it should normally target the original
catalog/controller/product.php via VQmod, resulting in the cached file:
vqmod/vqcache/vq2-catalog_controller_product_product.php
If you then want to further modify the
product.php using the Override Engine, your should create a file in:
override/myaddon/catalog/controller/product/product.php
which looks like this:
Code: Select all
class myaddon_ControllerProductProduct extends ControllerProductProduct {
.....
// overridden methods in here
.....
}
When this controller class gets loaded, the Override Engine will detect the extended class and load that one. When loading the parent class, it will use the file from the VQmod cache.
Re: [RELEASED] Override Engine for OpenCart
Posted: Fri Feb 14, 2014 9:12 pm
by adglobal
Override Engine Not working for me i am using Open cart v-1.5.6.1 please help me on this. I have VQmod also installed and i have placed all the files in proper location still not working please help me on this.
Thanks in Advance.
Re: [RELEASED] Override Engine for OpenCart
Posted: Tue Feb 18, 2014 12:25 am
by JNeuhoff
adglobal wrote:Override Engine Not working for me i am using Open cart v-1.5.6.1 please help me on this. I have VQmod also installed and i have placed all the files in proper location still not working please help me on this.
Thanks in Advance.
Your problem description is too vague. Please provide some more details, especially what error messages you get in your server's error_log (ask webhost for them), and in your
system/logs/error.txt.
Re: [RELEASED] Override Engine for OpenCart
Posted: Wed Feb 19, 2014 12:38 am
by JNeuhoff
Keep working dude
We are working day and night
We already have a new Override Engine 7.0 beta for the upcoming OpenCart 2.0!
Re: [RELEASED] Override Engine for OpenCart
Posted: Wed Feb 19, 2014 7:30 pm
by nfs
JNeuhoff wrote:nsnaveen wrote:I installed the opencart-1-5-4-x-override-engine-5-1 as said. but after installing whn i open admin iam getting this error
Notice: Cannot find controller class file for route 'common/maintenance' in /home/isdccom/public_html/naudidhi2/system/engine/factory.php on line 155
can any one help me please.
thanks in advance
nsnaveen
Please check your
system/logs/error.txt for any further clues as to why it might not work. Also check your server's error_log.
Also make sure the file
/home/isdccom/public_html/naudidhi2/catalog/controller/common/maintenance.php actually exists. Also, have you extended this class and overridden some of its methods for an addon?
My problem
Notice: Cannot find controller class file for route '' in /home/user1901/public_html/system/engine/factory.php on line 152
1. Server error log and opencart error log display the same error message
2. maintenance.php is original (No modification, no themes no nothing)
3. Error on factory file; line 152
$i = strrpos( $route, '/' );
if ($i===FALSE) {
trigger_error("Cannot find controller class file for route '$route'");
exit;
}
Re: [RELEASED] Override Engine for OpenCart
Posted: Wed Feb 19, 2014 7:34 pm
by dfumagalli
For those who have followed me and my effort at bringing Unit Testing to Open Cart, I have good news!
I finally have found a way to Unit Test classes that have been modded by using Override Engine!
It's dirty but it works.
1) In addition to including the Unit Test php file you'll have to require_once the files you are to test.
I.e.
Code: Select all
<?php
require_once ('OpenCartTest.php');
require_once(OC_ROOT . 'system/engine/model.php');
require_once(OC_ROOT . 'catalog/model/catalog/product.php');
require_once (OVERRIDE_ENGINE_FWMODS_ROOT . 'catalog/model/catalog/product.php');
Where OVERRIDE_ENGINE_FWMODS_ROOT is a constant of mine pointing to my overridden mods.
2) In the test where such class is needed, just use this code:
Code: Select all
public function testUpdateViewed() {
// $model = $this->loadModelByRoute('catalog/product');
$factory = new Factory($this->registry);
$this->registry->set('factory', $factory );
$model = $factory->newModel('catalog/product');
// Tests are valid for GB
$geo_zone_id = GetDeliveryGeoZone($this->registry);
$product_id = TEST_PRODUCT_ID; // = Apple Cinema product
// Load original viewed counter
$original_viewed = $this->getViewed($geo_zone_id, $product_id);
echo $original_viewed;
// Adds 1 using the model
$model->updateViewed($product_id);
// Checks if the viewed counter really incremented by 1
$updated_viewed = $this->getViewed($geo_zone_id, $product_id);
$this->assertEquals($updated_viewed, $original_viewed + 1);
}
Where:
// $model = $this->loadModelByRoute('catalog/product');
is the line you'd use if your test case did not involve an Override Engine affected class.
The rest is just dumb test code that makes sure the Product's updateViewed() function now works based by product id + geozone id (a Customer requirement).
This is getViewed() code for those who wonder. However it's completely irrelevant to this topic so you'll never use it. It's just to show the test flow.
Code: Select all
protected function getViewed($geo_zone_id, $product_id) {
$query = $this->db->query("SELECT * FROM fw_local_product WHERE geo_zone_id = $geo_zone_id AND product_id = $product_id");
$this->assertNotCount(0, $query->rows);
$this->assertCount(1, $query->rows);
return $query->row['viewed'];
}
Re: [RELEASED] Override Engine for OpenCart
Posted: Wed Feb 19, 2014 8:05 pm
by JNeuhoff
nfs wrote:
My problem
Notice: Cannot find controller class file for route '' in /home/user1901/public_html/system/engine/factory.php on line 152
1. Server error log and opencart error log display the same error message
2. maintenance.php is original (No modification, no themes no nothing)
3. Error on factory file; line 152
$i = strrpos( $route, '/' );
if ($i===FALSE) {
trigger_error("Cannot find controller class file for route '$route'");
exit;
}
Unless you guys come up with a more specific problem description, exactly what what did to lead up to this error, I can't help you. I am simply unable to reproduce your error without further details.
Re: [RELEASED] Override Engine for OpenCart
Posted: Wed Feb 19, 2014 8:09 pm
by nfs
I have had this problem since day one after my first installation.
I have tried to reinstall will try again.
Re: [RELEASED] Override Engine for OpenCart
Posted: Wed Feb 26, 2014 6:44 am
by rubendejong
I am a new user to OpenCart (but not PHP) and would like to start using Override Engine.
On a local dev environment, all works great.
When I upload all the files to my 1.5.6.1 OpenCart, all I get is a blank page. No errors, also not in /system/log, not in apache log.
I have tried to debug a bit and came to the conclusion that when I put a var_dump($file); to the readTemplate function in factory.php, the only template that gets read is '/catalog/view/theme/default/template/common/column_left.tpl'.
As opposed to my local site, where a lot of templates get read which is obviously to be expected.
Why does it not load all the templates on the remote site?
Re: [RELEASED] Override Engine for OpenCart
Posted: Wed Feb 26, 2014 4:29 pm
by rubendejong
I should also have mentioned that I had to change the function newInstance in /system/engine/factory.php,
for the lines like $i = strrpos( $file, '/controller/' ); to $i = strrpos( $file, '/controller/' ); (without the forward slash). Because I'm on a shared server, I had to set the directories in config.php like this: define('DIR_SYSTEM', 'system/');, so the checks in factory.php failed. It probably has something to do with this but I can't get my finger behind it.
Any help appreciated!
Re: [RELEASED] Override Engine for OpenCart
Posted: Wed Feb 26, 2014 8:27 pm
by irrelevnt
I am investigating opencart as an alternative to Prestashop. The csv import module says I need this one first, which is fine as overrides are the method I am used to in order to add modifications. However, like some other people, I am having issues in that as soon as I install this, nothing works. e.g. from a totally clean system -
Code: Select all
root@fi1:/var/www/vhosts/irrelevant.com/httpdocs/oc# unzip /root/opencart-1.5.6.1.zip
[...]
inflating: opencart-1.5.6.1/upload/system/library/weight.php
creating: opencart-1.5.6.1/upload/system/logs/
extracting: opencart-1.5.6.1/upload/system/logs/index.html
inflating: opencart-1.5.6.1/upload/system/startup.php
root@fi1:/var/www/vhosts/irrelevant.com/httpdocs/oc# mv opencart-1.5.6.1/upload/* .
Croot@fi1:/var/www/vhosts/irrelevant.com/httpdocs/oc# chmod -R g+w *
root@fi1:/var/www/vhosts/irrelevant.com/httpdocs/oc# chgrp -R www-data *
root@fi1:/var/www/vhosts/irrelevant.com/httpdocs/oc# mv admin/config-dist.php admin/config.php
root@fi1:/var/www/vhosts/irrelevant.com/httpdocs/oc# mv config-dist.php config.php
[configure via web interface]
root@fi1:/var/www/vhosts/irrelevant.com/httpdocs/oc# mv install xxxinstall
[shop working fine with demo data]
root@fi1:/var/www/vhosts/irrelevant.com/httpdocs/oc# unzip /root/opencart-1-5-6-1-override-engine-6-1.zip read*
Archive: /root/opencart-1-5-6-1-override-engine-6-1.zip
inflating: readme.txt
root@fi1:/var/www/vhosts/irrelevant.com/httpdocs/oc# unzip /root/opencart-1-5-6-1-override-engine-6-1.zip upload/*
[..]
inflating: upload/system/startup.php.original
creating: upload/vqmod/
inflating: upload/vqmod/vqprotect.txt
root@fi1:/var/www/vhosts/irrelevant.com/httpdocs/oc# chmod -R g+w upload/*
root@fi1:/var/www/vhosts/irrelevant.com/httpdocs/oc# chgrp -R www-data upload/*
root@fi1:/var/www/vhosts/irrelevant.com/httpdocs/oc# cp -f -R upload/* .
[..]
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?
Re: [RELEASED] Override Engine for OpenCart
Posted: Fri Feb 28, 2014 8:09 pm
by dfumagalli
Hello,
I have a little question.
After using OE for some months I have to say that it's quite of an excellent addition to OpenCart and along with vQMod allows for very deep, low side effects customization in a lot of places.
It's also quite elegant in usage and tends to be "neutral" with respect of the objects using it.
But it has a sore spot: it declares a var stream wrapper and keeps it "locked" even once OE's task for an object is over.
As of now I quite inelegantly deal with it with this ugly hack:
Code: Select all
protected function modelProductSetUp() {
$var_registered = in_array("var", stream_get_wrappers());
if ($var_registered) {
stream_wrapper_unregister("var");
}
...
[ Do stuff with $factory that would otherwise raise a "stream already defined" error ]
$model = $factory->newModel('catalog/product');
return $model;
}
Wouldn't it be possible to keep the stream registered only within OE's internal management code and release it once the various internals have been managed?
Re: [RELEASED] Override Engine for OpenCart
Posted: Fri Feb 28, 2014 9:01 pm
by JNeuhoff
Our upcoming version 7 of the Override Engine will use cached files, stored in the folder system/cache/override, instead of the variable stream. This will also make debugging a lot easier. We have already implemented it for upcoming OpenCart 2.0 and will backport it for the OpenCart 1.5.x releases.
Re: [RELEASED] Override Engine for OpenCart
Posted: Sat Mar 01, 2014 5:37 pm
by dfumagalli
JNeuhoff wrote:Our upcoming version 7 of the Override Engine will use cached files, stored in the folder system/cache/override, instead of the variable stream. This will also make debugging a lot easier. We have already implemented it for upcoming OpenCart 2.0 and will backport it for the OpenCart 1.5.x releases.
Thank you very much!
Do we have to expect compatibility issues with version 6 or will it be a "plug and play" replacement with no side effects?
Re: [RELEASED] Override Engine for OpenCart
Posted: Sat Mar 01, 2014 10:52 pm
by JNeuhoff
Plug and Play replacement, fully backward compatible for the OpenCart 1.5.x range.
Re: [RELEASED] Override Engine for OpenCart
Posted: Mon Mar 03, 2014 9:30 pm
by JNeuhoff
rubendejong wrote:I should also have mentioned that I had to change the function newInstance in /system/engine/factory.php,
for the lines like $i = strrpos( $file, '/controller/' ); to $i = strrpos( $file, '/controller/' ); (without the forward slash). Because I'm on a shared server, I had to set the directories in config.php like this: define('DIR_SYSTEM', 'system/');, so the checks in factory.php failed. It probably has something to do with this but I can't get my finger behind it.
Any help appreciated!
The Override Enginbe has only been tested for normal web servers, including shared web hosts. However, you will need your own home directory and the 'public_html' or similar withing your home folder, and the config.php settings for the various paths should always including the trailing '/'. Oterwise it will be such a mess it's not worth the time and effort to support a 1 out of 1000 non-standard configuration.
Re: [RELEASED] Override Engine for OpenCart
Posted: Mon Mar 03, 2014 9:32 pm
by JNeuhoff
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?