Opening Times and Store Comment
Posted: Thu Jan 08, 2015 9:07 am
In catalog/controller/information/contact.php, the store opening times and store comment are retrieved from the database (at lines 95 and 96) with:
This doesn't work in a multi-store setup, as only the values for the default store are retrieved.
In admin/controller/setting/setting.php, at lines 531 to 541, we have:
And, in the template file (admin/view/template/setting/setting.tpl) at lines 112 and 118, we have:
and
Which sets the opening times and store comment for the default store but for any other store, the values are not set properly.
In admin/controller/setting/store.php, at lines 537 to 551, we have:
And in the template file (admin/view/template/setting/store.tpl), at lines 124 and 130, we have:
and
The opening times and comment for a sub-store will not display after saving, as the values be tested for are "$store_info['config_open']" and "$store_info['config_comment'}". Since the values being posted back to the form (and saved in the settings table) are called "open" and "comment", not "config_open" and "config_comment". And, since it is the "config_open" and "config_comment" values that are being retrieved on the front-end, only those for the default store will display.
To Fix
In admin/controller/setting/store.php, replace lines 537 to 551 with:
And in the template file (admin/view/template/setting/store.tpl), replace lines 124 and 130 with:
and
respectively.
Code: Select all
$data['open'] = nl2br($this->config->get('config_open'));
$data['comment'] = $this->config->get('config_comment');
In admin/controller/setting/setting.php, at lines 531 to 541, we have:
Code: Select all
if (isset($this->request->post['config_open'])) {
$data['config_open'] = $this->request->post['config_open'];
} else {
$data['config_open'] = $this->config->get('config_open');
}
if (isset($this->request->post['config_comment'])) {
$data['config_comment'] = $this->request->post['config_comment'];
} else {
$data['config_comment'] = $this->config->get('config_comment');
}
Code: Select all
<textarea name="config_open" rows="5" placeholder="<?php echo $entry_open; ?>" id="input-open" class="form-control"><?php echo $config_open; ?></textarea>
Code: Select all
<textarea name="config_comment" rows="5" placeholder="<?php echo $entry_comment; ?>" id="input-comment" class="form-control"><?php echo $config_comment; ?></textarea>
In admin/controller/setting/store.php, at lines 537 to 551, we have:
Code: Select all
if (isset($this->request->post['open'])) {
$data['open'] = $this->request->post['open'];
} elseif (isset($store_info['config_open'])) {
$data['open'] = $store_info['open'];
} else {
$data['open'] = '';
}
if (isset($this->request->post['comment'])) {
$data['comment'] = $this->request->post['comment'];
} elseif (isset($store_info['config_comment'])) {
$data['comment'] = $store_info['comment'];
} else {
$data['comment'] = '';
}
Code: Select all
<textarea name="open" rows="5" placeholder="<?php echo $entry_open; ?>" id="input-open" class="form-control"><?php echo $open; ?></textarea>
Code: Select all
<textarea name="comment" rows="5" placeholder="<?php echo $entry_comment; ?>" id="input-comment" class="form-control"><?php echo $comment; ?></textarea>
To Fix
In admin/controller/setting/store.php, replace lines 537 to 551 with:
Code: Select all
if (isset($this->request->post['config_open'])) {
$data['config_open'] = $this->request->post['config_open'];
} elseif (isset($store_info['config_open'])) {
$data['config_open'] = $store_info['config_open'];
} else {
$data['config_open'] = '';
}
if (isset($this->request->post['config_comment'])) {
$data['config_comment'] = $this->request->post['config_comment'];
} elseif (isset($store_info['config_comment'])) {
$data['config_comment'] = $store_info['config_comment'];
} else {
$data['config_comment'] = '';
}
Code: Select all
<textarea name="config_open" rows="5" placeholder="<?php echo $entry_open; ?>" id="input-open" class="form-control"><?php echo $config_open; ?></textarea>
Code: Select all
<textarea name="config_comment" rows="5" placeholder="<?php echo $entry_comment; ?>" id="input-comment" class="form-control"><?php echo $config_comment; ?></textarea>