@php echo ''; @endphp {{ config('app.name') }} {{ url('/') }} Google Merchant Feed @foreach($items as $item) @php $text = str_replace(' ', ' ', preg_replace('/\s+/', ' ', strip_tags($item->details))); $details = \Illuminate\Support\Str::limit($text, 5000); $title = \Illuminate\Support\Str::limit($item->name, 150) ; // Tarih mantığı (Stok yoksa 8 hafta) $futureDate = ($item->stock <= 0) ? date('c', strtotime('+8 weeks')) : null; // Kargo etiketi $shippingLabel = ($item->stock > 0) ? 'Standardversand' : 'Sonderanfertigung'; // --- YENİ EKLENEN MANTIK: BARKOD VE MARKA --- // Eğer veritabanınızda barkod sütunu varsa 'ean_code' kısmını ona göre değiştirin. // Yoksa null kabul edip identifier_exists: no göndereceğiz. $gtin = $item->ean_code ?? null; $sku = $item->sku ?? $item->id; $brand = $item->brand->name ?? null; // Google kuralı: Barkod yoksa 'identifier_exists' NO olmalı. $identifierExists = ($gtin) ? 'yes' : 'no'; $categories = $item->categories; $taxonomy = null; if ($categories->count() > 0) { foreach ($categories as $category) { if ($category->taxonomy) { $categoryName = $category->name; $taxonomy = $category->taxonomy; break;; } } } @endphp {{ $item->id }} HANSE01 {{ $title }} {{-- SECURITY FIX: XML injection önlemek için escape kullan --}} {{ strip_tags($details) }} {{ URL::to(Helper::getFullSlugPath($item->slug)) }} {{-- Stok Durumu --}} @if($item->stock > 0) in_stock @else preorder {{ $futureDate }} @endif {{ url('core/public/storage/images/' . $item->photo) }} @if($item->galleries->count() > 0) @foreach($item->galleries->take(10) as $gallery) {{ url('core/public/storage/images/' . $gallery->photo) }} @endforeach @endif {{ number_format( PriceHelper::setConvertPrice($item->discount_price), 2, '.', '') }} EUR @if($taxonomy) {{$taxonomy }} @endif {{-- Ürün Türü: Kendi kategori ağacınızı gönderir (Faydalıdır) --}} @foreach( $categories as $category ) {{ $category->name }} @if(!$loop->last) > @endif @endforeach new {{-- --- KRİTİK BİLGİLER BURADA BAŞLIYOR --- --}} {{ $brand }} {{-- MPN: Üretici parça numarası (Genelde SKU kullanılır) --}} {{ $sku }} @if($gtin) {{-- Eğer barkod varsa gönder--}} {{ $gtin }} yes @else {{-- Barkod yoksa Google'a 'barkodsuz ürün' olduğunu bildir--}} no @endif DE Standard 0 EUR {{ $shippingLabel }} @endforeach