Post by nudylady » Sun Jun 28, 2015 10:58 pm

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>

New member

Posts

Joined
Sun Feb 19, 2012 12:14 am

Post by nudylady » Sun Jun 28, 2015 11:00 pm

and this code worked if i use default theme.

New member

Posts

Joined
Sun Feb 19, 2012 12:14 am

Post by nosecret » Tue Jun 30, 2015 4:44 am


Active Member

Posts

Joined
Tue Dec 28, 2010 12:28 pm

Post by nudylady » Wed Nov 25, 2015 11:59 pm

nosecret wrote:Try use method from below:
http://stackoverflow.com/questions/1215 ... n-opencart
you are right. This simple code worked in all templates.

New member

Posts

Joined
Sun Feb 19, 2012 12:14 am

Post by tingwing » Tue Jan 10, 2017 9:37 pm

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.

my extension:https://www.opencart.com/index.php?rout ... estshop24h
email :support@bestshop24h.com
site:http://www.bestshop24h.com


Active Member

Posts

Joined
Tue Aug 02, 2016 9:01 pm

Post by foobarac » Mon Nov 12, 2018 12:54 am

Also works for Opencart 3.0.2.0

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
                        );

New member

Posts

Joined
Fri Sep 21, 2018 9:46 pm

Post by Viktoras9999 » Tue Jul 30, 2019 5:26 pm

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

Newbie

Posts

Joined
Tue Oct 02, 2018 12:38 am
Who is online

Users browsing this forum: Google [Bot], janusz50 and 185 guests