2 回答
TA贡献1868条经验 获得超4个赞
尝试运行以下命令:
<html>
<head></head>
<body>
<-- Other html code -->
<?php
foreach($discounts as $discount) {
echo $discount['quantity'] . ' or more '. $discount['price'] .'<br>';
}
?>
<-- Other html code -->
</body>
</html>
TA贡献1827条经验 获得超8个赞
在此处更改
public function getProductDiscounts($product_id) {
$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "product_discount WHERE product_id = '" . (int)$product_id . "' AND customer_group_id = '" . (int)$this->config->get('config_customer_group_id') . "' AND quantity >= 0 AND ((date_start = '0000-00-00' OR date_start < NOW()) AND (date_end = '0000-00-00' OR date_end > NOW())) ORDER BY quantity ASC, priority ASC, price ASC");
return $query->rows;
}
请AND quantity > 1 改为AND quantity >= 0
- 2 回答
- 0 关注
- 231 浏览
添加回答
举报