@extends('frontend.layouts.app') @section('content') @php $coupon = \App\Coupon::where('code', $code)->first(); if(!empty($coupon)){ foreach (json_decode(@$coupon->details) as $key => $val) { $product_id[] = $val->product_id; } if(count($product_id) > 0){ $products = \App\Product::whereIn('id', $product_id)->where('published', 1)->paginate(24); } } $actual_link = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"; $url = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]"; $finalUrl = $url.'/offer/product/'.$coupon->code; $offerBanner = \App\Slider::where('link', $finalUrl)->where('published', 1)->first(); $mobileBanner = \App\MobileWebSlider::where('link', $finalUrl)->where('published', 1)->first(); @endphp
@if(!empty($offerBanner)) {{ env('APP_NAME')}} promo @endif
@if(!empty($mobileBanner)) {{ env('APP_NAME')}} promo @endif
@if(count($data) > 0)

@foreach ($data as $key => $row) @php $product = \App\Product::where('id', $row)->first(); @endphp
@if(!empty($product->discount)) {{$product->discount}}% off @endif {{  __($product->name) }}
@if (\App\Addon::where('unique_identifier', 'club_point')->first() != null && \App\Addon::where('unique_identifier', 'club_point')->first()->activated)
{{ translate('Club Point') }}: {{ $product->earn_point }}
@endif

{{ __($product->name) }}

@if(home_price($product->id) != home_discounted_price($product->id)) {{ home_base_price($product->id) }} {{ home_discounted_base_price($product->id) }} @else {{ home_discounted_base_price($product->id) }} @endif
{{ renderStarRating($product->rating) }}
@endforeach
@endif @endsection