@extends('frontend.layouts.app') @section('content')

{{ translate('All coupons') }}

@foreach($coupons as $coupon) @if($coupon->type == 'product_base') @php $products = json_decode($coupon->details); $coupon_products = []; foreach($products as $product) { array_push($coupon_products, $product->product_id); } @endphp @else @php $order_discount = json_decode($coupon->details); @endphp @endif @php if($coupon->user->user_type != 'admin') { $shop = $coupon->user->shop; $name = $shop->name; } else { $name = get_setting('website_name'); } @endphp @if($coupon->user->user_type == 'admin' || ($shop->verification_status && $shop != null))
@if($coupon->type == 'product_base')
{{ $name }}
@php $products = App\Models\Product::whereIn('id', $coupon_products)->get(); @endphp @foreach($products as $key => $product) @if($product != null && $key < 3)
{{ home_discounted_base_price($product) }} @if(home_base_price($product) != home_discounted_base_price($product)) {{ home_base_price($product) }} @endif
@endif @endforeach
@if($coupon->discount_type == 'amount')

{{ single_price($coupon->discount) }} {{ translate('OFF') }}

@else

{{ $coupon->discount }}% {{ translate('OFF') }}

@endif {{ translate('Code') }}: {{ $coupon->code }} user->user_type != 'admin') href="{{ route('shop.visit', $shop->slug) }}" @else href="{{ route('inhouse.all') }}" @endif > {{ translate('Visit store') }}
@else
{{ $name }}
@if($coupon->discount_type == 'amount') {{ translate('Min Spend ') }} {{ single_price($order_discount->min_buy) }} {{ translate('from') }} {{ $name }} {{ translate('to get') }} {{ single_price($coupon->discount) }} {{ translate('OFF on total orders') }} @else {{ translate('Min Spend ') }} {{ single_price($order_discount->min_buy) }} {{ translate('from') }} {{ $name }} {{ translate('to get') }} {{ $coupon->discount }}% {{ translate('OFF on total orders') }} @endif

{{ translate('Max Discount') }}: {{ single_price($order_discount->max_discount) }}

{{ translate('Code') }}: {{ $coupon->code }} user->user_type != 'admin') href="{{ route('shop.visit', $shop->slug) }}" @else href="{{ route('inhouse.all') }}" @endif > {{ translate('Visit store') }}
@endif
@endif @endforeach
@endsection