I'm currently teaching myself OpenCart and OCMOD. I have a basic understanding on how the system works with creating an XML mod file and uploading this through the modifications interface or directly adding the XML data into the the XML row of the modifications table.
I can successfully, using XML, search for files and either replace lines of code or insert before or after.. The basics basically. I am still yet to learn the full capabilities of XML.
My question, how can I completely override a file? Like I said, I can find, replace or add code to a file by only search for a single line but as in the example below, when I try to search for the whole file and do a simple replace it will not work.
<!-- admin dashboard overide -->
<file path="admin/view/template/common/dashboard.tpl">
<operation>
<!-- search the whole file??? -->
<search>
<![CDATA[
<?php echo $header; ?><?php echo $column_left; ?>
<div id="content">
<div class="page-header">
<div class="container-fluid">
<h1><?php echo $heading_title; ?></h1>
<ul class="breadcrumb">
<?php foreach ($breadcrumbs as $breadcrumb) { ?>
<li><a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a></li>
<?php } ?>
</ul>
</div>
</div>
<div class="container-fluid">
<?php if ($error_install) { ?>
<div class="alert alert-danger"><i class="fa fa-exclamation-circle"></i> <?php echo $error_install; ?>
<button type="button" class="close" data-dismiss="alert">×</button>
</div>
<?php } ?>
<div class="row">
<div class="col-lg-3 col-md-3 col-sm-6"><?php echo $order; ?></div>
<div class="col-lg-3 col-md-3 col-sm-6"><?php echo $sale; ?></div>
<div class="col-lg-3 col-md-3 col-sm-6"><?php echo $customer; ?></div>
<div class="col-lg-3 col-md-3 col-sm-6"><?php echo $online; ?></div>
</div>
<div class="row">
<div class="col-lg-6 col-md-12 col-sx-12 col-sm-12"><?php echo $map; ?></div>
<div class="col-lg-6 col-md-12 col-sx-12 col-sm-12"><?php echo $chart; ?></div>
</div>
<div class="row">
<div class="col-lg-4 col-md-12 col-sm-12 col-sx-12"><?php echo $activity; ?></div>
<div class="col-lg-8 col-md-12 col-sm-12 col-sx-12"> <?php echo $recent; ?> </div>
</div>
</div>
</div>
<?php echo $footer; ?>
]]>
</search>
<!-- replace whole file with below -->
<add position="replace">
<![CDATA[
<div class="col-xs-12">OCMOD MODIFIED WORKING????? </div>
]]>
</add>
</operation>
</file>