@php $imageURL = ImageOS::photo($promotion->image ?? '', config('file.THUMB_M.width')); $happyHourBegin = $promotion->happy_hours_begin ?? 0; $happyHourBeginHH = (int)($happyHourBegin/60); $happyHourBeginMM = (($happyHourBegin-$happyHourBeginHH) > 0) ? ($happyHourBegin-($happyHourBeginHH*60)) : ''; if($happyHourBegin > 0) { $happyHourBeginHH = str_pad($happyHourBeginHH,2,'0',STR_PAD_LEFT); $happyHourBeginMM = str_pad($happyHourBeginMM,2,'0',STR_PAD_LEFT); } $happyHourEnd = $promotion->happy_hours_end ?? 0; $happyHourEndHH = (int)($happyHourEnd/60); $happyHourEndMM = (($happyHourEnd-$happyHourEndHH) > 0) ? ($happyHourEnd-($happyHourEndHH*60)) : ''; if($happyHourEnd > 0) { $happyHourEndHH = str_pad($happyHourEndHH,2,'0',STR_PAD_LEFT); $happyHourEndMM = str_pad($happyHourEndMM,2,'0',STR_PAD_LEFT); } $rulesNGifts = $promotion->rules ?? []; @endphp
{{trans('admin::promotion.name.label')}}
{{$promotion->name ?? ''}}
{{trans('admin::message.date.range.label')}}
{{Common::date($promotion->starts_at ?? '')}} - @if($promotion->ends_at != '') {{Common::date($promotion->ends_at ?? '')}} @else {{trans('admin::message.date.not_set')}} @endif
@if($happyHourBegin > 0 || $happyHourEnd > 0)
{{trans('admin::promotion.happy_hours.label')}}
@if($happyHourBegin > 0 && $happyHourEnd > 0) {{$happyHourBeginHH . ':' . $happyHourBeginMM}} - {{$happyHourEndHH . ':' . $happyHourEndMM}} @elseif($happyHourBegin > 0) {{$happyHourBeginHH . ':' . $happyHourBeginMM}} - {{$happyHourEndHH . ':59'}} @elseif($happyHourEnd > 0) {{$happyHourEndHH . ':00'}} - {{$happyHourEndHH . ':' . $happyHourEndMM}} @endif
@endif @if(($promotion->dayofweek ?? 0) > 0)
{{trans('admin::promotion.dayofweek.label')}}
@php $dowIdx = 0; @endphp @foreach(trans('admin::promotion.dayofweek.opts') as $k=>$v) @if(((int)($promotion->dayofweek&$k)) > 0) @if($dowIdx > 0){{', '}}@endif{{$v}} @php $dowIdx++; @endphp @endif @endforeach
@endif @if(($promotion->dayofmonth_begin ?? 0) > 0 || ($promotion->dayofmonth_end ?? 0) > 0)
{{trans('admin::promotion.dayofmonth.label')}}
@if($promotion->dayofmonth_begin > 0 && $promotion->dayofmonth_end > 0) {{$promotion->dayofmonth_begin}} - {{$promotion->dayofmonth_end}} @elseif($promotion->dayofmonth_begin > 0) {{$promotion->dayofmonth_begin}} @elseif($promotion->dayofmonth_end > 0) {{$promotion->dayofmonth_end}} @endif
@endif @if(($promotion->frequency ?? 0) > -1)
{{trans('admin::promotion.frequency.label')}}
{{trans('admin::promotion.frequency.opts.' . $promotion->frequency)}}
@endif
{{trans('admin::promotion.only_once.label')}}
{{trans('admin::promotion.only_once.opts.' . ($promotion->only_once ?? 1))}}
{{trans('admin::message.status.label')}}
{{trans('admin::message.status.' . ($promotion->status->code ?? ''))}}
@if(!empty($promotion->description ?? ''))
{{trans('admin::promotion.description.label')}}
{!!$promotion->description ?? ''!!}
@endif

{{trans('admin::promotion.title.rule')}}

@if(count($rulesNGifts) > 0) @foreach($rulesNGifts as $ruleIdx=>$elem) @endforeach @else @endif
{{trans('admin::promotion.rule.gift.buy')}} {{trans('admin::promotion.rule.gift.label')}} {{trans('admin::action.label')}}
@if(!empty($elem->product_name)) @if(($elem->qnty ?? 0) > 0) {{$elem->qnty}} @endif {{$elem->product_name ?? ''}} @endif @if(($elem->gift->discount_amount ?? 0) > 0) {{trans('admin::promotion.rule.gift.discount_amount')}}: {{Common::numberFormat($elem->gift->discount_amount)}} vnđ
@endif @if(($elem->gift->discount_percent ?? 0) > 0) {{trans('admin::promotion.rule.gift.discount_percent')}}: {{$elem->gift->discount_percent}}%
@endif @if(($elem->gift->voucher_id ?? 0) > 0) {{$elem->gift->voucher_qnty ?? 1}} x {{$elem->gift->voucher_name}}
@endif @if(($elem->gift->gift_product_id ?? 0) > 0) {{$elem->gift->gift_product_qnty ?? 1}} x {{$elem->gift->gift_product_name}} @endif
{{trans('admin::promotion.rule.top_action.label')}}: {{Common::numberFormat($elem->top_action)}}
{{trans('admin::promotion.rule.top_order.label')}}: {{Common::numberFormat($elem->top_order)}}
No setting