@extends('layouts.admin') @section('title', 'Tambah Produk') @section('page-title', 'Tambah Produk') @section('admin_content')
@csrf

Informasi Produk

@error('name')

{{ $message }}

@enderror
@error('category_id')

{{ $message }}

@enderror
Mendukung heading, list, bold, link

Contoh: ## Manfaat, **teks tebal**, - poin manfaat

@include('admin.product._image-manager')

Variasi Produk

@if(old('variation_price')) @foreach(old('variation_price') as $i => $v)
@endforeach @endif
@error('price')

{{ $message }}

@enderror
@error('stock')

{{ $message }}

@enderror
@endsection @section('scripts') @verbatim function toggleVariations() { const checked = document.getElementById('toggle-variations').checked; document.getElementById('variation-section').classList.toggle('hidden', !checked); document.getElementById('global-price-section').classList.toggle('hidden', checked); document.querySelector('input[name="price"]').required = !checked; document.querySelector('input[name="stock"]').required = !checked; } function addVariation() { const container = document.getElementById('variations-container'); const row = document.createElement('div'); row.className = 'variation-row flex gap-3 items-end'; row.innerHTML = `
`; container.appendChild(row); } function removeVariation(btn) { btn.closest('.variation-row').remove(); } @endverbatim @endsection