Please help me, how to show sub-category products in parent category. In opencart 3020 I add <'filter_sub_category' => true,> into <catalog/controller/product/category.php> it work well, but when I upgrade to opencart 3031. When I add, it not work.
Please help me, I dont want downgrade to 3020
'filter_sub_category' => true,
Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces
“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.
Hi,
I replace
$filter_data = array(
'filter_category_id' => $category_id,
'filter_filter' => $filter,
'sort' => $sort,
'order' => $order,
'start' => ($page - 1) * $limit,
'limit' => $limit
);
to
$filter_data = array(
'filter_category_id' => $category_id,
'filter_sub_category' => true,
'filter_filter' => $filter,
'sort' => $sort,
'order' => $order,
'start' => ($page - 1) * $limit,
'limit' => $limit
);
I clear cache but it not work, I dont know what problem
You can check the query by adding :
Code: Select all
error_log($sql);
Code: Select all
$query = $this->db->query($sql);
Code: Select all
public function getProducts($data = array()) {
of file
Code: Select all
catalog/model/catalog/product.php
then you can view the created query in your error log.
Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces
“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.
I find something helpful in this which is working for me.hoangduy1505 wrote: ↑Fri Apr 05, 2019 12:10 pmHi,
I replace
$filter_data = array(
'filter_category_id' => $category_id,
'filter_filter' => $filter,
'sort' => $sort,
'order' => $order,
'start' => ($page - 1) * $limit,
'limit' => $limit
);
to
$filter_data = array(
'filter_category_id' => $category_id,
'filter_sub_category' => true,
'filter_filter' => $filter,
'sort' => $sort,
'order' => $order,
'start' => ($page - 1) * $limit,
'limit' => $limit
);
I clear cache but it not work, I dont know what problem
Extension Developer & Designer | Dedicated Opencart Support | Email: info@webiggle.com | Skype: live:.cid.64dee15a2bf28467 | store.webiggle.com
Users browsing this forum: Majestic-12 [Bot], Mariogs and 15 guests