Seybamanan
Seybamanan

Reputation: 61

Install OCMOD file in OpenCart

I've read tutorial in order to create OCMOD file that will add text in home page,but it doesn't display nothing.

<?xml version="1.0" encoding="utf-8"?>
<modification>
    <name>SET_TEXT_TEST</name>
    <version>1.0</version>
    <author>TEST</author>
    <code>TEST_TEXT</code>
    <link>http://www.opencart.com</link>
    <file path="upload/index.php">
        <operation>
            <search><![CDATA[
            $data['column_left'] = $this->load->controller('common/home');
            ]]></search>
            <add position="replace"><![CDATA[
            TEST TEXT
            ]]></add>
        </operation>
    </file>  
</modification>

Upvotes: 4

Views: 579

Answers (1)

focus.style
focus.style

Reputation: 6760

Good question.

Don't use upload folder as root folder. Unpack OpenCart files from upload to your website root on your hosting/server.

Your OCMOD is pretty OK, except of the file path. The correct one is <file path="index.php">, course this is the root folder, not upload.

<?xml version="1.0" encoding="utf-8"?>
<modification>
    <name>SET_TEXT_TEST</name>
    <version>1.0</version>
    <author>TEST</author>
    <code>TEST_TEXT</code>
    <link>http://www.opencart.com</link>
    <file path="index.php">
        <operation>
            <search><![CDATA[
            $data['column_left'] = $this->load->controller('common/home');
            ]]></search>
            <add position="replace"><![CDATA[
            TEST TEXT
            ]]></add>
        </operation>
    </file>  
</modification>

Upvotes: 3

Related Questions