Products to show without the add to cart button, another Opencart free module "Coming Soon Products module OpenCart version 2.0". When you enabled this module, you will be able to see the products which available date is greater than today.
The module will look like below:
Admin section will look like:
Download Coming Soon Future Products free module from the link below:
Download Coming Soon Future Products free Module
Installation:
- Unzip the downloaded folder.
- Upload the files in the root folder to your server, no file is overwritten.
- Then activate the "Future Products" module.
Activating the "Future Products" module:
- After uploading files to servers, it's time to install the "Future Products" module
- We are showing the "Future Products" module at the right column of the Category page (Category Layout) but you can show it wherever you like as this acts as a normal module.
- Go to Admin section
- Then click on Extensions on the left menu
- After that Click Modules and go to "Future Products" in the modules list
- Then click the Green button for the "Future Products" to install the module (see the image below)
- Then click the blue edit button
- After that, you will see the form which has the status field, select "Enabled" and then click the Save button.
- Your module is active and is ready to use in the layout.
Setup layout for the sidebar "Future Products" module at the right column of the home page:
- From the admin section go to System >> Design >> Layouts.
- You will see a list of layouts, from which edit the Home layout.
- Then click Blue add the button to add rows at module section which is shown in the image below:
- Second, you choose the "Future Products" in the module column and Column right in the Position column and insert the sort order as required.
- Then click save button
Your custom home page is ready with the "Future Products" module in the right column. Likewise, you can show in many other layouts and pages.
Codes of "Future Products" modules of the presentation layer's controller:
Go to catalog/controller/module/futureproducts.php
load->language('module/futureproducts'); $data['heading_title'] = $setting['name']; $data['text_tax'] = $this->language->get('text_tax'); $data['button_cart'] = $this->language->get('button_cart'); $data['button_wishlist'] = $this->language->get('button_wishlist'); $data['button_compare'] = $this->language->get('button_compare'); $this->load->model('catalog/product'); $this->load->model('catalog/futureproducts'); $this->load->model('tool/image'); $data['products'] = array(); $filter_data = array( 'sort' => 'p.date_added', 'order' => 'DESC', 'start' => 0, 'limit' => $setting['limit'] ); $results = $this->model_catalog_futureproducts->getProducts($filter_data); if ($results) { foreach ($results as $result) { if ($result['image']) { $image = $this->model_tool_image->resize($result['image'], $setting['width'], $setting['height']); } else { $image = $this->model_tool_image->resize('placeholder.png', $setting['width'], $setting['height']); } if (($this->config->get('config_customer_price') && $this->customer->isLogged()) || !$this->config->get('config_customer_price')) { $price = $this->currency->format($this->tax->calculate($result['price'], $result['tax_class_id'], $this->config->get('config_tax'))); } else { $price = false; } if ((float)$result['special']) { $special = $this->currency->format($this->tax->calculate($result['special'], $result['tax_class_id'], $this->config->get('config_tax'))); } else { $special = false; } if ($this->config->get('config_tax')) { $tax = $this->currency->format((float)$result['special'] ? $result['special'] : $result['price']); } else { $tax = false; } if ($this->config->get('config_review_status')) { $rating = $result['rating']; } else { $rating = false; } $data['products'][] = array( 'product_id' => $result['product_id'], 'thumb' => $image, 'name' => $result['name'], 'description' => utf8_substr(strip_tags(html_entity_decode($result['description'], ENT_QUOTES, 'UTF-8')), 0, $this->config->get('config_product_description_length')) . '..', 'price' => $price, 'special' => $special, 'tax' => $tax, 'rating' => $rating, 'href' => $this->url->link('product/product', 'product_id=' . $result['product_id']), ); } if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/module/futureproducts.tpl')) { return $this->load->view($this->config->get('config_template') . '/template/module/futureproducts.tpl', $data); } else { return $this->load->view('default/template/module/futureproducts.tpl', $data); } } } }
Codes of "Future Products" modules of the presentation layer's language file:
Go to catalog/language/english/module/futureproducts.php
Codes of "Account Login" modules of the presentation layer's template file:
Go to catalog/view/theme/default/module/futureproducts.tpl
Similarly, in the admin section, we have three files for the module
- admin/controller/module/futureproducts.php
- admin/language/english/module/futureproducts.php
- admin/view/template/module/futureproducts.tpl
Codes of "Future Products" modules of the admin layer's controller file:
Go to admin/controller/module/futureproducts.php
load->language('module/futureproducts'); $this->document->setTitle($this->language->get('heading_title')); $this->load->model('extension/module'); if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validate()) { if (!isset($this->request->get['module_id'])) { $this->model_extension_module->addModule('futureproducts', $this->request->post); } else { $this->model_extension_module->editModule($this->request->get['module_id'], $this->request->post); } $this->cache->delete('product'); $this->session->data['success'] = $this->language->get('text_success'); $this->response->redirect($this->url->link('extension/module', 'token=' . $this->session->data['token'], 'SSL')); } $data['heading_title'] = $this->language->get('heading_title'); $data['text_edit'] = $this->language->get('text_edit'); $data['text_enabled'] = $this->language->get('text_enabled'); $data['text_disabled'] = $this->language->get('text_disabled'); $data['entry_name'] = $this->language->get('entry_name'); $data['entry_limit'] = $this->language->get('entry_limit'); $data['entry_width'] = $this->language->get('entry_width'); $data['entry_height'] = $this->language->get('entry_height'); $data['entry_status'] = $this->language->get('entry_status'); $data['button_save'] = $this->language->get('button_save'); $data['button_cancel'] = $this->language->get('button_cancel'); if (isset($this->error['warning'])) { $data['error_warning'] = $this->error['warning']; } else { $data['error_warning'] = ''; } if (isset($this->error['name'])) { $data['error_name'] = $this->error['name']; } else { $data['error_name'] = ''; } if (isset($this->error['width'])) { $data['error_width'] = $this->error['width']; } else { $data['error_width'] = ''; } if (isset($this->error['height'])) { $data['error_height'] = $this->error['height']; } else { $data['error_height'] = ''; } $data['breadcrumbs'] = array(); $data['breadcrumbs'][] = array( 'text' => $this->language->get('text_home'), 'href' => $this->url->link('common/dashboard', 'token=' . $this->session->data['token'], 'SSL') ); $data['breadcrumbs'][] = array( 'text' => $this->language->get('text_module'), 'href' => $this->url->link('extension/module', 'token=' . $this->session->data['token'], 'SSL') ); if (!isset($this->request->get['module_id'])) { $data['breadcrumbs'][] = array( 'text' => $this->language->get('heading_title'), 'href' => $this->url->link('module/futureproducts', 'token=' . $this->session->data['token'], 'SSL') ); } else { $data['breadcrumbs'][] = array( 'text' => $this->language->get('heading_title'), 'href' => $this->url->link('module/futureproducts', 'token=' . $this->session->data['token'] . '&module_id=' . $this->request->get['module_id'], 'SSL') ); } if (!isset($this->request->get['module_id'])) { $data['action'] = $this->url->link('module/futureproducts', 'token=' . $this->session->data['token'], 'SSL'); } else { $data['action'] = $this->url->link('module/futureproducts', 'token=' . $this->session->data['token'] . '&module_id=' . $this->request->get['module_id'], 'SSL'); } $data['cancel'] = $this->url->link('extension/module', 'token=' . $this->session->data['token'], 'SSL'); if (isset($this->request->get['module_id']) && ($this->request->server['REQUEST_METHOD'] != 'POST')) { $module_info = $this->model_extension_module->getModule($this->request->get['module_id']); } if (isset($this->request->post['name'])) { $data['name'] = $this->request->post['name']; } elseif (!empty($module_info)) { $data['name'] = $module_info['name']; } else { $data['name'] = ''; } if (isset($this->request->post['limit'])) { $data['limit'] = $this->request->post['limit']; } elseif (!empty($module_info)) { $data['limit'] = $module_info['limit']; } else { $data['limit'] = 5; } if (isset($this->request->post['width'])) { $data['width'] = $this->request->post['width']; } elseif (!empty($module_info)) { $data['width'] = $module_info['width']; } else { $data['width'] = 200; } if (isset($this->request->post['height'])) { $data['height'] = $this->request->post['height']; } elseif (!empty($module_info)) { $data['height'] = $module_info['height']; } else { $data['height'] = 200; } if (isset($this->request->post['status'])) { $data['status'] = $this->request->post['status']; } elseif (!empty($module_info)) { $data['status'] = $module_info['status']; } else { $data['status'] = ''; } $data['header'] = $this->load->controller('common/header'); $data['column_left'] = $this->load->controller('common/column_left'); $data['footer'] = $this->load->controller('common/footer'); $this->response->setOutput($this->load->view('module/futureproducts.tpl', $data)); } protected function validate() { if (!$this->user->hasPermission('modify', 'module/futureproducts')) { $this->error['warning'] = $this->language->get('error_permission'); } if ((utf8_strlen($this->request->post['name']) < 3) || (utf8_strlen($this->request->post['name']) > 64)) { $this->error['name'] = $this->language->get('error_name'); } if (!$this->request->post['width']) { $this->error['width'] = $this->language->get('error_width'); } if (!$this->request->post['height']) { $this->error['height'] = $this->language->get('error_height'); } return !$this->error; } }Codes of "Future Products" modules of the admin layer's language file:
Go to admin/language/english/module/futureproducts.php
Codes of "Account Login" modules of the admin layer's template file:
Go to admin/view/module/futureproducts.tpl
Please let us know if you have any questions or concerns. Please don't forget to post your questions or comments so that we can add extra topics and Opencart free module. You can follow us at our twitter account @rupaknpl and subscribe to our YouTube channel for opencart tutorials.