Post by Ugh » Mon Aug 05, 2024 11:17 pm

Hello,

Im trying to upgrade my extension from opencart 3 to opencart 4.

Let's say I have this directory structure:

module_name/admin/view/image/my.png
How can I access this image?
I am trying to display it in a twig file.

In opencart 3 it could access it at {admin_url}/view/image/my.png
This does not seem to work in oc 4.

I looked at the example modules but none of them show an example for this....

Please help,
Thanks in advance =)!

Ugh
Newbie

Posts

Joined
Mon Aug 05, 2024 11:08 pm

Post by halfhope » Wed Aug 07, 2024 4:26 am

Hi!

Try to use path like this:

Code: Select all

$this->document->addStyle('/extension/menu_manager/admin/view/javascript/menu_manager.css?v=' . $this->_version);
$this->document->addScript('/extension/menu_manager/admin/view/javascript/menu_manager.js?v=' . $this->_version);

My FREE extensions in marketplace. [ security | flexibility | speedup ]


User avatar
Active Member

Posts

Joined
Tue Dec 10, 2013 9:44 pm
Location - San Diego

Post by Ugh » Wed Aug 07, 2024 3:21 pm

halfhope wrote:
Wed Aug 07, 2024 4:26 am
Hi!

Try to use path like this:

Code: Select all

$this->document->addStyle('/extension/menu_manager/admin/view/javascript/menu_manager.css?v=' . $this->_version);
$this->document->addScript('/extension/menu_manager/admin/view/javascript/menu_manager.js?v=' . $this->_version);
Thank you, this works!

Ugh
Newbie

Posts

Joined
Mon Aug 05, 2024 11:08 pm
Who is online

Users browsing this forum: No registered users and 3 guests