Exemplo n.º 1
0
 public function show(Product $product, VariantManager $variantManager, AttributeManager $attributeManager)
 {
     if (!$product->isActive()) {
         abort(404);
     }
     $seller = $product->getSeller();
     $attributes = $attributeManager->getAttributesForProduct($product);
     $variants = $variantManager->getVariantRepository()->whereProduct($product)->with('attributeOptions')->findAll();
     // for stock calculation
     $product->setRelation('variants', $variants);
     return view('product::__front.products.show', compact('seller', 'product', 'attributes', 'variants'));
 }