@extends('admin.layouts.master-soyuz') @section('title', __('Edit Flash Deal | ')) @section('body') @component('admin.component.breadcumb', ['secondaryactive' => 'active']) @slot('heading'){{ __('Flash Deals') }}@endslot @slot('menu1'){{ __('Flash Deals') }}@endslot @slot('menu2'){{ __('Edit') }}@endslot @slot('button')
{{ __('Back to all') }}
@endslot @endcomponent @php $startVal = $deal->start_date && strtotime($deal->start_date) > 0 ? date('Y-m-d\TH:i', strtotime($deal->start_date)) : date('Y-m-d\TH:i'); $endVal = $deal->end_date && strtotime($deal->end_date) > 0 ? date('Y-m-d\TH:i', strtotime($deal->end_date)) : date('Y-m-d\TH:i', strtotime('+30 days')); $coverPath = $deal->background_image && file_exists(public_path('images/flashdeals/' . $deal->background_image)) ? url('images/flashdeals/' . $deal->background_image) : null; @endphp
@if ($errors->any()) @endif @if(session('success') || session('updated')) @endif
@csrf @method('PUT')
{{-- LEFT — campaign details --}}
{{ __('Campaign Details') }}

{{ __('Active campaigns are visible at /flashdeals/list') }}
{{ __('Banner Image') }}
{{ __('Recommended size: 2000×2000 px (square) or 16:9. JPG / PNG / WebP. Leave empty to keep the current image.') }}
@if($coverPath) @else {{ __('No banner uploaded yet') }} @endif
{{ __('Products in this campaign') }}
{{ __('Use Add to insert a new row, Remove to drop one') }}
@php $items = $deal->saleitems ?? collect(); @endphp @if($items->count()) @foreach($items as $item) @php $isVariant = !empty($item->product_id); $label = $isVariant ? (optional(optional($item->variant)->products)->name ? optional($item->variant->products)->name . ' (' . variantname($item->variant) . ')' : 'N/A') : (optional($item->simple_product)->product_name ?? 'N/A'); $idVal = $isVariant ? $item->product_id : $item->simple_product_id; @endphp @endforeach @else @endif
{{ __('Product') }} {{ __('Discount') }} {{ __('Type') }} {{ __('Actions') }}
%
%
{{-- RIGHT — sticky save card + tips --}}
{{ __('Save Changes') }}

{{ __('Review the campaign details, banner, and product list. Click Update to save.') }}

{{ __('Cancel') }} @if($deal->status == 1) {{ __('Preview on storefront') }} @endif
{{ __('Tips') }}
  • • {{ __('"Fixed" applies the same discount to every buyer.') }}
  • • {{ __('"Up to" picks a random discount between 0 % and the value set, per session.') }}
  • • {{ __('Deals with a past End Date show as Ended on the storefront but stay accessible.') }}
  • • {{ __('Status off keeps the campaign hidden without deleting any data.') }}
@endsection @section('custom-script') @endsection