4

I want to display all products in onepage while clicking a single button in main menu and also need to display category in main menu...

thank in advance...!

heart hacker
  • 431
  • 2
  • 8
  • 22
  • 1
    You mean without any category and no pagination ? ? check [this](https://www.opencart.com/index.php?route=marketplace/extension/info&extension_id=3889) if it helps you else will get back to you soon, – Punit Gajjar Nov 07 '16 at 14:11

3 Answers3

11
  1. Display Alll Product in one Page

    You have to create separate page for displaying all products.

    1. Create Model file catalog\model\catalog\allproduct.php and paste code this http://pastebin.com/suF5TP3z
    2. Create Controller file catalog\controller\productallproduct.php and paste below code http://pastebin.com/jZq3hZyc
    3. Create View file catalog\view\theme\default\template\productallproduct.tpl and paste below code http://pastebin.com/1HNh3x73

      4 . Create Language file catalog\language\en-gb\product\allproduct.php and paste below code http://pastebin.com/EcyJH7F9
      1. Enable module from back-end You can see link in menu
        enter image description here
  2. Display All Category in Menu
    1. Open and edit your category:
    2. Select tab Data:
    3. Find and Check:Top: Display in the top menu bar.
      enter image description here
      Note : Only works for the top parent categories.You will need to check all the top level categories.It's Opencart bugs.
Ketan Borada
  • 856
  • 9
  • 24
3

I suggest don't make any change in the default theme codes and structure. If you already using a custom theme you can easily create a menu and define to all categories included all products under the one menu or button. Lets get over with in that way : For example you have 5 categories. Every category includes over ten products or much.

  • Create a brand (Manifacturer). This brand will be contain just 1 category. Give it a name like "All Products"
  • Create a category and name it as "All Products".
  • Create a menu which will display all products and define the menu display as category. Select the "All Products" category which is you just created.
  • Go to product pages and click edit for each one. Click the "link" tab and the category textbox, choose "All Products" category. Make this simple edit for every product. I tried for you and it takes 4 / 5 seconds.
  • Go to "Theme Setting" in your theme. Find "Display Products" or "Products in Category" setting. There are always pre-defined display limit in every theme and it goes next with pagination. Make a simple calculation like that ; how many product in your store, 50 ? 100 ?
  • Setup the display limit bigger than your total product count.

That's it !

Maybe you would like to play menu css a bit. Like i said before, if you already using a custom theme, you dont need to fork your core codes especially the default theme.

Let me know if any help.

serkanbalta
  • 103
  • 4
2

The way i did its something like this

Controller : ControllerProductCategory

inside the index function replace

if (isset($this->request->get['limit'])) {
    $limit = $this->request->get['limit'];
} else {
    $limit = $this->config->get('config_product_limit');
}

with

if (isset($this->request->get['viewall'])) {
            $limit = "";
} else if (isset($this->request->get['limit'])) {
            $limit = $this->config->get('config_product_limit');
} else {
            $limit = $this->config->get('config_product_limit');
}

Also make this change to display all the products without category filter

replace this code

    if ($category_info) {
                $this->document->setTitle($category_info['meta_title']);
                $this->document->setDescription($category_info['meta_description']);
                $this->document->setKeywords($category_info['meta_keyword']);

With this code

if (($category_info) || ($category_id == 0)) {
    if ($category_id == 0) {
                $this->document->setTitle('all products');
                $this->document->setDescription('all products');
                $this->document->setKeywords('all products');
                $this->data['heading_title'] = 'all products';
                $category_info['description'] = '';
                $category_info['image'] = '';
      } else {
                $this->document->setTitle($category_info['name']);
                $this->document->setDescription($category_info['meta_description']);
                $this->document->setKeywords($category_info['meta_keyword']);
                $this->data['heading_title'] = $category_info['name'];
            }

and at the last create a new category , you can name it to anything you want. and give the link something like this

https://www.yourwebsite.com/yourCategoryname?viewall=viewall?viewall=viewall

You can place this link anywhere you want and it will load all the products without any pagination.

let me know if you still don't understand anything anyehere.

Punit Gajjar
  • 4,937
  • 7
  • 35
  • 70
  • i need to display all products in single page without category and i want to all products button in main menu and also to display all category in mainmenu...please help me how to do this??? – heart hacker Dec 10 '16 at 12:45
  • 1
    buddy i am not at home. will be help u out after tuesday . . – Punit Gajjar Dec 10 '16 at 18:35