0

I am trying to write my mod file to simply change a text in a footer. here is my install.xml code:

<?xml version="1.0" encoding="utf-8"?>
<modification>
    <name>Modify PowerBy Text</name>
    <version>1.0</version>
    <author>Shehzad</author>

    <file path="catalog/language/en-gb/common/footer.php">
        <operation>
            <search>
            <![CDATA[
            $_['text_powered']      = 'Powered By <a href="http://www.opencart.com">OpenCart</a><br /> %s &copy; %s';
            ]]></search>
            <add position="replace"><![CDATA[
            $_['text_powered']      = 'Powered By <a href="http://www.facebook.com/shehzad47">Shehzad</a><br /> %s &copy; %s';
            ]]></add>
        </operation>
    </file>  
</modification>

I have also created an empty folder called upload and along with install.xml zipped it to mod_footer.ocmod.zip as per standard. When I install it via installer, It uploads and installs successfully , at least I get a successful installation message. However, when I go to the Modifications page, I do not see it even after clicking the Refresh button. In addition, when I refresh my site, the modification is not seen.

DigitCart
  • 2,980
  • 2
  • 18
  • 28
Shehzad
  • 337
  • 4
  • 25
  • please try to refresh template caching for in OpenCart 3. please follow this https://stackoverflow.com/questions/45220327/disable-template-caching-for-development-in-opencart-3. – HDP Sep 24 '17 at 05:15

2 Answers2

0

Add a unique code to your xml file: <code>modify_powerby_text</code>

<?xml version="1.0" encoding="utf-8"?>
<modification>
    <name>Modify PowerBy Text</name>
    <version>1.0</version>
    <author>Shehzad</author>
    <code>modify_powerby_text</code>

    <file path="catalog/language/en-gb/common/footer.php">
        <operation>
            <search>
            <![CDATA[
            $_['text_powered']      = 'Powered By <a href="http://www.opencart.com">OpenCart</a><br /> %s &copy; %s';
            ]]></search>
            <add position="replace"><![CDATA[
            $_['text_powered']      = 'Powered By <a href="http://www.facebook.com/shehzad47">Shehzad</a><br /> %s &copy; %s';
            ]]></add>
        </operation>
    </file>  
</modification>
DigitCart
  • 2,980
  • 2
  • 18
  • 28
-1

You have to have a folder in the ocmod.zip called upload even if you only have a XML file in the modification leave the upload folder empty but still include it in the Zip it has to be in there for version 3 of OpenCart.

I found this out the hard way! trying to figure out why it wont show up in the modifications and that's all it was.

DigitCart
  • 2,980
  • 2
  • 18
  • 28