I'm setting up a MultiStore store and I'm wondering if there's a way that when I'm in the admin section, if I can choose to only view products, categories, etc for a specific store at a time. It seems like when I go to Products, I'm viewing every products across all my stores which is overwhelming. I don't see a Store option in the filter area on the sides so not sure if there's a way to do that.
Thanks.
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
I did find this other one and sent an email asking about v3 compatibility but didn't hear back yet.
https://www.opencart.com/index.php?rout ... n_id=18735
Otherwise maybe I'll just uninstall and put an old version back on since there's more support for them.
Running Opencart v3.0.3.2 with multi-stores and the default template from https://www.labeshops.com which has links to all my stores.
See if this VQMod file works for version 3.0.2.0 of Opencart:kelemvor wrote: ↑Thu Oct 19, 2017 12:55 amI saw that one but since I'm just testing things for a side project, I don't want to spend $20 for what should be included functionality.
I did find this other one and sent an email asking about v3 compatibility but didn't hear back yet.
https://www.opencart.com/index.php?rout ... n_id=18735
Otherwise maybe I'll just uninstall and put an old version back on since there's more support for them.
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<modification>
<id>Multi Shop Product Filter</id>
<version>2.0</version>
<vqmver>2.2.1</vqmver>
<author>Jason Clark (mithereal@gmail.com)</author>
<file name="admin/controller/catalog/product.php">
<operation>
<search position="after"><![CDATA[
protected function getList() {
]]></search>
<add><![CDATA[
if (isset($this->request->get['filter_store'])) {
$filter_store = $this->request->get['filter_store'];
} else {
$filter_store = null;
}
]]></add>
</operation>
<operation>
<search position="after"><![CDATA[
public function index() {
]]></search>
<add><![CDATA[
$this->load->language('module/store_filter');
]]></add>
</operation>
<operation>
<search position="after"><![CDATA[
protected function getList() {
]]></search>
<add><![CDATA[
if (isset($this->request->get['filter_store'])) {
$filter_store = $this->request->get['filter_store'];
} else {
$filter_store = null;
}
]]></add>
</operation>
<operation>
<search position="before"><![CDATA[
$product_total = $this->model_catalog_product->getTotalProducts($filter_data);
]]></search>
<add><![CDATA[
$filter_data['filter_store'] = $filter_store;
]]></add>
</operation>
<operation>
<search position="after"><![CDATA[
$data['products'][] = array(
]]></search>
<add><![CDATA[
'store' => $result['store_id'],
]]></add>
</operation>
<operation>
<search position="before"><![CDATA[
if (is_file(DIR_IMAGE . $result['image'])) {
]]></search>
<add><![CDATA[
if(!isset($result['store_id'])){
$result['store_id'] = 0;
}
]]></add>
</operation>
<operation>
<search position="after"><![CDATA[
$this->load->model('setting/store');
]]></search>
<add><![CDATA[
$data['column_store'] = $this->language->get('column_store');
]]></add>
</operation>
<operation>
<search position="before"><![CDATA[
if ($order == 'ASC') {
]]></search>
<add><![CDATA[
if (isset($this->request->get['filter_store'])) {
$url .= '&filter_store=' . $this->request->get['filter_store'];
}
]]></add>
</operation>
<operation>
<search position="after"><![CDATA[
$data['sort_order'] = $this->url->link('catalog/product', 'user_token=' . $this->session->data['user_token'] . '&sort=p.sort_order' . $url, true);
]]></search>
<add><![CDATA[
$data['sort_store'] = $this->url->link('catalog/product', 'user_token=' . $this->session->data['user_token'] . '&sort=p.sort_store' . $url, true);
]]></add>
</operation>
<operation>
<search position="after"><![CDATA[
$data['filter_status'] = $filter_status;
]]></search>
<add><![CDATA[
$data['filter_store'] = $filter_store;
]]></add>
</operation>
<operation>
<search position="after"><![CDATA[
$data['stores'] = array();
]]></search>
<add><![CDATA[
$data['entry_store'] = $this->language->get('entry_store');
]]></add>
</operation>
<operation>
<search position="before"><![CDATA[
$this->response->setOutput($this->load->view('catalog/product_list', $data));
]]></search>
<add><![CDATA[
$this->load->model('setting/store');
$data['stores'] = array();
$data['stores'][] = array(
'store_id' => 0,
'name' => $this->config->get('config_name') . $this->language->get('text_default'),
'url' => $this->config->get('config_secure') ? HTTPS_CATALOG : HTTP_CATALOG,
'edit' => $this->url->link('setting/setting', 'user_token=' . $this->session->data['user_token'], true)
);
$results = $this->model_setting_store->getStores();
foreach ($results as $result) {
$data['stores'][] = array(
'store_id' => $result['store_id'],
'name' => $result['name'],
'url' => $result['url'],
'edit' => $this->url->link('setting/store/edit', 'user_token=' . $this->session->data['user_token'] . '&store_id=' . $result['store_id'], true)
);
}
]]></add>
</operation>
<operation>
<search position="replace"><![CDATA[
$pagination->url = $this->url->link('catalog/product', 'user_token=' . $this->session->data['user_token'] . $url . '&page={page}', true);
]]></search>
<add><![CDATA[
if (isset($this->request->get['filter_store'])) {
$pagination->url = $this->url->link('catalog/product', 'user_token=' . $this->session->data['user_token'] . $url . '&page={page}'.'&filter_store='.$this->request->get['filter_store'], 'SSL');
} else {
$pagination->url = $this->url->link('catalog/product', 'user_token=' . $this->session->data['user_token'] . $url . '&page={page}', true);
}
]]></add>
</operation>
</file>
<file name="admin/model/catalog/product.php">
<operation>
<search position="after"><![CDATA[
$sql = "SELECT COUNT(DISTINCT p.product_id) AS total FROM " . DB_PREFIX . "product p LEFT JOIN " . DB_PREFIX . "product_description pd ON (p.product_id = pd.product_id)";
]]></search>
<add><![CDATA[
$sql .= " LEFT JOIN " . DB_PREFIX . "product_to_store p2s ON (p.product_id = p2s.product_id)";
]]></add>
</operation>
<operation>
<search position="replace"><![CDATA[
$sql = "SELECT * FROM " . DB_PREFIX . "product p LEFT JOIN " . DB_PREFIX . "product_description pd ON (p.product_id = pd.product_id) WHERE pd.language_id = '" . (int)$this->config->get('config_language_id') . "'";
]]></search>
<add><![CDATA[
$sql = "SELECT * FROM " . DB_PREFIX . "product p LEFT JOIN " . DB_PREFIX . "product_description pd ON (p.product_id = pd.product_id) LEFT JOIN " . DB_PREFIX . "product_to_store p2s ON (p.product_id = p2s.product_id) WHERE pd.language_id = '" . (int)$this->config->get('config_language_id') . "'";
]]></add>
</operation>
<operation>
<search position="before"><![CDATA[
if (isset($data['filter_status']) && $data['filter_status'] !== '') {
]]></search>
<add><![CDATA[
if (isset($data['filter_store'])) {
$sql .= " AND p2s.store_id = '" . (int)$data['filter_store'] . "'";
}
]]></add>
</operation>
</file>
<file name="admin/view/template/catalog/product_list.twig">
<operation>
<search position="before"><![CDATA[
<td class="text-right">{{ column_action }}</td>
]]></search>
<add><![CDATA[
<td class="text-left">{% if sort == 'p.store' %} <a href="{{ sort_store }}" class="{{ order|lower }}">{{ column_store }}</a> {% else %} <a href="{{ sort_store }}">{{ column_store }}</a> {% endif %}</td>
]]></add>
</operation>
<operation>
<search position="before"><![CDATA[
<button type="button" id="button-filter" class="btn btn-default"><i class="fa fa-filter"></i> {{ button_filter }}</button>
]]></search>
<add><![CDATA[
<div class="col-sm-4">
<div class="form-group">
<label class="control-label" for="input-store">{{ entry_store }}</label>
<select name="filter_store" id="input-store" class="form-control">
<option value="*">All</option>
{% for store in stores %}
{% if filter_store and filter_store == store.store_id %}
<option value="{{ store.store_id }}" selected="selected">{{ store.name }}</option>
{% else %}
<option value="{{ store.store_id }}">{{ store.name }}</option>
{% endif %}
{% endfor %}
</select>
</div>
</div>
]]></add>
</operation>
<operation>
<search position="after"><![CDATA[
<td class="text-left">{{ product.status }}</td>
]]></search>
<add><![CDATA[
<td class="text-left">
{% for store in stores %}
{% if product.store == store.store_id %}
{{ store.name }}
{% endif %}
{% endfor %}
</td>
]]></add>
</operation>
<operation>
<search position="before"><![CDATA[
var filter_status = $('select[name=\'filter_status\']').val();
]]></search>
<add><![CDATA[
var filter_store = $('select[name=\'filter_store\']').val();
if(filter_store != '*') {
url += '&filter_store=' + encodeURIComponent(filter_store);
}
]]></add>
</operation>
</file>
</modification>
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
When I use VQMod Manager and check the Error Log, it does show this error:
Code: Select all
---------- Date: 2017-10-18 20:33:18 ~ IP : 74.202.241.130 ----------
REQUEST URI : /admin/index.php?route=catalog/product
MOD DETAILS:
modFile : /home/awhatmom/opencart/vqmod/xml/storefilter.xml
id : Multi Shop Product Filter
version : 2.0
vqmver : 2.2.1
author : Jason Clark (mithereal@gmail.com)
File Name : admin/controller/catalog/product.php(0)
VQModObject::applyMod - SEARCH NOT FOUND (ABORTING MOD): $data['column_status'] = $this->language->get('column_status');
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Code: Select all
---------- Date: 2017-10-18 23:45:32 ~ IP : 72.135.237.17 ----------
REQUEST URI : /admin/index.php?route=catalog/product
MOD DETAILS:
modFile : /home/awhatmom/opencart/vqmod/xml/storefilter.xml
id : Multi Shop Product Filter
version : 2.0
vqmver : 2.2.1
author : Jason Clark (mithereal@gmail.com)
File Name : admin/controller/catalog/product.php(0)
VQModObject::applyMod - SEARCH NOT FOUND (ABORTING MOD): $data['sort_order'] = $this->url->link('catalog/product', 'token=' . $this->session->data['token'] . '&sort=p.sort_order' . $url, true);
----------------------------------------------------------------------
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
If there's an easier way of doing this, let me know.
Code: Select all
File Name : admin/controller/catalog/product.php(0)
VQModObject::applyMod - SEARCH NOT FOUND (ABORTING MOD): $data['column_status'] = $this->language->get('column_status');
Yep, same error as up above.
XML updated.
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Code: Select all
File Name : admin/controller/catalog/product.php(0)
VQModObject::applyMod - SEARCH NOT FOUND (ABORTING MOD): $data['entry_status'] = $this->language->get('entry_status');
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Code: Select all
Notice: Undefined property: Proxy::getSettingbyKey in /home/awhatmom/opencart/vqmod/vqcache/vq2-admin_controller_catalog_product.php on line 539
Code: Select all
File Name : admin/model/catalog/product.php(0)
VQModObject::applyMod - SEARCH NOT FOUND (ABORTING MOD): if (isset($data['filter_status']) && !is_null($data['filter_status'])) {
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Oh, and it's an offset instead of a property.
Code: Select all
Notice: Undefined offset: 0 in /home/awhatmom/opencart/vqmod/vqcache/vq2-admin_controller_catalog_product.php on line 541
Code: Select all
File Name : admin/model/catalog/product.php(0)
VQModObject::applyMod - SEARCH NOT FOUND (ABORTING MOD): if (isset($data['filter_status']) && !is_null($data['filter_status'])) {
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Code: Select all
Notice: Undefined offset: 0 in /home/awhatmom/opencart/vqmod/vqcache/vq2-admin_controller_catalog_product.php on line 541
Here's a link to the file listed above.
https://www.dropbox.com/s/elw7p5w1oblum ... t.php?dl=0
Users browsing this forum: No registered users and 99 guests