I'm taking a stab at updating an old modification that adds a separate email address for the contact us page. There's one change that's not working because the search term is not found in the target file. I'm guessing those data functions have been moved somewhere else since version 2 of OC. I'm not quite sure what the added code is intended to do since it appears that the modification works without it. In the code below I've commented out the section that is failing. But like I said, running it as an ocmod without that change seems to work. Anyone have some insight as to whether or not that is really needed and if so what file it should be put in?
Code: Select all
<!--
Admin > Setting > Store
-->
<file path="admin/language/*/setting/setting.php">
<operation>
<search><![CDATA[
$_['entry_email']
]]></search>
<add position="after"><![CDATA[
$_['entry_email_contact'] = 'Contact E-Mail';
]]></add>
</operation>
<operation>
<search><![CDATA[
$_['error_email']
]]></search>
<add position="after"><![CDATA[
$_['error_email_contact'] = 'E-Mail Address does not appear to be valid!';
]]></add>
</operation>
</file>
<file path="admin/controller/setting/setting.php">
<!-- <operation>
<search><![CDATA[
$data['entry_email'] = $this->language->get('entry_email');
]]></search>
<add position="after"><![CDATA[
$data['entry_email_contact'] = $this->language->get('entry_email_contact');
]]></add>
</operation>
-->
<operation>
<search><![CDATA[
if (isset($this->error['email'])) {
]]></search>
<add position="after" offset="4"><![CDATA[
$data['error_email_contact'] = '';
if (isset($this->error['email_contact'])) {
$data['error_email_contact'] = $this->error['email_contact'];
}
]]></add>
</operation>
<operation>
<search><![CDATA[
if (isset($this->request->post['config_email'])) {
]]></search>
<add position="after" offset="4"><![CDATA[
$data['config_email_contact'] = $this->config->get('config_email_contact');
if (isset($this->request->post['config_email_contact'])) {
$data['config_email_contact'] = $this->request->post['config_email_contact'];
}
]]></add>
</operation>
<operation>
<search><![CDATA[
$this->error['email'] = $this->language->get('error_email');
]]></search>
<add position="after" offset="1"><![CDATA[
if ((utf8_strlen($this->request->post['config_email_contact']) > 96) || !preg_match('/^[^\@]+@.*.[a-z]{2,15}$/i', $this->request->post['config_email_contact'])) {
$this->error['email_contact'] = $this->language->get('error_email_contact');
}
]]></add>
</operation>
</file>
<file path="admin/view/template/setting/setting.twig">
<operation>
<search><![CDATA[
<input type="text" name="config_email"
]]></search>
<add position="after" offset="4"><![CDATA[
<div class="form-group required">
<label class="col-sm-2 control-label" for="input-email_contact">{{ entry_email_contact }}</label>
<div class="col-sm-10">
<input type="text" name="config_email_contact" value="{{ config_email_contact }}" placeholder="{{ entry_email_contact }}" id="input-email-contact" class="form-control" />
{% if error_email_contact %}
<div class="text-danger">{{ error_email_contact }}</div>
{% endif %}
</div>
</div>
]]></add>
</operation>
</file>
<!--
Catalog > Controller > Information > Contact
-->
<file path="catalog/controller/information/contact.php">
<operation>
<search><![CDATA[
$mail->setTo($this->config->get('config_email'));
]]></search>
<add position="replace"><![CDATA[
$mail->setTo($this->config->get('config_email_contact'));
]]></add>
</operation>
</file>