espansio Posted January 5, 2015 Share Posted January 5, 2015 Hello, First time asking technical question in a forum so I beg pardon for errors. I have a third party blog module installed on opencart. The original coder helped me to fix some bugs, but he is not answering anymore to emails. I would like to add a simple pagination to the "latest articles" part, because at the moment the website display the exact number declared in "article limit" and does not show pagination if articles shown are less than the total. the code from "article_by_type.php" line 85 is the following: /*recent_article*/ if ($setting['article_type']=='recent_article') { $data = array( 'sort' => 'p.date_added', 'order' => 'DESC', 'start' => 0, 'limit' => $article_limit ); $articles = $this->model_news_article->getArticles($data); } another file "article_list.php" at line 88 and 214 already have pagination: $this->data['article_ajax_load'] = $this->getArticle($article_category_id,$page,$limit,$description_limit); $pagination = new Pagination(); $pagination->total = $article_total; $pagination->num_links = 3; $pagination->page = $page; $pagination->limit = $limit; $pagination->text = $this->language->get('text_pagination'); $pagination->url = 'index.php?route=module/article_list/getlist&cpath='.$article_category_id. '&page={page}'.'&limit=' .$limit; $this->data['pagination'] = $pagination->render(); can anyone help add pagination to "article_by_type.php" or adapt the existing pagination code to it ? article_by_type.php article_list.php Quote Link to comment https://forums.phpfreaks.com/topic/293665-add-pagination-to-an-existing-opencart-module/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.