【发布时间】:2019-02-28 00:03:43
【问题描述】:
Opencart 版本 2.3.0.2 - 当前使用 Vqmod(如下)在免费送货活动时隐藏其他送货。我希望对其进行调整以隐藏特定客户组 = '2" 的免费送货(即批发客户不会看到\被允许免费送货)。
<file path="catalog/model/extension/shipping/*.php">
<operation error="skip">
<search><![CDATA[if ($status) {]]></search>
<add position="before"><![CDATA[
if (get_class($this)!='ModelExtensionShippingFree') {
if (($this->config->get('free_status') == 1) && (float)$this->cart->getTotal() >= $this->config->get('free_total')) {
$status = false;
}
}
]]></add>
【问题讨论】:
-
你可以使用这个免费的扩展:opencart.com/index.php?route=marketplace/extension/…
-
@KB我发布的代码有效地完成了免费扩展的作用,我正在寻找一种方法让它只适用于默认客户(组 ID = 1)而不是批发客户(组 ID = 2)
-
对于您的运输条件后的客户组添加此条件:
if ($this->session->data['customer_group_id'] == 1) { $status = true; } else { $status = false; } -
@K.B.不幸的是,在这种情况下,您的建议不起作用
-
@K.B.谢谢你为我指出了正确的方向,使用 elseif 设法到达那里
标签: opencart opencart2.3 vqmod