Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig
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?
At the very least you should post here the error messages you get in your server's error_log, or OpenCart's error.log.
Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig
Ah, okay. I have since found out that Mijoshop incorporates Opencart 2.0.1.1.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.
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
Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig
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.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 !
Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig
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 );
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
Hope this helps.
Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig
Actually I am a developer and the idea came nice to me; but I am still trying to understand it better.
Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig
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.
Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig
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.
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 );
}
Could some of you please have a short look and help?
Just to clarify, i'm doing this under OC 2.3.0.2 and using the apropriate Override Engine as well.
Thanks
Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig
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 );
}
}
Would this be the right way overrite it?
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 );
}
}
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 } ?>
</label>
</div>
</div>
</div>',
$template_buffer
);
return parent::preRender( $template_buffer, $template_name, $data );
}
}
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
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: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
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 );
}
Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig
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.2JNeuhoff wrote: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: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
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 ); }
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 );
}
Users browsing this forum: No registered users and 38 guests