我正在使用带有期刊主题的opencart。
现在我不再需要'wishlist'和'product compare',所以想要禁用它。
我尝试了很多选项也尝试了以下链接。
1)http://www.opencart.com/index.php?route=extension/extension/info&extension_id=11879
它使用vqmod删除'wishlist'和'product compare'的代码,但它不适用于我的日记主题,它永远不会完全删除这些功能。
那么如何做到这一点请帮助我。
答案 0 :(得分:2)
好的,我刚刚在最近几个小时为此写了一个vqmod。它从“控制器”图层中删除了愿望清单和产品比较功能,并将其从任何主题中删除,这些主题使用默认主题的HTML部分。由于我不知道你的主题(据我所知,你提到的那个是付费主题),你必须自己做必要的修改,实际删除愿望清单并比较'视图中的链接'层。但是,如果您的主题是基于默认主题构建的,则此可能有效。这是:
<?xml version="1.0" encoding="UTF-8"?>
<modification>
<id>Remove Wishlist and Product Compare</id>
<version>1.0</version>
<vqmver>2.4.0</vqmver>
<author>Tibor Besze</author>
<file name="catalog/controller/account/account.php">
<operation error="skip">
<search position="replace"><![CDATA[$this->data['text_wishlist'] = $this->language->get('text_wishlist');]]></search>
<add trim="true"><![CDATA[]]></add>
</operation>
<operation error="skip">
<search position="replace"><![CDATA[$this->data['wishlist'] = $this->url->link('account/wishlist');]]></search>
<add trim="true"><![CDATA[]]></add>
</operation>
</file>
<file path="catalog/controller/account/" name="login.php,logout.php">
<operation error="skip">
<search position="replace"><![CDATA[unset($this->session->data['wishlist']);]]></search>
<add trim="true"><![CDATA[]]></add>
</operation>
</file>
<file name="catalog/controller/account/wishlist.php">
<operation error="skip">
<search position="replace"><![CDATA[public function index() {]]></search>
<add trim="true"><![CDATA[
public function index() {
$this->redirect($this->url->link('error/not_found', '', 'SSL'));
]]></add>
</operation>
<operation error="skip">
<search position="replace"><![CDATA[
public function add() {
]]></search>
<add trim="true"><![CDATA[
public function add() {
$this->redirect($this->url->link('error/not_found', '', 'SSL'));
]]></add>
</operation>
</file>
<file name="catalog/controller/common/footer.php">
<operation error="skip">
<search position="replace"><![CDATA[$this->data['text_wishlist'] = $this->language->get('text_wishlist');]]></search>
<add trim="true"><![CDATA[]]></add>
</operation>
<operation error="skip">
<search position="replace"><![CDATA[$this->data['wishlist'] = $this->url->link('account/wishlist', '', 'SSL');]]></search>
<add trim="true"><![CDATA[]]></add>
</operation>
</file>
<file name="catalog/controller/common/header.php">
<operation error="skip">
<search position="replace"><![CDATA[$this->data['text_wishlist'] = sprintf($this->language->get('text_wishlist'), (isset($this->session->data['wishlist']) ? count($this->session->data['wishlist']) : 0));]]></search>
<add trim="true"><![CDATA[]]></add>
</operation>
<operation error="skip">
<search position="replace"><![CDATA[$this->data['wishlist'] = $this->url->link('account/wishlist', '', 'SSL');]]></search>
<add trim="true"><![CDATA[]]></add>
</operation>
</file>
<file name="catalog/controller/module/account.php">
<operation error="skip">
<search position="replace"><![CDATA[$this->data['text_wishlist'] = $this->language->get('text_wishlist');]]></search>
<add trim="true"><![CDATA[]]></add>
</operation>
<operation error="skip">
<search position="replace"><![CDATA[$this->data['wishlist'] = $this->url->link('account/wishlist');]]></search>
<add trim="true"><![CDATA[]]></add>
</operation>
</file>
<file path="catalog/controller/product/" name="category.php,manufacturer.php,search.php,special.php">
<operation error="skip">
<search position="replace"><![CDATA[$this->data['button_wishlist'] = $this->language->get('button_wishlist');]]></search>
<add trim="true"><![CDATA[]]></add>
</operation>
<operation error="skip">
<search position="replace"><![CDATA[$this->data['text_compare'] = sprintf($this->language->get('text_compare'), (isset($this->session->data['compare']) ? count($this->session->data['compare']) : 0));]]></search>
<add trim="true"><![CDATA[]]></add>
</operation>
<operation error="skip">
<search position="replace"><![CDATA[$this->data['button_compare'] = $this->language->get('button_compare');]]></search>
<add trim="true"><![CDATA[]]></add>
</operation>
<operation error="skip">
<search position="replace"><![CDATA[$this->data['compare'] = $this->url->link('product/compare');]]></search>
<add trim="true"><![CDATA[]]></add>
</operation>
</file>
<file name="catalog/controller/product/product.php">
<operation error="skip">
<search position="replace"><![CDATA[$this->data['button_wishlist'] = $this->language->get('button_wishlist');]]></search>
<add trim="true"><![CDATA[]]></add>
</operation>
<operation error="skip">
<search position="replace"><![CDATA[$this->data['button_compare'] = $this->language->get('button_compare');]]></search>
<add trim="true"><![CDATA[]]></add>
</operation>
</file>
<file name="catalog/view/theme/*/template/account/account.tpl">
<operation error="skip">
<search position="replace"><![CDATA[<li><a href="<?php echo $wishlist; ?>"><?php echo $text_wishlist; ?></a></li>]]></search>
<add trim="true"><![CDATA[]]></add>
</operation>
</file>
<file name="catalog/view/theme/*/template/common/footer.tpl">
<operation error="skip">
<search position="replace"><![CDATA[<li><a href="<?php echo $wishlist; ?>"><?php echo $text_wishlist; ?></a></li>]]></search>
<add trim="true"><![CDATA[]]></add>
</operation>
</file>
<file name="catalog/view/theme/*/template/common/header.tpl">
<operation error="skip">
<search position="replace"><![CDATA[<a href="<?php echo $wishlist; ?>" id="wishlist-total"><?php echo $text_wishlist; ?></a>]]></search>
<add trim="true"><![CDATA[]]></add>
</operation>
</file>
<file name="catalog/view/theme/*/template/module/account.tpl">
<operation error="skip">
<search position="replace"><![CDATA[<li><a href="<?php echo $wishlist; ?>"><?php echo $text_wishlist; ?></a></li>]]></search>
<add trim="true"><![CDATA[]]></add>
</operation>
</file>
<file path="catalog/view/theme/*/template/product/" name="category.tpl,special.tpl,search.tpl,manufacturer_info.tpl">
<operation error="skip">
<search position="replace"><![CDATA[<div class="wishlist"><a onclick="addToWishList('<?php echo $product['product_id']; ?>');"><?php echo $button_wishlist; ?></a></div>]]></search>
<add trim="true"><![CDATA[]]></add>
</operation>
<operation error="skip">
<search position="replace"><![CDATA[html += ' <div class="wishlist">' + $(element).find('.wishlist').html() + '</div>';]]></search>
<add trim="true"><![CDATA[]]></add>
</operation>
<operation error="skip">
<search position="replace"><![CDATA[html += '<div class="wishlist">' + $(element).find('.wishlist').html() + '</div>';]]></search>
<add trim="true"><![CDATA[]]></add>
</operation>
<operation error="skip">
<search position="replace"><![CDATA[<div class="product-compare"><a href="<?php echo $compare; ?>" id="compare-total"><?php echo $text_compare; ?></a></div>]]></search>
<add trim="true"><![CDATA[]]></add>
</operation>
<operation error="skip">
<search position="replace"><![CDATA[<div class="compare"><a onclick="addToCompare('<?php echo $product['product_id']; ?>');"><?php echo $button_compare; ?></a></div>]]></search>
<add trim="true"><![CDATA[]]></add>
</operation>
<operation error="skip">
<search position="replace"><![CDATA[html += ' <div class="compare">' + $(element).find('.compare').html() + '</div>';]]></search>
<add trim="true"><![CDATA[]]></add>
</operation>
<operation error="skip">
<search position="replace"><![CDATA[html += '<div class="compare">' + $(element).find('.compare').html() + '</div>';]]></search>
<add trim="true"><![CDATA[]]></add>
</operation>
</file>
<file name="catalog/view/theme/*/template/product/product.tpl">
<operation error="skip">
<search position="replace"><![CDATA[<span class="links"><a onclick="addToWishList('<?php echo $product_id; ?>');"><?php echo $button_wishlist; ?></a><br />]]></search>
<add trim="true"><![CDATA[]]></add>
</operation>
<operation error="skip">
<search position="replace"><![CDATA[<a onclick="addToCompare('<?php echo $product_id; ?>');"><?php echo $button_compare; ?></a></span>]]></search>
<add trim="true"><![CDATA[]]></add>
</operation>
<operation error="skip">
<search position="replace"><![CDATA[<span> <?php echo $text_or; ?> </span>]]></search>
<add trim="true"><![CDATA[]]></add>
</operation>
</file>
</modification>
将其放入.xml文件中,然后将其复制到vqmod / xml文件夹中。享受!
答案 1 :(得分:0)
如果您正在使用日记,则可以在日记控制面板中执行此操作。
转到期刊 - &gt;设置 - &gt;目录模式
从这里,您可以在各个地方打开或关闭心愿单并比较按钮。