我不知道到底是有一個變量已經在智者設置或沒有,但你可以定義客戶的目標客戶變量: 查找控制器/正面/ ProductController.php文件,找到方法assignPriceAndTax和它結束時,你會發現一些與此類似:
$this->context->smarty->assign(array(
'quantity_discounts' => $this->formatQuantityDiscounts($quantity_discounts, $product_price, (float)$tax, $ecotax_tax_amount),
'ecotax_tax_inc' => $ecotax_tax_amount,
'ecotax_tax_exc' => Tools::ps_round($this->product->ecotax, 2),
'ecotaxTax_rate' => $ecotax_rate,
'productPriceWithoutEcoTax' => (float)$product_price_without_eco_tax,
'group_reduction' => $group_reduction,
'no_tax' => Tax::excludeTaxeOption() || !$this->product->getTaxesRate($address),
'ecotax' => (!count($this->errors) && $this->product->ecotax > 0 ? Tools::convertPrice((float)$this->product->ecotax) : 0),
'tax_enabled' => Configuration::get('PS_TAX') && !Configuration::get('AEUC_LABEL_TAX_INC_EXC'),
'customer_group_without_tax' => Group::getPriceDisplayMethod($this->context->customer->id_default_group),
));
添加到這個陣列
'customer_object' => $this->context->customer,
此變量,您可以在產品頁面上使用。 您可以用同樣的方法來關閉這些按鈕對您網站上的所有「團購窗口」。
好,但該變量保存客戶羣的用戶?我從未在prestashop中使用過自定義變量。你能給我更多的細節嗎? – albera4