i installed this extension with journal 2 theme. It only works for first page of a parent category. If click page 2 of a top category there is no product displayed at all.
please help
this is the vqmod:
<file name="catalog/model/catalog/product.php">
<operation>
<search position="replace"><![CDATA[$sql .= " FROM " . DB_PREFIX . "product_to_category p2c";]]></search>
<add><![CDATA[$sql .= " FROM " . DB_PREFIX . "category_path cp LEFT JOIN " . DB_PREFIX . "product_to_category p2c ON (cp.category_id = p2c.category_id)";]]></add>
</operation>
<operation>
<search position="replace"><![CDATA[$sql .= " AND p2c.category_id = '" . (int)$data['filter_category_id'] . "'";]]></search>
<add><![CDATA[$sql .= " AND cp.path_id = '" . (int)$data['filter_category_id'] . "'";]]></add>
</operation>
</file>
you are right. This simple code worked in all templates.nosecret wrote:Try use method from below:
http://stackoverflow.com/questions/1215 ... n-opencart
when you are adding a category for this product,you add one more category for it,such as the parent category.
in this way,you donot need to change any code.
in this way,you donot need to change any code.
my extension:https://www.opencart.com/index.php?rout ... estshop24h
email :support@bestshop24h.com
site:http://www.bestshop24h.com
Also works for Opencart 3.0.2.0
Just to be clear edit ~/catalog/controller/product/category.php and add this line:
Just to be clear edit ~/catalog/controller/product/category.php and add this line:
Code: Select all
$filter_data = array(
'filter_category_id' => $category_id,
'filter_sub_category' => true, <--------- Add this line here
'filter_filter' => $filter,
'sort' => $sort,
'order' => $order,
'start' => ($page - 1) * $limit,
'limit' => $limit
);
I am tired of trying. Tried to add this
'filter_sub_category' => true,
line manually,
tried via vqmod,
tried via ocmod.
Refreshed cache and result is still the same.. Using opencart default template. Maybe I did something wrong? OC 3.0.3
'filter_sub_category' => true,
line manually,
tried via vqmod,
tried via ocmod.
Refreshed cache and result is still the same.. Using opencart default template. Maybe I did something wrong? OC 3.0.3
Who is online
Users browsing this forum: Google [Bot], janusz50 and 185 guests