rabin 2 years ago
parent
commit
33f316176d
1 changed files with 16 additions and 0 deletions
  1. 16 0
      app/shop/src/Buy.php

+ 16 - 0
app/shop/src/Buy.php

@@ -104,6 +104,22 @@ class Buy extends Core
 			foreach ($this->data['cart'] as $k => $v) {
 				$this->data['cart'][$k]['goods'] = Dever::load('goods/lib/info')->getPayInfo($v['goods_id'], $v['sku_id']);
 
+				$w = array();
+	            $w['goods_id'] = $v['goods_id'];
+	            $w['sku_id'] = $v['sku_id'];
+	            $w['shop_id'] = $this->shop_id;
+	            $goods_sku = Dever::db('shop/goods_sku')->find($w);
+	            if ($goods_sku) {
+	                if (isset($goods_sku['price_id']) && $goods_sku['price_id'] > 0) {
+	                    $price_template = Dever::load('price/lib/data')->get($v['goods_id'], $v['goods_id'], $goods_sku['price_id']);
+	                    if ($price_template) {
+	                        if ($price_template['price_sell'] && $price_template['price_sell'] > 0) {
+	                            $this->data['cart'][$k]['goods']['price'] = $price_template['price_sell'];
+	                        }
+	                    }
+	                }
+	            }
+
 				if (isset($this->data['cart'][$k]['goods']['sku_id'])) {
 					$this->data['cart'][$k]['price_id'] = $this->data['cart'][$k]['goods']['sku_id'];
 				}