Conditions | 3 |
Paths | 3 |
Total Lines | 21 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
33 | public function checkVisibility(Product $Product) |
||
34 | { |
||
35 | $is_admin = $this->session->has('_security_admin'); |
||
36 | |||
37 | // 管理ユーザの場合はステータスやオプションにかかわらず閲覧可能. |
||
38 | if (!$is_admin) { |
||
39 | // 在庫なし商品の非表示オプションが有効な場合. |
||
40 | // if ($this->BaseInfo->isOptionNostockHidden()) { |
||
41 | // if (!$Product->getStockFind()) { |
||
42 | // return false; |
||
43 | // } |
||
44 | // } |
||
45 | // 公開ステータスでない商品は表示しない. |
||
46 | if ($Product->getStatus()->getId() !== ProductStatus::DISPLAY_SHOW) { |
||
47 | return false; |
||
48 | } |
||
49 | } |
||
50 | |||
51 | return true; |
||
52 | |||
53 | } |
||
54 | |||
63 |