Post by puyopuy » Mon Oct 30, 2017 12:08 pm

Hi everyone,

Need some help for latest.twig. I want to show particular category in latest model. I edited controller/extension/module/latest.php and add 'filter_category_id' => 70 in line #12 like this:
$filter_data = array(
'filter_category_id' => 70,
'sort' => 'p.date_added',
'order' => 'DESC',
'start' => 0,
'limit' => $setting['limit']
);
After that I click Refresh button in Modifications, this model still show me all the categories. Can anyone tell me what was wrong. On the other hand, if I want to apply the fix using OCMOD, how can I do that?

Thank you very much for your help in advance.

Newbie

Posts

Joined
Fri Feb 10, 2012 11:47 pm

Post by puyopuy » Mon Oct 30, 2017 2:47 pm

Ooops, this was working in default theme, just something wrong in my custom theme. :laugh:

Newbie

Posts

Joined
Fri Feb 10, 2012 11:47 pm

Post by pom » Thu Nov 02, 2017 4:41 am

Ooh thanks, been wondering how to do this.

Now how would I get this to work on different category pages?

Would I have to make custom latest modules for each category page or is there a way to get the main latest module to get the category id from the category page it's applied to?

pom
New member

Posts

Joined
Thu Oct 26, 2017 12:12 am

Post by grgr » Thu Nov 02, 2017 5:15 pm

I did an extension for that, though it is little more advanced than talked about above.

https://www.opencart.com/index.php?rout ... on_id=2659

Image Image Image Image Image Image Image Image


User avatar
Active Member

Posts

Joined
Mon Mar 28, 2011 4:08 pm
Location - UK

Post by pom » Thu Nov 02, 2017 9:49 pm

I went about it a different way and made date_added the default sort for category pages.
Means I can keep pagination too which is a bonus.

pom
New member

Posts

Joined
Thu Oct 26, 2017 12:12 am
Who is online

Users browsing this forum: No registered users and 27 guests