Using starter module you can create you own modules, it works like skeleton. You can also clone on Github or download from here https://www.opencart.com/index.php?rout ... n_id=36876
If i create full starter kit with all fields will it help? let me know
If i create full starter kit with all fields will it help? let me know
I am trying to add an option Enable or Disable in this module
I inserted in admin/controller/extension/module/starter_module.php following code
in admin/view/template/extension/module/starter_module.twig the following
in catalog/view/theme/default/template/extension/module/starter_module.twig the code from below
Here I want to display one text ex: Enabled if is enabled and False if is false, in this way is not working, please help me, what I missed.
Please admin don't delete, I hope it is in the right category
I inserted in admin/controller/extension/module/starter_module.php following code
Code: Select all
if (isset($this->request->post['new'])) {
$data['new'] = $this->request->post['new'];
} elseif (!empty($module_info)) {
$data['new'] = $module_info['new'];
} else {
$data['new'] = '';
}
Code: Select all
<div class="form-group">
<label class="col-sm-2 control-label" for="input-new">new</label>
<div class="col-sm-10">
<select name="new" id="input-new" class="form-control">
{% if new %}
<option value="1" selected="selected">{{ text_enabled }}</option>
<option value="0">{{ text_disabled }}</option>
{% else %}
<option value="1">{{ text_enabled }}</option>
<option value="0" selected="selected">{{ text_disabled }}</option>
{% endif %}
</select>
</div>
Here I want to display one text ex: Enabled if is enabled and False if is false, in this way is not working, please help me, what I missed.
Code: Select all
{% if new == text_enabled %}
Enabled
{% else %}
False
{% endif %}
In catalog/view/theme/default/template/extension/module/starter_module.twig just use this
Code: Select all
{% if new %}
Enabled
{% else %}
False
{% endif %}
Code: Select all
{% if new %}
Enabled
{% else %}
False
{% endif %}
I just added the admin controller and admin/view file into admin folder and in the catalog folder is the catalog/view..twig.
https://github.com/bblori/Opencart3
https://github.com/bblori/Opencart3
I can't find controller file in catalog folder? you need to add this codewebshop wrote: ↑Tue May 21, 2019 12:52 amI just added the admin controller and admin/view file into admin folder and in the catalog folder is the catalog/view..twig.
https://github.com/bblori/Opencart3
Code: Select all
$data['new'] = (int)$setting['new'];
Can you share full error message? btw if you want you can use this carousel module https://www.opencart.com/index.php?rout ... n_id=32751
I know, If I setup everything in admin/controller/setting and admin/view/...setting.twig files, in that case is working the variable in the catalog/..header as well you can see how I made here https://github.com/bblori/Enable-Style-OC3
But I want to set everything in starter extension to work with header.
Many thanks for reading
But I want to set everything in starter extension to work with header.
Many thanks for reading
Who is online
Users browsing this forum: No registered users and 112 guests