Voucher Online Rules : {{ $deals['promo_type']??'' }}
@if ( !empty($deals['product_rule'])
&& ((isset($deals['deals_promotion_product_discount_rules']['is_all_product'])
&& $deals['deals_promotion_product_discount_rules']['is_all_product'] == 0)
|| !empty($deals['deals_promotion_tier_discount_rules'])
|| !empty($deals['deals_promotion_buyxgety_rules'])
|| (isset($deals['deals_promotion_discount_bill_rules']['is_all_product'])
&& $deals['deals_promotion_discount_bill_rules']['is_all_product'] == 0)
)
)
Product Rule
:
{{ $deals['product_rule'] && $deals['product_rule'] == 'and' ? 'All items must be present' : 'One of the items must exist' }}
@endif
@include('promocampaign::template.promo-global-requirement-detail', ['promo_source' => 'deals_promotion'])
@if (
!empty($deals['deals_promotion_product_discount_rules'])
|| !empty($deals['deals_promotion_tier_discount_rules'])
|| !empty($deals['deals_promotion_buyxgety_rules'])
|| !empty($deals['deals_promotion_discount_bill_rules'])
|| !empty($deals['deals_promotion_discount_delivery_rules'])
)
@php
$promo_product = $deals['deals_promotion_product_discount'] ?: $deals['deals_promotion_tier_discount_product'] ?: $deals['deals_promotion_buyxgety_product_requirement'] ?: $deals['deals_promotion_discount_bill_products'] ?: [];
$promo_product_simple = [];
foreach ($promo_product as $value) {
$variant = [];
foreach ($value['product_variant_pivot'] as $val) {
$variant[] = $val['product_variant']['product_variant_name'];
}
$variant = implode(', ',$variant);
$promo_product_simple[] = [
'brand' => $value['brand']['name_brand']??$deals['brand']['name_brand']??'',
'product_code' => $value['product']['product_code'],
'product_name' => $value['product']['product_name'],
'variant' => $variant
];
}
@endphp
{{-- Product Discount --}}
@if (isset($deals['deals_promotion_product_discount_rules']) && $deals['deals_promotion_product_discount_rules'] != null)
Product Requirement
:
@if ($deals['deals_promotion_product_discount_rules'] != null)
@if ($deals['deals_promotion_product_discount_rules']['is_all_product'] == '1')
All Product
@elseif ($deals['deals_promotion_product_discount_rules']['is_all_product'] == '0')
Selected Product
@else
No Product Requirement
@endif
@elseif ($deals['deals_promotion_tier_discount_rules'] != null)
{{$deals['deals_promotion_tier_discount_product']['product']['product_name']}}
@elseif ($deals['deals_promotion_buyxgety_rules'] != null)
{{$deals['deals_promotion_buyxgety_product_requirement']['product']['product_name']??''}}
@endif
@if ($deals['deals_promotion_product_discount_rules'] != null)
Discount
:
@if ($deals['deals_promotion_product_discount_rules']['discount_type'] == 'Percent')
{{$deals['deals_promotion_product_discount_rules']['discount_value']}} % {{ !empty($deals['deals_promotion_product_discount_rules']['max_percent_discount']) ? '(Max : IDR '.number_format($deals['deals_promotion_product_discount_rules']['max_percent_discount']).') ' : '' }}
@elseif ($deals['deals_promotion_product_discount_rules']['discount_type'] == 'Nominal')
{{ 'IDR '.number_format($deals['deals_promotion_product_discount_rules']['discount_value']) }}
@else
No discount
@endif
Min Basket Size
:
{{ ($deals['min_basket_size'] == 0) ? 'no min basket size' : 'IDR '.number_format($deals['min_basket_size']) }}
Max Product
:
{{ ($deals['deals_promotion_product_discount_rules']['max_product'] == 0) ? 'no limit' : number_format($deals['deals_promotion_product_discount_rules']['max_product']).' item' }}
@endif
{{-- Tier Discount --}}
@elseif (isset($deals['deals_promotion_tier_discount_rules']) && $deals['deals_promotion_tier_discount_rules'] != null)
Min Basket Size
:
{{ ($deals['min_basket_size'] == 0) ? 'no min basket size' : 'IDR '.number_format($deals['min_basket_size']) }}
Min Qty |
Max Qty |
{{ ($deals['deals_promotion_tier_discount_rules'][0]['discount_type']??'').' Discount' }} |
@foreach($deals['deals_promotion_tier_discount_rules'] as $res)
{{ number_format($res['min_qty']) }} |
{{ number_format($res['max_qty']) }} |
{{ ($deals['deals_promotion_tier_discount_rules'][0]['discount_type'] == 'Percent') ? ( $res['discount_value'].' % (Max : IDR '.number_format($res['max_percent_discount']).')' ) : ('IDR '.number_format($res['discount_value'])) }} |
@endforeach
{{-- Buy X Get Y Discount --}}
@elseif (isset($deals['deals_promotion_buyxgety_rules']) && $deals['deals_promotion_buyxgety_rules'] != null)
Min Basket Size
:
{{ ($deals['min_basket_size'] == 0) ? 'no min basket size' : 'IDR '.number_format($deals['min_basket_size']) }}
Min Qty |
Max Qty |
Product Benefit |
Product Benefit Variant |
Benefit Qty |
Benefit Discount |
@foreach($deals['deals_promotion_buyxgety_rules'] as $res)
@php
$variant = [];
foreach ($res['product_variant_pivot'] as $val) {
$variant[] = $val['product_variant']['product_variant_name'];
}
foreach ($res['deals_buyxgety_product_modifiers'] as $mod) {
$variant[] = $mod['modifier']['text_detail_trx'];
}
$variant = implode(', ',$variant);
@endphp
{{ $res['min_qty_requirement'] }} |
{{ $res['max_qty_requirement'] }} |
{{ $res['product']['product_code'].' - '.$res['product']['product_name'] }}
| {{ $variant }} |
{{ $res['benefit_qty'] }} |
@if( ($res['discount_type']??false) == 'nominal' )
{{'IDR '.number_format($res['discount_value'])}}
@elseif( ($res['discount_type']??false) == 'percent' )
@if( ($res['discount_value']??false) == 100 )
Free
@else
{{ ($res['discount_value']??false).'% (Max : IDR '.number_format($res['max_percent_discount']).')' }}
@endif
@endif
|
{{ ( ($res['discount_percent']??'') == 100) ? 'Free' : ( ($res['discount_percent']??false) ? $res['discount_percent'].' % (Max : IDR '.number_format($res['max_percent_discount']).')' : (($res['discount_nominal']??false) ? 'IDR '.number_format($res['discount_nominal']) : '' ) ) }} |
@endforeach
{{-- Bill Discount --}}
@elseif (!empty($deals['deals_promotion_discount_bill_rules']))
Discount
:
@if ($deals['deals_promotion_discount_bill_rules']['discount_type'] == 'Percent')
{{ $deals['deals_promotion_discount_bill_rules']['discount_value'] }} %
@if (!empty($deals['deals_promotion_discount_bill_rules']['max_percent_discount']))
(max: IDR {{ number_format($deals['deals_promotion_discount_bill_rules']['max_percent_discount']) }})
@endif
@elseif ($deals['deals_promotion_discount_bill_rules']['discount_type'] == 'Nominal')
{{ 'IDR '.number_format($deals['deals_promotion_discount_bill_rules']['discount_value']) }}
@else
No discount
@endif
Min Basket Size
:
{{ ($deals['min_basket_size'] == 0) ? 'no min basket size' : 'IDR '.number_format($deals['min_basket_size']) }}
{{-- Delivery Discount --}}
@elseif (!empty($deals['deals_promotion_discount_delivery_rules']))
Discount
:
@if ($deals['deals_promotion_discount_delivery_rules']['discount_type'] == 'Percent')
{{ $deals['deals_promotion_discount_delivery_rules']['discount_value'] }} %
@if (!empty($deals['deals_promotion_discount_delivery_rules']['max_percent_discount']))
(max: IDR {{ number_format($deals['deals_promotion_discount_delivery_rules']['max_percent_discount']) }})
@endif
@elseif ($deals['deals_promotion_discount_delivery_rules']['discount_type'] == 'Nominal')
{{ 'IDR '.number_format($deals['deals_promotion_discount_delivery_rules']['discount_value']) }}
@else
No discount
@endif
Min Basket Size
:
{{ ($deals['min_basket_size'] == 0) ? 'no min basket size' : 'IDR '.number_format($deals['min_basket_size']) }}
@elseif (isset($deals['deals_discount_global_rule']) && $deals['deals_discount_global_rule'] != null)
@if ($deals['deals_discount_global_rule'] != null)
Discount
:
@if ($deals['deals_discount_global_rule']['discount_type'] == 'Percent')
{{ $deals['deals_discount_global_rule']['discount_value'] }} %
@elseif ($deals['deals_discount_global_rule']['discount_type'] == 'Nominal')
{{ 'IDR '.number_format($deals['deals_discount_global_rule']['discount_value']) }}
@else
No discount
@endif
@endif
@endif
@if(MyHelper::hasAccess([112], $grantedFeature))
@endif
@else
No Deals Rules
@endif