修复预售购物车不显示下架商品的bug
Code Review By Rock Zhang
Showing
2 changed files
with
15 additions
and
1 deletions
@@ -12,6 +12,14 @@ | @@ -12,6 +12,14 @@ | ||
12 | </div> | 12 | </div> |
13 | {{/if}} | 13 | {{/if}} |
14 | 14 | ||
15 | +{{#if offShelveGoods}} | ||
16 | + <div class="invalid-goods"> | ||
17 | + {{# offShelveGoods}} | ||
18 | + {{> cart/good}} | ||
19 | + {{/ offShelveGoods}} | ||
20 | + </div> | ||
21 | +{{/if}} | ||
22 | + | ||
15 | {{#if freebieOrAdvanceBuy}} | 23 | {{#if freebieOrAdvanceBuy}} |
16 | <ul class="freebie-and-advance-buy"> | 24 | <ul class="freebie-and-advance-buy"> |
17 | {{#if freebie}} | 25 | {{#if freebie}} |
@@ -773,7 +773,7 @@ class CartModel | @@ -773,7 +773,7 @@ class CartModel | ||
773 | 773 | ||
774 | do { | 774 | do { |
775 | // 数据为空时返回空的标志 | 775 | // 数据为空时返回空的标志 |
776 | - if (empty($data['goods_list']) && empty($data['sold_out_goods_list'])) { | 776 | + if (empty($data['goods_list']) && empty($data['sold_out_goods_list']) && empty($data['off_shelves_goods_list'])) { |
777 | break; | 777 | break; |
778 | } | 778 | } |
779 | 779 | ||
@@ -800,6 +800,12 @@ class CartModel | @@ -800,6 +800,12 @@ class CartModel | ||
800 | $result['notValidGoods'] = $notValidGoods; | 800 | $result['notValidGoods'] = $notValidGoods; |
801 | } | 801 | } |
802 | 802 | ||
803 | + // 下架的商品列表 | ||
804 | + $offShelveGoods = Helpers::formatCartGoods($data['off_shelves_goods_list'], $isAdvanceCart, false); | ||
805 | + if (!empty($offShelveGoods)) { | ||
806 | + $result['offShelveGoods'] = $offShelveGoods; | ||
807 | + } | ||
808 | + | ||
803 | // 赠品和加价购商品 | 809 | // 赠品和加价购商品 |
804 | if (count($data['gift_list']) || count($data['price_gift'])) { | 810 | if (count($data['gift_list']) || count($data['price_gift'])) { |
805 | $result['freebieOrAdvanceBuy'] = true; | 811 | $result['freebieOrAdvanceBuy'] = true; |
-
Please register or login to post a comment