显示添加到购物车到某些客户组

时间:2018-07-12 16:08:24

标签: php opencart shopping-cart

我需要为所有客户隐藏“添加到购物车”按钮,并且仅显示给某些组。我有一个扩展程序,可以为某些客户群体隐藏产品,但是我只想隐藏“添加到购物车”按钮。我怎样才能做到这一点?我正在使用的扩展程序进行了以下更改以隐藏产品:

<file name="catalog/model/catalog/product.php">
    <operation>
        <search position="replace"><![CDATA[m.name AS manufacturer,]]></search>
        <add trim="true"><![CDATA[
        (SELECT name FROM " . DB_PREFIX . "manufacturer m LEFT JOIN " . DB_PREFIX . "rcg_manufacturer rcgm ON (m.manufacturer_id = rcgm.manufacturer_id) WHERE m.manufacturer_id = p.manufacturer_id AND (rcgm.customer_group_id = '' OR (FIND_IN_SET (" . ($this->customer->isLogged() ? (int)$this->customer->getGroupId() : '0') . ", rcgm.customer_group_id)))) AS manufacturer,
        ]]></add>
    </operation>
    <operation>
        <search position="replace"><![CDATA[LEFT JOIN " . DB_PREFIX . "product_to_store p2s ON (p.product_id = p2s.product_id)]]></search>
        <add trim="true"><![CDATA[
        LEFT JOIN " . DB_PREFIX . "rcg_product rcgp ON (p.product_id = rcgp.product_id) LEFT JOIN " . DB_PREFIX . "product_to_store p2s ON (p.product_id = p2s.product_id) 
        ]]></add>
    </operation>
    <operation>
        <search position="replace"><![CDATA[p.status = '1']]></search>
        <add trim="true"><![CDATA[
        p.status = '1' AND (rcgp.customer_group_id = '' OR (FIND_IN_SET (" . ($this->customer->isLogged() ? (int)$this->customer->getGroupId() : '0') . ", rcgp.customer_group_id)))
        ]]></add>
    </operation>
</file>

不久前我开始使用Open Cart,但我不知道该怎么做。

0 个答案:

没有答案