do modifiy fixes bug refs YW-1347
Showing
1 changed file
with
3 additions
and
1 deletions
@@ -211,12 +211,14 @@ class DetailModel | @@ -211,12 +211,14 @@ class DetailModel | ||
211 | // 悬浮的购物车信息 | 211 | // 悬浮的购物车信息 |
212 | $result['cartInfo'] = array( | 212 | $result['cartInfo'] = array( |
213 | 'cartUrl' => Helpers::url('/cart/index/index', null), // 购物车链接 | 213 | 'cartUrl' => Helpers::url('/cart/index/index', null), // 购物车链接 |
214 | - 'addToCartUrl' => Helpers::url('/product/buy_' . $productId . '_' . $goodsId . '.html'), // 加入购物车链接 | ||
215 | 'numInCart' => 0, | 214 | 'numInCart' => 0, |
216 | 'goodsInstore' => $baseInfo['storage'], // 库存量 | 215 | 'goodsInstore' => $baseInfo['storage'], // 库存量 |
217 | 'soldOut' => $baseInfo['storage'] == 0, // 已售磬 | 216 | 'soldOut' => $baseInfo['storage'] == 0, // 已售磬 |
218 | 'notForSale' => $baseInfo['attribute'] == 2, // 非卖品 | 217 | 'notForSale' => $baseInfo['attribute'] == 2, // 非卖品 |
219 | ); | 218 | ); |
219 | + if (!$result['cartInfo']['soldOut'] && !$result['cartInfo']['notForSale']) { | ||
220 | + $result['cartInfo']['addToCartUrl'] = Helpers::url('/product/buy_' . $productId . '_' . $goodsId . '.html'); // 加入购物车链接 | ||
221 | + } | ||
220 | 222 | ||
221 | // 是否收藏 | 223 | // 是否收藏 |
222 | $result['isCollect'] = false; | 224 | $result['isCollect'] = false; |
-
Please register or login to post a comment