Post by kagan » Tue Mar 22, 2016 2:28 am

Hello.

Does anybody know how I can add my own code in files "index.php", "admin/index.php" by using OCMOD?

My OCMOD's code is next:

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<modification>
  <name>Shipping method Delivery</name>
  <code>Shipping method Delivery</code>
  <version>1.0.0</version>
  <author>kagan</author>
    <link>11</link>

  <file path="admin/index.php|index.php">
    <operation>
      <search><![CDATA[
        $registry->set('cache', $cache);
        ]]></search>
      <add position="after"><![CDATA[
  // Method of shipping - Deliery library
  require_once(DIR_SYSTEM . 'library/shippingDelivery.php');
  $delivery_library = new ShippingDelivery($registry);
  $registry->set('shipping_delivery', $delivery_library);
      ]]></add>
    </operation>
  </file>
</modification>
It should work, but in reality it doesn't.
In addition the file "admin.php" has edited successfully, but it seems to me that nothing has changed, and the OpenCart is continuing to use a base file which is located in "admin/index.php" (ignoring the modificated file).

I will be glad to any advice!)

User avatar
Newbie

Posts

Joined
Thu Mar 17, 2016 11:00 pm

Post by cyclops12 » Tue Mar 22, 2016 2:38 am

why are you putting code into the index.php files ??

just asking!

Expert Member

Posts

Joined
Sun Sep 27, 2015 1:10 am

Post by kagan » Tue Mar 22, 2016 2:44 am

cyclops12 wrote:why are you putting code into the index.php files ??

just asking!
As it shown above, it needs to include my own library and for further using it on others pages in both admin/catalog directories.

User avatar
Newbie

Posts

Joined
Thu Mar 17, 2016 11:00 pm
Who is online

Users browsing this forum: Semrush [Bot] and 36 guests