Add Landing Page Section and Update Product Schema: Introduced a new LandingPageSection class to manage the layout and fields for the product landing page. Updated the ProductForm to include this new section, enhancing the product management interface. Added migration for landing_page_data in the products table and implemented localization for new fields in English and Turkish language files. Created a new landing Blade view to render the landing page dynamically, improving user experience and modularity.

This commit is contained in:
Ümit Tunç
2026-01-02 20:58:18 +03:00
parent 89eb9f5c4e
commit 97092dd793
10 changed files with 720 additions and 13 deletions
@@ -68,10 +68,17 @@ class ProductController extends Controller
'description' => \Str::limit(strip_tags($product->translate('content')), 160),
];
// Use custom view template if specified
if ($product->view_template && view()->exists($product->view_template)) {
return view($product->view_template, compact('product', 'settings', 'renderedHeader', 'renderedFooter', 'meta'));
}
// Use landing page template if landing_page_data exists and product type is 'product'
if ($product->type === 'product' && !empty($product->landing_page_data)) {
return view('front.products.landing', compact('product', 'settings', 'renderedHeader', 'renderedFooter', 'meta'));
}
// Default view
return view('front.products.show', compact('product', 'settings', 'renderedHeader', 'renderedFooter', 'meta'));
}
}