OCMOD modification is not working in OpenCart 3.0.3.6

There is a bug in OpenCart 3.0.3.6 where the OCMOD modification is partially working or not working at all.

  1. To fix this issue, you need to access the file system/modification.xml
  2. Edit the file and copy-paste code as mentioned below or you can get the code from https://github.com/opencart/opencart/blob/3.0.x.x_Maintenance/upload/system/modification.xml
  3. After editing and saving the updated changes, click on Refresh Modification button on Admin: Extension > Modifications
<?xml version="1.0" encoding="utf-8"?>

<modification>

<name>Modification Default</name>

<code>default</code>

<version>1.1</version>

<author>OpenCart Ltd</author>

<link>http://www.opencart.com</link>

<file path="system/{engine,library}/{action,loader,config,language}*.php|system/library/template/template.php">

<operation>

<search regex="true">

<![CDATA[~(require|include)(_once)?\(([^)]+)~]]>

</search>

<add position="replace">

<![CDATA[$1$2(modification($3)]]>

</add>

</operation>

</file>

<file path="system/library/template/twig.php">

<operation>

<search>

<![CDATA[if (is_file($file)) {]]>

</search>

<add position="replace">

<![CDATA[if (defined('DIR_CATALOG') && is_file(DIR_MODIFICATION . 'admin/view/template/' . $filename . '.twig')) {

$code = file_get_contents(DIR_MODIFICATION . 'admin/view/template/' . $filename . '.twig');

} elseif (is_file(DIR_MODIFICATION . 'catalog/view/theme/' . $filename . '.twig')) {

$code = file_get_contents(DIR_MODIFICATION . 'catalog/view/theme/' . $filename . '.twig');

} elseif (is_file($file)) {]]>

</add>

</operation>

</file>

</modification>