Post by DesignCart » Wed Aug 27, 2025 6:55 pm

Does anyone know how to include a file in an extension, e.g., in the public_html/extension/some-theme/admin/view/template/theme/file.twig directory, which is located in public_html/extension/some-theme/admin/view/template/theme/elements/test.twig? ???

Tworzenie sklepów internetowych | Portfolio | Cennik | O mnie


User avatar
Active Member

Posts

Joined
Thu Nov 10, 2016 2:06 pm
Location - Gubin

Post by paulfeakins » Thu Aug 28, 2025 7:30 pm

DesignCart wrote:
Wed Aug 27, 2025 6:55 pm
Does anyone know how to include a file in an extension, e.g., in the public_html/extension/some-theme/admin/view/template/theme/file.twig directory, which is located in public_html/extension/some-theme/admin/view/template/theme/elements/test.twig? ???
Sorry but I've read this a few times and I still don't understand what you mean?

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Legendary Member

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom

Post by khnaz35 » Fri Aug 29, 2025 12:18 am

Do you mean ?
// In your controller

Code: Select all

$data['test'] = $this->load->view('extension/some-theme/theme/elements/test', $data);

Got a burning question at 3 AM that even Google shrugs at? There’s a not-so-secret inbox that might just have your answer: khnaz35@gmail.com
Breathe in some nature while you're at it. It’s cheaper than therapy. :-*

Feel free to sling a bear my way via PayPal @ khnaz35@gmail.com


User avatar
Active Member

Posts

Joined
Mon Aug 27, 2018 11:30 pm
Location - Malaysia

Post by by mona » Fri Aug 29, 2025 12:46 am

Google it and tell us why you have a problem with the previous solutions provided asking the same questions
https://www.google.com/search?q=opencar ... s-wiz-serp

DISCLAIMER:
You should not modify core files .. if you would like to donate a cup of coffee I will write it in a modification for you.


https://www.youtube.com/watch?v=zXIxDoCRc84


User avatar
Expert Member

Posts

Joined
Mon Jun 10, 2019 9:31 am

Post by DesignCart » Sat Aug 30, 2025 1:44 pm

Thank You for answer. Hi I thinking about something like this: https://twig.symfony.com/doc/3.x/tags/include.html but it's not worging in OC

Tworzenie sklepów internetowych | Portfolio | Cennik | O mnie


User avatar
Active Member

Posts

Joined
Thu Nov 10, 2016 2:06 pm
Location - Gubin

Post by by mona » Sun Aug 31, 2025 8:27 pm

DesignCart wrote:
Sat Aug 30, 2025 1:44 pm
Thank You for answer. Hi I thinking about something like this: https://twig.symfony.com/doc/3.x/tags/include.html but it's not worging in OC
That is what I suspected you were meaning which is why I suggested to search on google because you are not the first to consider it - ask about it - and you will find the answers to that on various forum posts - including the second one down from my suggested google search .. there is no Opencart version and no details - in fairness I would still have linked you to a google result .. just one more specific - please do not ask us to explain all the intricacies of the answer - you can incLude a twig file into another twig file in so many different ways - just look at how it is done with currency language or the cart - that would be the most sensible option .. check when twig %include% was added to twig and the check you oc version and the corresponding twig version and use google to check which oc version you would need .. all of this was available in the link that was first provided - and the details of what how and why can be found there

DISCLAIMER:
You should not modify core files .. if you would like to donate a cup of coffee I will write it in a modification for you.


https://www.youtube.com/watch?v=zXIxDoCRc84


User avatar
Expert Member

Posts

Joined
Mon Jun 10, 2019 9:31 am
Who is online

Users browsing this forum: No registered users and 10 guests