我一直在寻找一个模块,允许客户仍然能够购买一个项目,如果库存水平是0。此功能在OpenCart 1.5.x中可用吗?
我已经将产品设置为2-3天,但在网站前端,它仍然显示为缺货的产品。有没有办法提醒客户2-3天的延迟,并仍然允许客户购买?
发布于 2012-07-13 23:35:25
首先,您需要更改防止脱销商品结帐的函数。转到catalog/controller/checkout/checkout.php并更改
public function index() {
// Validate cart has products and has stock.
if ((!$this->cart->hasProducts() && empty($this->session->data['vouchers'])) || (!$this->cart->hasStock() && !$this->config->get('config_stock_checkout'))) {
$this->redirect($this->url->link('checkout/cart'));
}至
public function index() {
// Validate cart has products and has stock.
if (!$this->cart->hasProducts() && empty($this->session->data['vouchers'])) {
$this->redirect($this->url->link('checkout/cart'));
}我不记得它是否会阻止你将它添加到购物车中,所以请让我知道。祝你好运,大卫!
更新
要在产品页面上更改“脱销”,我已经用商店中的设置自己进行了更改,所以如果对您不起作用,您可以进入catalog/controller/ product //Product.php,在这里您可以看到
if ($product_info['quantity'] <= 0) {
$this->data['stock'] = $product_info['stock_status'];
} elseif ($this->config->get('config_stock_display')) {
$this->data['stock'] = $product_info['quantity'];
} else {
$this->data['stock'] = $this->language->get('text_instock');
}更改为:
if ($product_info['quantity'] <= 0) {
$this->data['stock'] = "2-3 Days";
} elseif ($this->config->get('config_stock_display')) {
$this->data['stock'] = $product_info['quantity'];
} else {
$this->data['stock'] = $this->language->get('text_instock');
}将这些括号中的文本更改为适合您的短语。
发布于 2012-07-10 19:50:48
这是作为标准构建到OpenCart中的特性。该设置应位于设置页面的“选项”选项卡上
发布于 2012-10-05 18:58:06
第一次查找
if (!$option_value['subtract'] || ($option_value['quantity'] > 0)) {并替换为
if (1==1 || !$option_value['subtract'] || ($option_value['quantity'] > 0)) {https://stackoverflow.com/questions/11409315
复制相似问题