Wszystko cacy, tylko na samym dole pod napisem "Napisz recenzję" gdy uzytkownik nie jest zalogowany powinna wyskoczyc wiadomosc z prosba o zaogowanie a jest puste pole.
Zamieszczam te 2 edytowane pliki oraz instrukcję. Proszę o sprawdzenie tego przez kogoś doświadczonego. Pozdrawiam.
http://comparehost.pl/login.rar
Instrukcja:
- Kod: Zaznacz cały
<modification>
<id>OCA_Login To Review(1.5.x)</id>
<version>2.2</version>
<vqmver>1.0.0</vqmver>
<author>Joel - http://opencartaddons.com - webmaster@opencartaddons.com</author>
<file name="catalog/controller/product/product.php">
<operation>
<search position="after"><![CDATA[$this->data['text_write'] = $this->language->get('text_write');]]></search>
<add><![CDATA[
$this->data['text_login_write'] = sprintf($this->language->get('text_login_write'), $this->url->link('account/login', '', 'SSL'));
$this->data['text_login'] = sprintf($this->language->get('text_welcome'), $this->url->link('account/login', '', 'SSL'), $this->url->link('account/register', '', 'SSL'));
if ($this->customer->isLogged()) {
$this->data['text_username'] = $this->customer->getFirstName() . ' ' . substr($this->customer->getLastName(), 0, 1);
} else {
$this->data['text_username'] = false;
}
]]></add>
</operation>
</file>
<file name="catalog/view/theme/*/template/product/product.tpl">
<operation>
<search position="replace"><![CDATA[<div><img src="catalog/view/theme/default/image/stars-<?php echo $rating; ?>.png" alt="<?php echo $reviews; ?>" /> <a onclick="$('a[href=\'#tab-review\']').trigger('click');"><?php echo $reviews; ?></a> | <a onclick="$('a[href=\'#tab-review\']').trigger('click');"><?php echo $text_write; ?></a></div>]]></search>
<add><![CDATA[
<div><img src="catalog/view/theme/default/image/stars-<?php echo $rating; ?>.png" alt="<?php echo $reviews; ?>" /> <a onclick="$('a[href=\'#tab-review\']').trigger('click');"><?php echo $reviews; ?></a> | <?php if ($this->customer->isLogged()) { ?><a onclick="$('a[href=\'#tab-review\']').trigger('click');"><?php echo $text_write; ?></a><?php } else { echo $text_login_write; } ?></div>
]]></add>
</operation>
<operation>
<search position="after"><![CDATA[<h2 id="review-title"><?php echo $text_write; ?></h2>]]></search>
<add><![CDATA[
<?php if ($this->customer->isLogged()) { ?>
]]></add>
</operation>
<operation>
<search position="before" index="2" offset="2"><![CDATA[<?php if ($products) { ?>]]></search>
<add><![CDATA[
<?php } else { echo $text_login_write; } ?>
]]></add>
</operation>
<operation>
<search position="replace"><![CDATA[<b><?php echo $entry_name; ?></b><br />]]></search>
<add><![CDATA[
]]></add>
</operation>
<operation>
<search position="replace"><![CDATA[<input type="text" name="name" value="" />]]></search>
<add><![CDATA[
<input type="hidden" name="name" value="<?php echo $text_username; ?>" />
]]></add>
</operation>
</file>
<file name="catalog/language/*/product/product.php">
<operation>
<search position="after"><![CDATA[$_['text_write']]]></search>
<add><![CDATA[
$_['text_login_write'] = 'Please <a href="%s">Login</a> To Review This Product';
]]></add>
</operation>
</file>
<file name="admin/controller/catalog/review.php">
<operation>
<search position="before"><![CDATA['action' => $action]]></search>
<add><![CDATA[
'href' => $this->url->link('sale/order', 'token=' . $this->session->data['token'] . '&filter_customer=' . $result['author'] . $url, 'SSL'),
]]></add>
</operation>
</file>
<file name="admin/view/template/catalog/review_list.tpl">
<operation>
<search position="replace"><![CDATA[<td class="left"><?php echo $review['author']; ?></td>]]></search>
<add><![CDATA[
<td class="left"><a href="<?php echo $review['href']; ?>"><?php echo $review['author']; ?></a></td>
]]></add>
</operation>
</file>
</modification>