瀏覽代碼

Fix adding a product with missing price

Johannes Zellner 5 年之前
父節點
當前提交
c51f3c8dba
共有 1 個文件被更改,包括 2 次插入 和 0 次删除
  1. 2 0
      website/DataBase/Price.php

+ 2 - 0
website/DataBase/Price.php

@@ -21,6 +21,8 @@ class Price
 
 	function create($priceset_id, $product_id, $price)
 	{
+		if (!$price) $price = 0;
+
 		$query = "INSERT INTO ".$this->db->price_table." VALUES(0, ".$priceset_id.", '".$product_id."', ".$price.")";
 
 		$this->db->query($query);