Post by jrj2211 » Fri Jun 09, 2017 4:29 am

Hello, I'm working on a module to add a vehicle selector to my homepage. I followed the tutorial in the open cart docs to create a basic admin module, which appears in the module list, I can install it, and access the admin page for it. Now I'm trying to add the module to the homepage but I do not see it in the list on the layouts page. I'm wondering what the steps are to create a front-end module. Like many tutorials state, I copied another module to create a new module with the same name as my admin module under the catalog/ directory yet I do not see it as an option in the layouts dropdown.

Here is my code for the front-end module:


catalog/controller/module/vehicle_selector.php
<?php
class ControllerModuleVehicleSelector extends Controller {
public function index() {
$this->load->language('module/vehicle_selector');

$data['heading_title'] = $this->language->get('heading_title');

if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/module/vehicle_selector.tpl')) {
return $this->load->view($this->config->get('config_template') . '/template/module/vehicle_selector.tpl', $data);
} else {
return $this->load->view('default/template/module/vehicle_selector.tpl', $data);
}
}
}


catalog/language/english/module/vehicle_selector.php
<?php
// Heading
$_['heading_title'] = 'Vehicle Selector';


catalog/view/theme/theme613/template/module/vehicle_selector.tpl
<div class="box category">
<div class="box-heading"><h3><?php echo $heading_title; ?></h3></div>
<div class="box-content">
<div class="box-category">
<div class="list-group">
this is just a test
</div>
</div>
</div>

Newbie

Posts

Joined
Sun Jun 04, 2017 2:34 am

Post by IP_CAM » Sun Jun 11, 2017 8:57 am

well, I am far from beeing a coder, but I still believe to miss the
MODEL/module/vehicle_selector.php File Content, related,
because you have to somehow link to the DB, to get the Data you'll need.
Ernie

My Github OC Site: https://github.com/IP-CAM
5'600 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland
Who is online

Users browsing this forum: No registered users and 2 guests