Перейти до вмісту
Пошук в
  • Детальніше...
Шукати результати, які ...
Шукати результати в ...

модуль устанавливается на opencart, но не устанавливается на ocstore


Krot

Recommended Posts

всем привет, увидел модуль английского разработчика, есть демо версия у него, скачал , но модуль устанавливается на opencart 2.3.0.2, но не устанавливается на ocstore 2.3.0.2.3 пишет ошибку от чего такое возможно ?
  thrown in /public_html/admin/controller/extension/module/separate_products.php on line 160
[17-Nov-2018 07:55:12 Europe/Moscow] PHP Fatal error:  Uncaught Error: Call to a member function addPermission() on null in /public_html/admin/controller/extension/module/separate_products.php:160
Stack trace:
#0 /public_html/system/storage/modification/system/engine/action.php(51): ControllerExtensionModuleSeparateProducts->install(Array)
#1 /public_html/system/storage/modification/system/engine/loader.php(24): Action->execute(Object(Registry), Array)
#2 /public_html/admin/controller/extension/extension/module.php(25): Loader->controller('extension/modul...')
#3 /public_html/system/storage/modification/system/engine/action.php(51): ControllerExtensionExtensionModule->install()
#4 /public_html/admin/controller/startup/router.php(26): Action->execute(Object(Registry), Array)
#5 /public_html/system/storage/modification/system/engine/action.php(51): ControllerStartupRouter->index()
#6 /public_html/system/engine/front.php(34): Action->execute(Object(Registry))
#7 /public_html/system/engine/front.php(29): Front->execute(Object(Action))
#8 /public_html/system/framework.php(103): Front->dispatch(Object(Action), Object(Action))
#9 /public_html/system/startup.php(105): require_once('/home/z/...')
#10 /public_html/admin/index.php(19): start('admin')

Надіслати
Поділитися на інших сайтах


10 минут назад, nikifalex сказал:

еще выше

если ошибка только на ocstore,  то загрузка модели должна быть.  иначе, ошибка была бы и на opencart

Надіслати
Поділитися на інших сайтах

@Krot выше по коду есть

$this->load->model('user/user_group');

?

Надіслати
Поділитися на інших сайтах

вообщем вот весь код, может кто подскажет почему именно на ocstore не устанавливается ?

<?php
class ControllerExtensionModuleSeparateProducts extends Controller {
	private $error = array();

	public function index() {
		$this->load->language( 'extension/module/separate_products');
		$this->document->setTitle($this->language->get('heading_title'));
		$this->load->model('extension/module');
		$data['heading_title'] = $this->language->get('heading_title');
		
		$data['text_license'] = $this->language->get('text_license');
		$data['button_cancel'] = $this->language->get('button_cancel');
		$data['text_edit'] = $this->language->get('text_edit');
		
		if (isset($this->error['warning'])) {
			$data['error_warning'] = $this->error['warning'];
		} else {
			$data['error_warning'] = '';
		}

  		$data['breadcrumbs'] = array();

   		$data['breadcrumbs'][] = array(
       		'text'      => $this->language->get('text_home'),
            'href'      => $this->url->link(
                'common/home', 'token=' . $this->session->data['token'], true
            ),
      		'separator' => false
   		);

   		$data['breadcrumbs'][] = array(
       		'text'      => $this->language->get('text_module'),
			'href'      => $this->url->link(
				'extension/module', 'token=' . $this->session->data['token'], true
			),
      		'separator' => ' :: '
   		);
		
   		$data['breadcrumbs'][] = array(
       		'text'      => $this->language->get('heading_title'),
			'href'      => $this->url->link(
				 'extension/module/separate_products', 'token=' . $this->session->data['token'], true
			),
      		'separator' => ' :: '
   		);
		
		$data['action'] = $this->url->link(
			 'extension/module/separate_products', 
			'token=' . $this->session->data['token'], 
			true
		);
		
		$data['cancel'] = $this->url->link(
			'extension/module', 'token=' . $this->session->data['token'], true
		);

		if (isset($this->request->post['separate_products'])) {
			$modules = explode(',', $this->request->post['separate_products']);
		} elseif ($this->config->get('separate_products') != '') { 
			$modules = explode(',', $this->config->get('separate_products'));
		} else {
			$modules = array();
		}		
		
		$this->load->model('design/layout');
		
		$data['layouts'] = $this->model_design_layout->getLayouts();

		$data['modules'] = $modules;
		
		if (isset($this->request->post['separate_products'])) {
			$data['separate_products'] = $this->request->post['separate_products'];
		} else {
			$data['separate_products'] = $this->config->get('separate_products');
		}
		
		$data['header'] = $this->load->controller('common/header');
		$data['column_left'] = $this->load->controller('common/column_left');
		$data['footer'] = $this->load->controller('common/footer');
		
		$this->response->setOutput($this->load->view('extension/module/separate_products.tpl', $data));

		
	}
	
	
	public function install() { 
//Create ALTER user_id in tabele product
		//$col = @$this->db->query("SELECT user_id FROM ". DB_PREFIX . "product");
		//"SELECT * FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = 'my_table' AND COLUMN_NAME = 'my_column'";
		
		$query = $this->db->query("SELECT * FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = '" . DB_DATABASE . "' AND TABLE_NAME = '" . DB_PREFIX . "product' AND COLUMN_NAME = 'user_id'");
		if ($query->num_rows < 1) {
				$this->db->query("ALTER TABLE ". DB_PREFIX ."product ADD user_id INT NOT NULL DEFAULT 0 ");
				$this->db->query("UPDATE " . DB_PREFIX . "product SET user_id = '" . 1 . "'");
		}	
      		
//Create ALTER commission in tabele user
		//$col = @$this->db->query("SELECT commission FROM ". DB_PREFIX . "user");
		$query = $this->db->query("SELECT * FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = '" . DB_DATABASE . "' AND TABLE_NAME = '" . DB_PREFIX . "user' AND COLUMN_NAME = 'commission'");
		if ($query->num_rows < 1) {
				$this->db->query("ALTER TABLE ". DB_PREFIX ."user ADD commission DECIMAL(5,2) NOT NULL DEFAULT 0 ");
		}
//Create ALTER bank in tabele user
		//$col = @$this->db->query("SELECT bank FROM ". DB_PREFIX . "user");
		$query = $this->db->query("SELECT * FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = '" . DB_DATABASE . "' AND TABLE_NAME = '" . DB_PREFIX . "user' AND COLUMN_NAME = 'bank'");
		if ($query->num_rows < 1) {
				$this->db->query("ALTER TABLE ". DB_PREFIX ."user ADD bank VARCHAR(255) NOT NULL DEFAULT '' ");
		}
//Create ALTER add_code in tabele user
		//$col = @$this->db->query("SELECT bank FROM ". DB_PREFIX . "user");
		$query = $this->db->query("SELECT * FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = '" . DB_DATABASE . "' AND TABLE_NAME = '" . DB_PREFIX . "user' AND COLUMN_NAME = 'add_code'");
		if ($query->num_rows < 1) {
				$this->db->query("ALTER TABLE ". DB_PREFIX ."user ADD add_code TEXT NOT NULL DEFAULT '' ");
		}	
//Create ALTER user_text in tabele user
		//$col = @$this->db->query("SELECT bank FROM ". DB_PREFIX . "user");
		$query = $this->db->query("SELECT * FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = '" . DB_DATABASE . "' AND TABLE_NAME = '" . DB_PREFIX . "user' AND COLUMN_NAME = 'user_text'");
		if ($query->num_rows < 1) {
				$this->db->query("ALTER TABLE ". DB_PREFIX ."user ADD user_text VARCHAR(256) NOT NULL DEFAULT '' ");
		}
//Create ALTER user_text in tabele user
		//$col = @$this->db->query("SELECT bank FROM ". DB_PREFIX . "user");
		$query = $this->db->query("SELECT * FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = '" . DB_DATABASE . "' AND TABLE_NAME = '" . DB_PREFIX . "user' AND COLUMN_NAME = 'email_question'");
		if ($query->num_rows < 1) {
				$this->db->query("ALTER TABLE ". DB_PREFIX ."user ADD email_question tinyint(1) NOT NULL DEFAULT 1 ");
		}
//Create ALTER badge in tabele user
		//$col = @$this->db->query("SELECT bank FROM ". DB_PREFIX . "user");
		$query = $this->db->query("SELECT * FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = '" . DB_DATABASE . "' AND TABLE_NAME = '" . DB_PREFIX . "user' AND COLUMN_NAME = 'badge1'");
		if ($query->num_rows < 1) {
				$this->db->query("ALTER TABLE ". DB_PREFIX ."user ADD badge1 VARCHAR(128) NOT NULL DEFAULT '' ");
		}
//Create ALTER badge in tabele user
		//$col = @$this->db->query("SELECT bank FROM ". DB_PREFIX . "user");
		$query = $this->db->query("SELECT * FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = '" . DB_DATABASE . "' AND TABLE_NAME = '" . DB_PREFIX . "user' AND COLUMN_NAME = 'badge2'");
		if ($query->num_rows < 1) {
				$this->db->query("ALTER TABLE ". DB_PREFIX ."user ADD badge2 VARCHAR(128) NOT NULL DEFAULT '' ");
		}
//Create ALTER badge in tabele user
		//$col = @$this->db->query("SELECT bank FROM ". DB_PREFIX . "user");
		$query = $this->db->query("SELECT * FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = '" . DB_DATABASE . "' AND TABLE_NAME = '" . DB_PREFIX . "user' AND COLUMN_NAME = 'badge3'");
		if ($query->num_rows < 1) {
				$this->db->query("ALTER TABLE ". DB_PREFIX ."user ADD badge3 VARCHAR(128) NOT NULL DEFAULT '' ");
		}
//Create ALTER badge in tabele user
		//$col = @$this->db->query("SELECT bank FROM ". DB_PREFIX . "user");
		$query = $this->db->query("SELECT * FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = '" . DB_DATABASE . "' AND TABLE_NAME = '" . DB_PREFIX . "user' AND COLUMN_NAME = 'badge4'");
		if ($query->num_rows < 1) {
				$this->db->query("ALTER TABLE ". DB_PREFIX ."user ADD badge4 VARCHAR(128) NOT NULL DEFAULT '' ");
		}
//Create ALTER badge in tabele user
		//$col = @$this->db->query("SELECT bank FROM ". DB_PREFIX . "user");
		$query = $this->db->query("SELECT * FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = '" . DB_DATABASE . "' AND TABLE_NAME = '" . DB_PREFIX . "user' AND COLUMN_NAME = 'badge5'");
		if ($query->num_rows < 1) {
				$this->db->query("ALTER TABLE ". DB_PREFIX ."user ADD badge5 VARCHAR(128) NOT NULL DEFAULT '' ");		
		}
		
//ADD admin Permission
		$this->model_user_user_group->addPermission(1, 'access',  'extension/module/separate_products');
		$this->model_user_user_group->addPermission(1, 'modify',  'extension/module/separate_products');

//Separate Products - Admin Users		
		//Create Group Separate Products - Admin Users and get user_group_id		
		$query = $this->db->query("SELECT * FROM ". DB_PREFIX ."user_group WHERE name='Separate Products - Admin Users' ");
		if ($query->num_rows <= 0) {
			$this->db->query("INSERT INTO " . DB_PREFIX . "user_group (name) VALUES ('Separate Products - Admin Users')" );
		}
		$query = $this->db->query("SELECT * FROM ". DB_PREFIX ."user_group WHERE name='Separate Products - Admin Users' ");
		foreach ($query->rows as $result) {
			$user_group_id = $result['user_group_id'];
		}
    	
		//Separate product User group Permission
		//access
		$this->model_user_user_group->addPermission($user_group_id, 'access',  'extension/module/separate_products');
		//$this->model_user_user_group->addPermission($user_group_id, 'modify',  'extension/module/separate_products');
		
		$this->model_user_user_group->addPermission($user_group_id, 'access', 'catalog/attribute');
		$this->model_user_user_group->addPermission($user_group_id, 'access', 'catalog/attribute_group');
		$this->model_user_user_group->addPermission($user_group_id, 'access', 'catalog/category');
		$this->model_user_user_group->addPermission($user_group_id, 'access', 'catalog/download');
		$this->model_user_user_group->addPermission($user_group_id, 'access', 'catalog/filter');
		$this->model_user_user_group->addPermission($user_group_id, 'access', 'catalog/manufacturer');
		$this->model_user_user_group->addPermission($user_group_id, 'access', 'catalog/option');
		$this->model_user_user_group->addPermission($user_group_id, 'access', 'catalog/product');
				
		$this->model_user_user_group->addPermission($user_group_id, 'access', 'common/filemanager');
		$this->model_user_user_group->addPermission($user_group_id, 'access', 'extension/openbay');
		
		$this->model_user_user_group->addPermission($user_group_id, 'access', 'user/api');
		$this->model_user_user_group->addPermission($user_group_id, 'access', 'user/user');
		
		$this->model_user_user_group->addPermission($user_group_id, 'access', 'sale/order');
		$this->model_user_user_group->addPermission($user_group_id, 'access', 'sale/recurring');
		$this->model_user_user_group->addPermission($user_group_id, 'access', 'sale/return');
		$this->model_user_user_group->addPermission($user_group_id, 'access', 'sale/voucher');
		
		//modify
		$this->model_user_user_group->addPermission($user_group_id, 'modify', 'catalog/attribute');
		$this->model_user_user_group->addPermission($user_group_id, 'modify', 'catalog/attribute_group');
		$this->model_user_user_group->addPermission($user_group_id, 'modify', 'catalog/category');
		$this->model_user_user_group->addPermission($user_group_id, 'modify', 'catalog/download');
		$this->model_user_user_group->addPermission($user_group_id, 'modify', 'catalog/filter');
		$this->model_user_user_group->addPermission($user_group_id, 'modify', 'catalog/manufacturer');
		$this->model_user_user_group->addPermission($user_group_id, 'modify', 'catalog/option');
		$this->model_user_user_group->addPermission($user_group_id, 'modify', 'catalog/product');
				
		$this->model_user_user_group->addPermission($user_group_id, 'modify', 'common/filemanager');
		$this->model_user_user_group->addPermission($user_group_id, 'modify', 'extension/openbay');
		
		$this->model_user_user_group->addPermission($user_group_id, 'modify', 'user/api');
		$this->model_user_user_group->addPermission($user_group_id, 'modify', 'user/user');
		
		$this->model_user_user_group->addPermission($user_group_id, 'modify', 'sale/order');
		$this->model_user_user_group->addPermission($user_group_id, 'modify', 'sale/recurring');
		$this->model_user_user_group->addPermission($user_group_id, 'modify', 'sale/return');
		$this->model_user_user_group->addPermission($user_group_id, 'modify', 'sale/voucher');
		
		
//Separate Products - External Users		
		//Create Group Separate Products - External Users and get user_group_id		
		$query = $this->db->query("SELECT * FROM ". DB_PREFIX ."user_group WHERE name='Separate Products - External Users' ");
		if ($query->num_rows <= 0) {
			$this->db->query("INSERT INTO " . DB_PREFIX . "user_group (name) VALUES ('Separate Products - External Users')" );
		}
		$query = $this->db->query("SELECT * FROM ". DB_PREFIX ."user_group WHERE name='Separate Products - External Users' ");
		foreach ($query->rows as $result) {
			$user_group_id = $result['user_group_id'];
		}
    	
		//Separate product User group Permission
		//access
		$this->model_user_user_group->addPermission($user_group_id, 'access', 'catalog/attribute');
		$this->model_user_user_group->addPermission($user_group_id, 'access', 'catalog/attribute_group');
		$this->model_user_user_group->addPermission($user_group_id, 'access', 'catalog/category');
		$this->model_user_user_group->addPermission($user_group_id, 'access', 'catalog/download');
		$this->model_user_user_group->addPermission($user_group_id, 'access', 'catalog/filter');
		$this->model_user_user_group->addPermission($user_group_id, 'access', 'catalog/manufacturer');
		$this->model_user_user_group->addPermission($user_group_id, 'access', 'catalog/option');
		$this->model_user_user_group->addPermission($user_group_id, 'access', 'catalog/product');
		
		$this->model_user_user_group->addPermission($user_group_id, 'access', 'common/filemanager');
		$this->model_user_user_group->addPermission($user_group_id, 'access', 'sale/order');
		$this->model_user_user_group->addPermission($user_group_id, 'access', 'extension/openbay');
		$this->model_user_user_group->addPermission($user_group_id, 'access', 'user/api');
		//modify
		$this->model_user_user_group->addPermission($user_group_id, 'modify', 'catalog/product');
		$this->model_user_user_group->addPermission($user_group_id, 'modify', 'common/filemanager');
		$this->model_user_user_group->addPermission($user_group_id, 'modify', 'sale/order');
		$this->model_user_user_group->addPermission($user_group_id, 'modify', 'user/api');

//Separate Products - Internal Users		
		//Create Group Separate Products - Internal Users and get user_group_id		
		$query = $this->db->query("SELECT * FROM ". DB_PREFIX ."user_group WHERE name='Separate Products - Internal Users' ");
		if ($query->num_rows <= 0) {
			$this->db->query("INSERT INTO " . DB_PREFIX . "user_group (name) VALUES ('Separate Products - Internal Users')" );
		}
		$query = $this->db->query("SELECT * FROM ". DB_PREFIX ."user_group WHERE name='Separate Products - Internal Users' ");
		foreach ($query->rows as $result) {
			$user_group_id = $result['user_group_id'];
		}
    	
		//Separate product Admin User group Permission
		//access
		$this->model_user_user_group->addPermission($user_group_id, 'access', 'catalog/attribute');
		$this->model_user_user_group->addPermission($user_group_id, 'access', 'catalog/attribute_group');
		$this->model_user_user_group->addPermission($user_group_id, 'access', 'catalog/category');
		$this->model_user_user_group->addPermission($user_group_id, 'access', 'catalog/download');
		$this->model_user_user_group->addPermission($user_group_id, 'access', 'catalog/filter');
		$this->model_user_user_group->addPermission($user_group_id, 'access', 'catalog/manufacturer');
		$this->model_user_user_group->addPermission($user_group_id, 'access', 'catalog/option');
		$this->model_user_user_group->addPermission($user_group_id, 'access', 'catalog/product');
		
		$this->model_user_user_group->addPermission($user_group_id, 'access', 'common/filemanager');
		$this->model_user_user_group->addPermission($user_group_id, 'access', 'sale/order');
		$this->model_user_user_group->addPermission($user_group_id, 'access', 'extension/openbay');
		$this->model_user_user_group->addPermission($user_group_id, 'access', 'user/api');
		
		//modify
		$this->model_user_user_group->addPermission($user_group_id, 'modify',  'extension/module/separate_products');
		
		$this->model_user_user_group->addPermission($user_group_id, 'modify', 'catalog/product');
		$this->model_user_user_group->addPermission($user_group_id, 'modify', 'common/filemanager');
		$this->model_user_user_group->addPermission($user_group_id, 'modify', 'sale/order');
		$this->model_user_user_group->addPermission($user_group_id, 'modify', 'user/api');
		
//Separate Products - Internal Users - Only Products 		
		//Create Group Separate Products - Internal Users and get user_group_id		
		$query = $this->db->query("SELECT * FROM ". DB_PREFIX ."user_group WHERE name='Separate Products - Internal Users - Only Products' ");
		if ($query->num_rows <= 0) {
			$this->db->query("INSERT INTO " . DB_PREFIX . "user_group (name) VALUES ('Separate Products - Internal Users - Only Products')" );
		}
		$query = $this->db->query("SELECT * FROM ". DB_PREFIX ."user_group WHERE name='Separate Products - Internal Users - Only Products' ");
		foreach ($query->rows as $result) {
			$user_group_id = $result['user_group_id'];
		}
    	
		//Separate product Admin User group Permission
		//access
		$this->model_user_user_group->addPermission($user_group_id, 'access', 'catalog/attribute');
		$this->model_user_user_group->addPermission($user_group_id, 'access', 'catalog/attribute_group');
		$this->model_user_user_group->addPermission($user_group_id, 'access', 'catalog/category');
		$this->model_user_user_group->addPermission($user_group_id, 'access', 'catalog/download');
		$this->model_user_user_group->addPermission($user_group_id, 'access', 'catalog/filter');
		$this->model_user_user_group->addPermission($user_group_id, 'access', 'catalog/manufacturer');
		$this->model_user_user_group->addPermission($user_group_id, 'access', 'catalog/option');
		$this->model_user_user_group->addPermission($user_group_id, 'access', 'catalog/product');
		$this->model_user_user_group->addPermission($user_group_id, 'access', 'user/api');
		
		$this->model_user_user_group->addPermission($user_group_id, 'access', 'common/filemanager');
		//$this->model_user_user_group->addPermission($user_group_id, 'access', 'sale/order');
		//$this->model_user_user_group->addPermission($user_group_id, 'access', 'extension/openbay');
		
		//modify
		$this->model_user_user_group->addPermission($user_group_id, 'modify',  'extension/module/separate_products');
		
		$this->model_user_user_group->addPermission($user_group_id, 'modify', 'catalog/product');
		$this->model_user_user_group->addPermission($user_group_id, 'modify', 'common/filemanager');
		$this->model_user_user_group->addPermission($user_group_id, 'modify', 'user/api');
		//$this->model_user_user_group->addPermission($user_group_id, 'modify', 'sale/order');

//Separate Products - Internal Users - Only Orders 		
		//Create Group Separate Products - Internal Users and get user_group_id		
		$query = $this->db->query("SELECT * FROM ". DB_PREFIX ."user_group WHERE name='Separate Products - Internal Users - Only Orders' ");
		if ($query->num_rows <= 0) {
			$this->db->query("INSERT INTO " . DB_PREFIX . "user_group (name) VALUES ('Separate Products - Internal Users - Only Orders')" );
		}
		$query = $this->db->query("SELECT * FROM ". DB_PREFIX ."user_group WHERE name='Separate Products - Internal Users - Only Orders' ");
		foreach ($query->rows as $result) {
			$user_group_id = $result['user_group_id'];
		}
    	
		//Separate product Admin User group Permission
		//access
		$this->model_user_user_group->addPermission($user_group_id, 'access', 'catalog/attribute');
		$this->model_user_user_group->addPermission($user_group_id, 'access', 'catalog/attribute_group');
		$this->model_user_user_group->addPermission($user_group_id, 'access', 'catalog/category');
		$this->model_user_user_group->addPermission($user_group_id, 'access', 'catalog/download');
		$this->model_user_user_group->addPermission($user_group_id, 'access', 'catalog/filter');
		$this->model_user_user_group->addPermission($user_group_id, 'access', 'catalog/manufacturer');
		$this->model_user_user_group->addPermission($user_group_id, 'access', 'catalog/option');
		$this->model_user_user_group->addPermission($user_group_id, 'access', 'catalog/product');
				
		$this->model_user_user_group->addPermission($user_group_id, 'access', 'user/user');
		$this->model_user_user_group->addPermission($user_group_id, 'access', 'sale/order');
		$this->model_user_user_group->addPermission($user_group_id, 'access', 'extension/openbay');
		$this->model_user_user_group->addPermission($user_group_id, 'access', 'user/api');
		
		//modify
		$this->model_user_user_group->addPermission($user_group_id, 'modify', 'sale/order');
		$this->model_user_user_group->addPermission($user_group_id, 'modify', 'localisation/order_status');
		$this->model_user_user_group->addPermission($user_group_id, 'modify', 'user/api');

		
    }
	
	public function uninstall() {  
		//$this->load->language( 'extension/module/separate_products');
		//$this->document->setTitle($this->language->get('heading_title'));
		$this->load->model('extension/module');
		$this->load->model('user/user_group');
				
//Delete Separate Products - External Users
		$query = $this->db->query("SELECT * FROM ". DB_PREFIX ."user_group WHERE name='Separate Products - External Users' ");
		foreach ($query->rows as $result) {
			$user_group_id = $result['user_group_id'];
		}
		$this->model_user_user_group->removePermission($user_group_id, 'access', 'catalog/attribute');
		$this->model_user_user_group->removePermission($user_group_id, 'access', 'catalog/attribute_group');
		$this->model_user_user_group->removePermission($user_group_id, 'access', 'catalog/category');
		$this->model_user_user_group->removePermission($user_group_id, 'access', 'catalog/download');
		$this->model_user_user_group->removePermission($user_group_id, 'access', 'catalog/filter');
		$this->model_user_user_group->removePermission($user_group_id, 'access', 'catalog/manufacturer');
		$this->model_user_user_group->removePermission($user_group_id, 'access', 'catalog/option');
		$this->model_user_user_group->removePermission($user_group_id, 'access', 'catalog/product');
		
		$this->model_user_user_group->removePermission($user_group_id, 'access', 'common/filemanager');
		$this->model_user_user_group->removePermission($user_group_id, 'access', 'sale/order');
		$this->model_user_user_group->removePermission($user_group_id, 'access', 'extension/openbay');
		
		
		//modify
		$this->model_user_user_group->removePermission($user_group_id, 'modify', 'catalog/product');
		$this->model_user_user_group->removePermission($user_group_id, 'modify', 'common/filemanager');
		$this->model_user_user_group->removePermission($user_group_id, 'modify', 'sale/order');

//Delete Separate Products - Internal Users		
		$query = $this->db->query("SELECT * FROM ". DB_PREFIX ."user_group WHERE name='Separate Products - Internal Users' ");
		foreach ($query->rows as $result) {
			$user_group_id = $result['user_group_id'];
		}
		$this->model_user_user_group->removePermission($user_group_id, 'access', 'catalog/attribute');
		$this->model_user_user_group->removePermission($user_group_id, 'access', 'catalog/attribute_group');
		$this->model_user_user_group->removePermission($user_group_id, 'access', 'catalog/category');
		$this->model_user_user_group->removePermission($user_group_id, 'access', 'catalog/download');
		$this->model_user_user_group->removePermission($user_group_id, 'access', 'catalog/filter');
		$this->model_user_user_group->removePermission($user_group_id, 'access', 'catalog/manufacturer');
		$this->model_user_user_group->removePermission($user_group_id, 'access', 'catalog/option');
		$this->model_user_user_group->removePermission($user_group_id, 'access', 'catalog/product');
		
		$this->model_user_user_group->removePermission($user_group_id, 'access', 'common/filemanager');
		$this->model_user_user_group->removePermission($user_group_id, 'access', 'sale/order');
		$this->model_user_user_group->removePermission($user_group_id, 'access', 'extension/openbay');
		
		//modify
		$this->model_user_user_group->removePermission($user_group_id, 'modify',  'extension/module/separate_products');
		
		$this->model_user_user_group->removePermission($user_group_id, 'modify', 'catalog/product');
		$this->model_user_user_group->removePermission($user_group_id, 'modify', 'common/filemanager');
		$this->model_user_user_group->removePermission($user_group_id, 'modify', 'sale/order');
		
//Delete Separate Products - Internal Users	 - Only Products	
		$query = $this->db->query("SELECT * FROM ". DB_PREFIX ."user_group WHERE name='Separate Products - Internal Users - Only Products' ");
		foreach ($query->rows as $result) {
			$user_group_id = $result['user_group_id'];
		}
		$this->model_user_user_group->removePermission($user_group_id, 'access', 'catalog/attribute');
		$this->model_user_user_group->removePermission($user_group_id, 'access', 'catalog/attribute_group');
		$this->model_user_user_group->removePermission($user_group_id, 'access', 'catalog/category');
		$this->model_user_user_group->removePermission($user_group_id, 'access', 'catalog/download');
		$this->model_user_user_group->removePermission($user_group_id, 'access', 'catalog/filter');
		$this->model_user_user_group->removePermission($user_group_id, 'access', 'catalog/manufacturer');
		$this->model_user_user_group->removePermission($user_group_id, 'access', 'catalog/option');
		$this->model_user_user_group->removePermission($user_group_id, 'access', 'catalog/product');
		
		$this->model_user_user_group->removePermission($user_group_id, 'access', 'common/filemanager');
		//$this->model_user_user_group->removePermission($user_group_id, 'access', 'sale/order');
		//$this->model_user_user_group->removePermission($user_group_id, 'access', 'extension/openbay');
		
		//modify
		$this->model_user_user_group->removePermission($user_group_id, 'modify',  'extension/module/separate_products');
		
		$this->model_user_user_group->removePermission($user_group_id, 'modify', 'catalog/product');
		$this->model_user_user_group->removePermission($user_group_id, 'modify', 'common/filemanager');
		//$this->model_user_user_group->removePermission($user_group_id, 'modify', 'sale/order');
		
//Delete Separate Products - Internal Users	 - Only Orders	
		$query = $this->db->query("SELECT * FROM ". DB_PREFIX ."user_group WHERE name='Separate Products - Internal Users - Only Orders' ");
		foreach ($query->rows as $result) {
			$user_group_id = $result['user_group_id'];
		}
		$this->model_user_user_group->removePermission($user_group_id, 'access', 'catalog/attribute');
		$this->model_user_user_group->removePermission($user_group_id, 'access', 'catalog/attribute_group');
		$this->model_user_user_group->removePermission($user_group_id, 'access', 'catalog/category');
		$this->model_user_user_group->removePermission($user_group_id, 'access', 'catalog/download');
		$this->model_user_user_group->removePermission($user_group_id, 'access', 'catalog/filter');
		$this->model_user_user_group->removePermission($user_group_id, 'access', 'catalog/manufacturer');
		$this->model_user_user_group->removePermission($user_group_id, 'access', 'catalog/option');
		$this->model_user_user_group->removePermission($user_group_id, 'access', 'catalog/product');
		
		
		$this->model_user_user_group->removePermission($user_group_id, 'access', 'user/user');
		$this->model_user_user_group->removePermission($user_group_id, 'access', 'sale/order');
		$this->model_user_user_group->removePermission($user_group_id, 'access', 'extension/openbay');
		
		//modify
		$this->model_user_user_group->removePermission($user_group_id, 'modify', 'sale/order');
		$this->model_user_user_group->removePermission($user_group_id, 'modify', 'localisation/order_status');
		
	
	
	} 
	
	public function delete() { 
        
		
		
    }
}

 

Надіслати
Поділитися на інших сайтах


после

public function uninstall() { 

добавить

$this->load->model('user/user_group');

 

Надіслати
Поділитися на інших сайтах

15 минут назад, fanatic сказал:

public function uninstall() {

 

после public function install() { же

Надіслати
Поділитися на інших сайтах


40 минут назад, thentru сказал:

после public function install() { же

конечно же.  виноват  копипаст

Надіслати
Поділитися на інших сайтах

уважаемые , прописал как вы сказали всё равно не устанавливается так же ошибка но уже видимо другая :

  thrown in /public_html/admin/controller/extension/module/separate_products.php on line 160
[19-Nov-2018 06:12:11 Europe/Moscow] PHP Parse error:  syntax error, unexpected '$query' (T_VARIABLE) in /public_html/admin/controller/extension/module/separate_products.php on line 93

 

Надіслати
Поділитися на інших сайтах


вот так получилось
public function install() { 
    $this->load->model('user/user_group');
//Create ALTER user_id in tabele product
        //$col = @$this->db->query("SELECT user_id FROM ". DB_PREFIX . "product");
        //"SELECT * FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = 'my_table' AND COLUMN_NAME = 'my_column'";
        
это строчка 93 :        $query = $this->db->query("SELECT * FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = '" . DB_DATABASE . "' AND TABLE_NAME = '" . DB_PREFIX . "product' AND COLUMN_NAME = 'user_id'");
        if ($query->num_rows < 1) {
                $this->db->query("ALTER TABLE ". DB_PREFIX ."product ADD user_id INT NOT NULL DEFAULT 0 ");
                $this->db->query("UPDATE " . DB_PREFIX . "product SET user_id = '" . 1 . "'");
        }    

Надіслати
Поділитися на інших сайтах


подскажите пожалуйста, главное установил с нуля на один и тот же хостинг opencart и ocstore на первом завёлся без проблем а на ocstore ошибки, неужелии эти движки так сильно отличаются ? думал просто русифицирован и код основной не затронут (((

Надіслати
Поділитися на інших сайтах


вы уверены, что ставите ту версию?
 

В 18.11.2018 в 05:21, Krot сказал:

$this->response->setOutput($this->load->view('extension/module/separate_products.tpl', $data));

в 2.3 такого не может быть, т.к. шаблон прописывается без .tpl

Надіслати
Поділитися на інших сайтах


Створіть аккаунт або увійдіть для коментування

Ви повинні бути користувачем, щоб залишити коментар

Створити обліковий запис

Зареєструйтеся для отримання облікового запису. Це просто!

Зареєструвати аккаунт

Вхід

Уже зареєстровані? Увійдіть тут.

Вхід зараз
  • Зараз на сторінці   0 користувачів

    • Ні користувачів, які переглядиють цю сторінку
×
×
  • Створити...

Important Information

На нашому сайті використовуються файли cookie і відбувається обробка деяких персональних даних користувачів, щоб поліпшити користувальницький інтерфейс. Щоб дізнатися для чого і які персональні дані ми обробляємо перейдіть за посиланням . Якщо Ви натиснете «Я даю згоду», це означає, що Ви розумієте і приймаєте всі умови, зазначені в цьому Повідомленні про конфіденційність.