OCmod is not showing up in Modifications list - Opencart 3.0.2.0

1.1k Views Asked by At

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.

2

There are 2 best solutions below

1
On

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.

0
On

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>