| Conditions | 2 |
| Paths | 2 |
| Total Lines | 15 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 10 | public function page($id,$product_item_id = null){ |
||
| 11 | $product = Product::find($id); |
||
| 12 | if($product_item_id == null){ |
||
| 13 | return redirect()->route('shop.single.product',[$product->id,$product->items->first()->id]); |
||
| 14 | } |
||
| 15 | |||
| 16 | $details_fields = Template::getDetailsFields($product,$product_item_id); |
||
| 17 | $configuration_fields = Template::getConfigurationFields($product_item_id); |
||
| 18 | $btn_cart = Template::buttonCart($product_item_id); |
||
| 19 | $price = Product::getPrice($product_item_id); |
||
| 20 | $image = Product::getImage($product_item_id); |
||
| 21 | $description = Product::getDescription($product_item_id); |
||
| 22 | $name = Product::getName($product_item_id); |
||
| 23 | |||
| 24 | return view('mongicommerce.pages.single-product',compact('product','details_fields','configuration_fields','btn_cart','price','image','description','name')); |
||
| 25 | } |
||
| 27 |