Post by huntbee » Sun Mar 30, 2025 11:28 pm

Hello OpenCart Experts,

I'm testing the OCMOD for opencart 4.1.0.3. I'm trying with a simple test, i.e., to display a text in footer.

Here is my OCMOD code:

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<modification>
  <name>Test OCMOD for store footer</name>
  <code>store_footer_updates</code>
  <version>1.0.0</version>
  <author>HuntBee OpenCart Extensions</author>
  <link>https://www.huntbee.com</link>

  <file path="catalog/controller/common/footer.php">
    <operation>
      <search><![CDATA[$data['scripts'] = $this->document->getScripts('footer');]]></search>
      <add position="before"><![CDATA[
            $data['test'] = 'TEST FOOTER TEXT';
      ]]></add>
    </operation>

    <operation error="skip">
      <search error="skip"><![CDATA[Opencart\Catalog\Controller\Common;]]></search>
      <add position="replace"><![CDATA[Opencart\Catalog\Controller\Extension\Ocmod\Common;]]></add>
    </operation>
  </file>
  
  <file path="catalog/view/template/common/footer.twig">
    <operation>
      <search><![CDATA[</body>]]></search>
      <add position="before"><![CDATA[
            <!-- huntbee test-->
            {{ test }} 
      ]]></add>
    </operation>
  </file>
  
</modification>
Both footer.php and footer.twig modification cache file is created with required changes, however it is not passing the $data['test'] value to the footer.twig

What could be the issue, am i missing something here?

User avatar
New member

Posts

Joined
Sun Nov 01, 2015 4:01 am
Location - India

Post by JNeuhoff » Mon Mar 31, 2025 12:40 am

I can confirm this issue, just tested your script, see attached ocmod.zip. It looks like OpenCart isn't calling the modified controller.

Try it again with the master branch (upcoming 4.1.0.4). If that doesn't work, then open a new issue on github.

Attachments

OCMod Example: Footer


Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member
Online

Posts

Joined
Wed Dec 05, 2007 3:38 am

Who is online

Users browsing this forum: No registered users and 1 guest