Page 1 of 1
Adding new modules positions to OpenCart 3.0.2.0
Posted: Sat Feb 09, 2019 6:00 am
by PupStar
Good Evening,
I am trying to create a new module position called content_top which will allow me to show different banners, html etc in the header below the breadcrumb trail.
I have followed the instructions here but can not get it to show the content
https://stackoverflow.com/questions/481 ... pencart-3#
The only thing I have changed throughout the code is content_new to content_header
Any experts willing to have a stab at what the problem might be?
Thanks
Re: Adding new modules positions to OpenCart 3.0.2.0
Posted: Sun Feb 10, 2019 4:58 am
by OSWorX
Because this 'tutorial' is written in a good quality, what happens if you do not change content_new to content_header?
And do exactly what is written?
Or maybe you have an error on your own code?
Re: Adding new modules positions to OpenCart 3.0.2.0
Posted: Sun Feb 10, 2019 5:39 pm
by PupStar
Hi, thank you for your reply.
I have reverted the code back to the original but it still does not work. The admin side works where I can select what I want to display but nothing displays on the shop side.
OSWorX wrote: ↑Sun Feb 10, 2019 4:58 am
Because this 'tutorial' is written in a good quality, what happens if you do not change content_new to content_header?
And do exactly what is written?
Or maybe you have an error on your own code?
Re: Adding new modules positions to OpenCart 3.0.2.0
Posted: Sun Feb 10, 2019 9:09 pm
by cyclops12
Where are you trying to add the new position ??
That tutorial you followed is just for the home page position
Re: Adding new modules positions to OpenCart 3.0.2.0
Posted: Mon Feb 11, 2019 12:36 am
by PupStar
I have managed to get it working now on the home page position (although not sure what I did)
Ideally I would like to be able to use it on any/all pages, any ideas?
Thanks
cyclops12 wrote: ↑Sun Feb 10, 2019 9:09 pm
Where are you trying to add the new position ??
That tutorial you followed is just for the home page position
Re: Adding new modules positions to OpenCart 3.0.2.0
Posted: Mon Feb 11, 2019 12:54 am
by cyclops12
EDIT: add the module position to all pages via design/layout page
Re: Adding new modules positions to OpenCart 3.0.2.0
Posted: Mon Feb 11, 2019 1:18 am
by PupStar
I have but it does not show on the either the category or the product pages.
I have added {{ content_new }} to category.twig and product.twig but no joy.
cyclops12 wrote: ↑Mon Feb 11, 2019 12:54 am
EDIT: add the module position to all pages via design/layout page
Re: Adding new modules positions to OpenCart 3.0.2.0
Posted: Mon Feb 11, 2019 3:35 am
by cyclops12
You would also need to add the relevant code to the relevant controller fields
Re: Adding new modules positions to OpenCart 3.0.2.0
Posted: Mon Feb 11, 2019 4:01 am
by PupStar
ok so I added
$data['content_new'] = $this->load->controller('common/content_new');
to both category.php and product.php in catalog/controller/product/
I am learning slowly but what else am I missing???
Thanks
cyclops12 wrote: ↑Mon Feb 11, 2019 3:35 am
You would also need to add the relevant code to the relevant controller fields
Re: Adding new modules positions to OpenCart 3.0.2.0
Posted: Tue Feb 12, 2019 1:39 am
by cyclops12
How many different pages do you want this extra module position on ??
If it is multiple pages then you may be better putting the codes in header.php and header.twig instead of home.php and home.twig, then you just need to add a module to the new position on whatever page you want via design/layout.
If this is what you want then i can make up a quick zip file for you, if you cant manage it yourself.
Re: Adding new modules positions to OpenCart 3.0.2.0
Posted: Tue Feb 12, 2019 3:23 am
by PupStar
Ideally I would like to have the choice of which pages to add it to but if its easier just to add it to the header then I am ok with that.
If you could put a zip together for me that would be great as I have looked at this code forever and still not sure what I am not doing correctly.
Thanks for your help
cyclops12 wrote: ↑Tue Feb 12, 2019 1:39 am
How many different pages do you want this extra module position on ??
If it is multiple pages then you may be better putting the codes in header.php and header.twig instead of home.php and home.twig, then you just need to add a module to the new position on whatever page you want via design/layout.
If this is what you want then i can make up a quick zip file for you, if you cant manage it yourself.
Re: Adding new modules positions to OpenCart 3.0.2.0
Posted: Wed Feb 13, 2019 3:47 am
by cyclops12
Have you got vqmod installed ?
Do you want it on just the product pages I.e category/product/manufacturer etc and home page?
Re: Adding new modules positions to OpenCart 3.0.2.0
Posted: Wed Feb 13, 2019 4:01 am
by PupStar
cyclops12 wrote: ↑Wed Feb 13, 2019 3:47 am
Have you got vqmod installed ?
Do you want it on just the product pages I.e category/product/manufacturer etc and home page?
No I do not have vqmod and yes thoses pages.
Thanks
Re: Adding new modules positions to OpenCart 3.0.2.0
Posted: Wed Feb 13, 2019 4:22 am
by cyclops12
If you download the latest version of vqmod
Here is a link for vqmod
Attached is a zip which contains the 2 new files needed (content_header php which you need to put in catalog/controller/common+ twig file which goes in catalog/view/theme/default/template/common)and the vqmod file
Let me know how you get on with it
Re: Adding new modules positions to OpenCart 3.0.2.0
Posted: Wed Feb 13, 2019 4:25 am
by cyclops12
Along with vqmod i also use the vqmod manager to help keep things easy to manage.
I have attached it but up to you if you want to use it or not
Re: Adding new modules positions to OpenCart 3.0.2.0
Posted: Wed Feb 13, 2019 4:37 am
by PupStar
Thank you so much I am very grateful.
I have downloaded them and have a go as soon as I get home and let you know
Re: Adding new modules positions to OpenCart 3.0.2.0
Posted: Tue Feb 19, 2019 2:43 am
by PupStar
cyclops12 wrote: ↑Wed Feb 13, 2019 4:25 am
Along with vqmod i also use the vqmod manager to help keep things easy to manage.
I have attached it but up to you if you want to use it or not
Hi,
Sorry for not responding sooner, I have been down with man flu. The new module positions work great just how I wanted it
I have tried to use the vqmod manager but I get an error
I downloaded from github and uploaded the file and reinstalled but the error still occurs.
Re: Adding new modules positions to OpenCart 3.0.2.0
Posted: Wed Feb 20, 2019 12:50 am
by cyclops12
Try this later version of
vqmod manager