Post by tomkop » Sun Sep 02, 2018 3:53 am

Hello, i have problem with mega filter pro ..
when i add product i have error:

Fatal error: Uncaught Error: Call to a member function get() on string in /var/www/html/storage/modification/system/engine/controller.php:31 Stack trace: #0 /var/www/html/storage/modification/system/engine/controller.php(41): Controller->__get('config') #1 /var/www/html/storage/modification/admin/model/catalog/product.php(326): Controller->__construct('') #2 /var/www/html/storage/modification/system/engine/loader.php(265): ModelCatalogProduct->addProduct(Array) #3 /var/www/html/system/engine/proxy.php(47): Loader->{closure}(Array, Array) #4 /var/www/html/storage/modification/admin/controller/catalog/product.php(77): Proxy->__call('addProduct', Array) #5 /var/www/html/storage/modification/system/engine/action.php(82): ControllerCatalogProduct->add() #6 /var/www/html/admin/controller/startup/router.php(26): Action->execute(Object(Registry), Array) #7 /var/www/html/storage/modification/system/engine/action.php(82): ControllerStartupRouter->index() #8 /var/www/html/storage/modification/system/engine/router.php(68): Action->ex in /var/www/html/storage/modification/system/engine/controller.php on line 31

this is i line 31:
public function __get($key) {
return $this->registry->get($key);
}

its default from opencart3

new code in controller.php with mega filter plugin is:


if( $this->rgetMFP($this->config->get('mfilter_url_param')?$this->config->get('mfilter_url_param'):'mfp') && ! $this->config->get('mfp_path_was_verificed') && isset( $this->request->get['route'] ) ) {
preg_match( '/path\[([^]]*)\]/', $this->rgetMFP($this->config->get('mfilter_url_param')?$this->config->get('mfilter_url_param'):'mfp'), $mf_matches );

if( class_exists( 'VQMod' ) ) {
require_once VQMod::modCheck( modification( DIR_SYSTEM . '../catalog/model/extension/module/mega_filter.php' ) );
} else {
require_once modification( DIR_SYSTEM . '../catalog/model/extension/module/mega_filter.php' );
}

if( empty( $mf_matches[1] ) ) {
preg_match( '#path,([^/]+)#', $this->rgetMFP($this->config->get('mfilter_url_param')?$this->config->get('mfilter_url_param'):'mfp'), $mf_matches );

if( ! empty( $mf_matches[1] ) ) {
if( class_exists( 'MegaFilterCore' ) ) {
$mf_matches[1] = MegaFilterCore::__parsePath( $this, $mf_matches[1] );
}
}
} else if( class_exists( 'MegaFilterCore' ) ) {
$mf_matches[1] = MegaFilterCore::__parsePath( $this, $mf_matches[1] );
}

if( ! empty( $mf_matches[1] ) ) {
if( ! $this->rgetMFP('mfilterAjax') && $this->rgetMFP('path') && $this->rgetMFP('path') != $mf_matches[1] ) {
$this->request->get['mfp_org_path'] = $this->rgetMFP('path');

if( 0 === ( $mf_strpos = strpos( $this->rgetMFP('mfp_org_path'), $mf_matches[1] . '_' ) ) ) {
$this->request->get['mfp_org_path'] = substr( $this->rgetMFP('mfp_org_path'), $mf_strpos+strlen($mf_matches[1])+1 );
}
} else {
$this->request->get['mfp_org_path'] = '';
}

//$this->request->get['path'] = $mf_matches[1];
$this->request->get['mfp_path'] = $mf_matches[1];

if( isset( $this->request->get['category_id'] ) || ( isset( $this->request->get['route'] ) && in_array( $this->request->get['route'], array( 'product/search', 'product/special', 'product/manufacturer/info' ) ) ) ) {
$mf_matches = explode( '_', $mf_matches[1] );
$this->request->get['category_id'] = end( $mf_matches );
}
}

unset( $mf_matches );

if( method_exists( $this->config, 'set' ) ) {
$this->config->set('mfp_path_was_verificed', true);
}


when i remove this, everything is OK, but .. i need this part of code for Mega filter ..
any helps? thanx

Newbie

Posts

Joined
Mon Feb 20, 2017 4:39 am

Post by IP_CAM » Sun Sep 02, 2018 9:55 am

Well, I cannot find such a Mod Name in the Extension Section, but
since it's believed to be a commercial Mod, you better contact the
Seller, to get some help, nobody else would be able to, I assume ...
Ernie

My Github OC Site: https://github.com/IP-CAM
5'600 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland
Who is online

Users browsing this forum: No registered users and 18 guests