<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport"
        content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no, target-densityDpi=device-dpi" />
    <meta name="_token" content="<?php echo e(csrf_token()); ?>">
    <meta name="csrf-token" id="csrf-token" content="<?php echo e(csrf_token()); ?>">
    <?php echo $__env->yieldContent('title'); ?>
    <?php
        $setting = App\Models\Setting::with('settinglangfrontend')->first();
        $languages = App\Models\Language::where('status', 1)->get();
        $currencies = App\Models\MultiCurrency::where('status', 1)->get();
        $front_lang = Session::get('front_lang');
        $language = App\Models\Language::where('is_default', 'Yes')->first();
        if($front_lang == ''){
            $front_lang = Session::put('front_lang', $language->lang_code);
        }

        $lang_direction = App\Models\Language::where('lang_code', $front_lang)->first();

        $currency_code = Session::get('currency_code');
        $currency_icon = Session::get('currency_icon');
        $currency_rate = Session::get('currency_rate');
        $currency_position = Session::get('currency_position');

        $default_currency = App\Models\MultiCurrency::where('is_default', 'Yes')->first();

        if($currency_code == ''){
            $currency_code = Session::put('currency_code', $default_currency->currency_code);
        }

        if($currency_icon == ''){
            $currency_icon = Session::put('currency_icon', $default_currency->currency_icon);
        }

        if($currency_rate == ''){
            $currency_rate = Session::put('currency_rate', $default_currency->currency_rate);
        }

        if($currency_position == ''){
            $currency_position = Session::put('currency_position', $default_currency->currency_position);
        }

    ?>
    <link rel="icon" type="image/png" href="<?php echo e(custom_asset($setting->favicon)); ?>">
    <link rel="stylesheet" href="<?php echo e(asset('frontend/css/all.min.css')); ?>">
    <link rel="stylesheet" href="<?php echo e(asset('frontend/css/bootstrap.min.css')); ?>">
    <link rel="stylesheet" href="<?php echo e(asset('frontend/css/animate.css')); ?>">
    <link rel="stylesheet" href="<?php echo e(asset('frontend/css/nice-select.css')); ?>">
    <link rel="stylesheet" href="<?php echo e(asset('frontend/css/slick.css')); ?>">
    <link rel="stylesheet" href="<?php echo e(asset('frontend/css/price_range_style.css')); ?>">
    <link rel="stylesheet" href="<?php echo e(asset('frontend/css/price_range_ui.css')); ?>">
    <link rel="stylesheet" href="<?php echo e(asset('frontend/css/summernote.min.css')); ?>">

    <link rel="stylesheet" href="<?php echo e(asset('frontend/css/bootstrap-tagsinput.css')); ?>">
    <link rel="stylesheet" href="<?php echo e(asset('backend/css/select2.min.css')); ?>">

    <link rel="stylesheet" href="<?php echo e(asset('frontend/css/spacing.css')); ?>">
    <link rel="stylesheet" href="<?php echo e(asset('frontend/css/style.css')); ?>">
    <link rel="stylesheet" href="<?php echo e(asset('frontend/css/responsive.css')); ?>">
    <link rel="stylesheet" href="<?php echo e(asset('toastr/toastr.min.css')); ?>">
    <link rel="stylesheet" href="<?php echo e(asset('frontend/css/pricing-two.css')); ?>">
    <?php if($lang_direction->lang_direction=='right_to_left'): ?>
    <link rel="stylesheet" href="<?php echo e(asset('frontend/css/rtl.css')); ?>">
    <?php endif; ?>

    <style>
        .tox .tox-promotion,
        .tox-statusbar__branding{
            display: none !important;
        }
    </style>
</head>

<body>

    <!--=============================
        TOPBAR START
    ==============================-->
    <section class="wsus__topbar">
        <div class="container">
            <div class="row">
                <div class="col-xl-7 col-lg-7 d-none d-lg-block">
                    <div class="wsus__topbar_countdown d-flex flex-wrap align-items-center">
                        <?php
                            $discount =  App\Models\ProductDiscount::first();
                            $today = Carbon\Carbon::now();
                            $end_time = $discount->end_time;
                            $end_year = date('Y', strtotime($end_time));
                            $end_month = date('m', strtotime($end_time));
                            $end_day = date('d', strtotime($end_time));
                        ?>

                        <p><a target="__blank" href="<?php echo e($discount->link); ?>"><span><?php echo e($discount->offer); ?>% </span> <?php echo e($discount->discountlangfrontend->title); ?></a></p>
                        <input type="hidden" id="end_year" value="<?php echo e($end_year); ?>">
                        <input type="hidden" id="end_month" value="<?php echo e($end_month); ?>">
                        <input type="hidden" id="end_day" value="<?php echo e($end_day); ?>">
                        <div class="simply-countdown simply-countdown-one"></div>
                    </div>
                </div>
                <div class="col-xl-5 col-lg-5">
                    <div class="wsus__topbar_language">
                        <ul class="wsus__multi_language d-flex flrx-wrap">
                            <li>
                                <form action="<?php echo e(route('currency.change')); ?>" method="GET">
                                    <?php echo csrf_field(); ?>
                                    <select class="select_js" name="currency_code" onchange="this.form.submit()">
                                        <?php $__currentLoopData = $currencies; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $currency): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <option value="<?php echo e($currency->currency_code); ?>" <?php echo e($currency->currency_code == $currency_code ? 'selected':''); ?>><?php echo e($currency->currency_name); ?></option>
                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                    </select>
                                </form>
                            </li>

                            <li>
                                <form action="<?php echo e(route('language.change')); ?>" method="GET">
                                    <?php echo csrf_field(); ?>
                                    <select class="select_js" name="front_lang" onchange="this.form.submit()">
                                        <?php $__currentLoopData = $languages; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $language): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <option value="<?php echo e($language->lang_code); ?>" <?php echo e($front_lang == $language->lang_code ? 'selected':''); ?>><?php echo e($language->lang_name); ?></option>
                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                    </select>
                                </form>
                            </li>
                            <li>
                                <a class="user" href="<?php echo e(route('dashboard')); ?>">
                                    <img src="<?php echo e(asset('frontend/images/user_icon.png')); ?>" alt="user" class="img-fluid w-100">
                                </a>
                                <ul class="user_droap_menu">
                                    <li>
                                        <a href="<?php echo e(route('dashboard')); ?>"><i class="fal fa-layer-group"></i> <?php echo e(__('user.Overview')); ?></a>
                                    </li>
                                    <li>
                                        <a href="<?php echo e(route('portfolio')); ?>"><i class="far fa-box"></i> <?php echo e(__('user.Portfolio')); ?></a>
                                    </li>
                                    <li>
                                        <a href="<?php echo e(route('download')); ?>"><i class="far fa-download"></i> <?php echo e(__('user.Download File')); ?></a>
                                    </li>
                                    <li>
                                        <a href="<?php echo e(route('collection')); ?>"><i class="fas fa-heart"></i> <?php echo e(__('user.Collection')); ?></a>
                                    </li>

                                    <?php if(Auth::guard('web')->check()): ?>
                                    <li>
                                        <a href="<?php echo e(route('edit-profile')); ?>"><i class="fas fa-user-edit"></i> <?php echo e(__('user.Edit profile')); ?></a>
                                    </li>

                                    <li>
                                        <a href="<?php echo e(route('change-password')); ?>"><i class="fas fa-lock"></i><?php echo e(__('user.Change Password')); ?></a>
                                    </li>

                                    <li>
                                        <a href="<?php echo e(route('user.logout')); ?>"><i class="fas fa-sign-out-alt"></i> <?php echo e(__('user.Logout')); ?></a>
                                    </li>
                                    <?php else: ?>
                                    <li>
                                        <a href="<?php echo e(route('login')); ?>"><i class="fas fa-sign-in-alt"></i> <?php echo e(__('user.login')); ?></a>
                                    </li>
                                    <?php endif; ?>

                                    <?php if(Auth::guard('web')->check()): ?>
                                        <?php
                                            $author = Auth::guard('web')->user();

                                            $order_items = App\Models\OrderItem::where('author_id', $author->id)->get();
                                            $order_item_id_arr=[];
                                            foreach($order_items as $order_item){
                                                $order_item_id_arr[]=$order_item->order_id;
                                            }
                                            $order_item_id_arr=array_unique($order_item_id_arr);
                                            $orders = App\Models\Order::whereIn('id', $order_item_id_arr)->where('order_status', 1)->get();

                                            $order_id_arr=[];

                                            foreach($orders as $order){
                                                $order_id_arr[]=$order->id;
                                            }
                                            $order_id_arr=array_unique($order_id_arr);
                                            $orders_items = App\Models\OrderItem::whereIn('order_id', $order_id_arr)->get();

                                            $total_balance = $orders_items->sum('price');
                                        ?>

                                        <?php if($setting->commission_type == 'commission'): ?>
                                            <li>
                                                <p><?php echo e(__('user.Earnings')); ?>:</p>
                                                <h2>
                                                    <?php if(session()->get('currency_position') == 'right'): ?>
                                                        <?php echo e($total_balance * session()->get('currency_rate')); ?><?php echo e(session()->get('currency_icon')); ?>

                                                    <?php else: ?>
                                                        <?php echo e(session()->get('currency_icon')); ?><?php echo e($total_balance * session()->get('currency_rate')); ?>

                                                    <?php endif; ?>
                                                </h2>
                                            </li>
                                        <?php endif; ?>
                                    <?php endif; ?>
                                </ul>
                            </li>
                        </ul>
                    </div>
                </div>
            </div>
        </div>
    </section>
    <!--=============================
        TOPBAR START
    ==============================-->


    <!--=============================
        MENU START
    ==============================-->
    <nav class="navbar navbar-expand-lg main_menu">
        <div class="container">
            <a class="navbar-brand" href="<?php echo e(route('home')); ?>">
                <img src="<?php echo e(custom_asset($setting->logo_two)); ?>" alt="Alasmart" class="img-fluid w-100">
            </a>
            <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav"
                aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
                <i class="far fa-bars menu_icon"></i>
                <i class="far fa-times close_icon"></i>
            </button>
            <div class="collapse navbar-collapse" id="navbarNav">
                <ul class="navbar-nav m-auto">
                    <li class="nav-item">
                        <?php
                            if($setting->selected_theme==1){
                               $route = route('home',['theme' => 1]);
                            }else if($setting->selected_theme==2){
                                $route = route('home',['theme' => 2]);
                            }else if($setting->selected_theme==3){
                                $route = route('home',['theme' => 3]);
                            }else if($setting->selected_theme==0){
                                $route = route('home',['theme' => 1]);
                            }
                        ?>
                        <a class="nav-link <?php echo e(Route::is('home') ? 'active':''); ?>" href="<?php echo e($route); ?>"><?php echo e(__('user.Home')); ?>

                            <?php if($setting->selected_theme==0): ?>
                            <i class="far fa-chevron-down"></i>
                            <?php endif; ?>
                        </a>
                        <?php if($setting->selected_theme==0): ?>
                        <ul class="wsus__droap_menu">
                            <li><a href="<?php echo e(route('home',['theme' => 1])); ?>"><?php echo e(__('user.home one')); ?></a></li>
                            <li><a class="active" href="<?php echo e(route('home',['theme' => 2])); ?>"><?php echo e(__('user.home two')); ?></a></li>
                            <li><a href="<?php echo e(route('home',['theme' => 3])); ?>"><?php echo e(__('user.home three')); ?></a></li>
                        </ul>
                        <?php endif; ?>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="<?php echo e(route('products')); ?>"><?php echo e(__('user.Products')); ?></a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="javascript:;"><?php echo e(__('user.Pages')); ?> <i class="far fa-chevron-down"></i></a>
                        <ul class="wsus__droap_menu">

                            <?php if($setting->commission_type == 'subscription'): ?>
                                <?php
                                    $json_module_data = file_get_contents(base_path('modules_statuses.json'));
                                    $module_status = json_decode($json_module_data);
                                ?>

                                <?php if($module_status->Subscription): ?>

                                    <li>
                                        <a class="<?php echo e(Route::is('pricing-plan') ? 'active':''); ?>" href="<?php echo e(route('pricing-plan')); ?>"><?php echo e(__('user.Pricing Plan')); ?></a>
                                    </li>
                                <?php endif; ?>
                            <?php endif; ?>

                            <li><a class="<?php echo e(Route::is('become-author-page') ? 'active':''); ?>" href="<?php echo e(route('become-author-page')); ?>"><?php echo e(__('user.become an author')); ?></a></li>

                            <?php if($setting->blog_left_right == 0): ?>
                            <li><a class="<?php echo e(request()->get('blog') == 'leftbar' ? 'active':''); ?>" href="<?php echo e(route('blogs', ['blog'=>'leftbar'])); ?>"><?php echo e(__('user.blog leftbar')); ?></a></li>
                            <li><a class="<?php echo e(request()->get('blog') == 'rightbar' ? 'active':''); ?>" href="<?php echo e(route('blogs', ['blog'=>'rightbar'])); ?>"><?php echo e(__('user.blog rightbar')); ?></a></li>
                            <?php endif; ?>

                            <li><a class="<?php echo e(Route::is('faq') ? 'active':''); ?>" href="<?php echo e(route('faq')); ?>"><?php echo e(__('user.FAQ')); ?></a></li>
                            <li><a class="<?php echo e(Route::is('privacy-policy') ? 'active':''); ?>" href="<?php echo e(route('privacy-policy')); ?>"><?php echo e(__('user.privacy policy')); ?></a></li>
                            <li><a class="<?php echo e(Route::is('terms-and-conditions') ? 'active':''); ?>" href="<?php echo e(route('terms-and-conditions')); ?>"><?php echo e(__('user.terms and condition')); ?></a></li>

                            <?php
                                $pages = App\Models\CustomPage::where('status', 1)->get();
                            ?>
                            <?php $__currentLoopData = $pages; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $page): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <li><a href="<?php echo e(route('custom-page', $page->slug)); ?>"><?php echo e($page->customlangfrontend->page_name); ?></a></li>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

                        </ul>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="<?php echo e(route('blogs')); ?>"><?php echo e(__('user.Blog')); ?></a>
                    </li>

                    <li class="nav-item">
                        <a class="nav-link <?php echo e(Route::is('about-us') ? 'active':''); ?>" href="<?php echo e(route('about-us')); ?>"><?php echo e(__('user.About Us')); ?></a>
                    </li>

                    <li class="nav-item">
                        <a class="nav-link" href="<?php echo e(route('contact-us')); ?>"><?php echo e(__('user.Contact')); ?></a>
                    </li>
                </ul>

                <ul class="right_menu d-flex flex-wrap">
                    <li>
                        <a href="<?php echo e(route('cart-view')); ?>">
                            <img src="<?php echo e(asset('frontend/images/menu_cart_icom.png')); ?>" alt="user" class="img-fluid w-100">
                            <span id="cartQty">0</span>
                        </a>
                    </li>
                    <li><a class="start_btn" href="<?php echo e(route('select-product-type')); ?>"><?php echo e(__('user.Start Selling')); ?></a></li>
                </ul>
            </div>
        </div>
    </nav>
    <!--=============================
        MENU END
    ==============================-->


<?php echo $__env->yieldContent('frontend-content'); ?>


    <!--=============================
        SUBSCRIBE START
    ==============================-->
    <section class="wsus__subscribe pt_85 pb_90" style="background: url(<?php echo e(custom_asset($setting->home2_subscription_bg)); ?>);">
        <div class="container">
            <div class="row">
                <div class="col-xxl-6 col-sm-10 col-md-8 col-xl-7">
                    <div class="wsus__subscribe_text">
                        <?php
                            $setting = App\Models\Setting::with('settinglangfrontend')->first();
                        ?>
                        <h2><?php echo e($setting->settinglangfrontend->subscriber_title); ?></h2>
                        <p><?php echo e($setting->settinglangfrontend->subscriber_description); ?></p>
                        <form id="fsubscriberForm">
                            <?php echo csrf_field(); ?>
                            <input type="text" name="email" placeholder="<?php echo e(__('user.Enter your email address')); ?>">
                            <button class="common_btn" id="fsubSubmitBtn" type="submit"><?php echo e(__('user.Subscribe')); ?></button>
                            <button class="common_btn d-none" id="fsubShowSpain" type="submit"><i class="fas fa-spinner fa-spin"></i></button>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </section>
    <!--=============================
        SUBSCRIBE END
    ==============================-->


    <?php
        $footer = App\Models\Footer::first();
        $item_sold = App\Models\OrderItem::get()->count();
        $total_earning = App\Models\OrderItem::get()->sum('price');
        $total_user = App\Models\User::where(['email_verified' => 1, 'status' => 1])->get()->count();
        $social_links=App\Models\FooterSocialLink::get();
    ?>

   <!--=============================
        FOOTER START
    ==============================-->
    <footer class="pt_120 xs_pt_80" style="background: url(<?php echo e(asset('frontend/images/footer_bg.jpg')); ?>);">
        <div class="container">
            <div class="row justify-content-between">
                <div class="col-xl-4 col-md-4 col-lg-4">
                    <div class="wsus__footer_content">
                        <a class="footer_logo" href="<?php echo e(route('home')); ?>">
                            <img src="<?php echo e(custom_asset($setting->footer_logo)); ?>" alt="Alsmart" class="img-fluid w-100">
                        </a>
                        <p class="description"><?php echo e($footer->footerlangfrontend->description); ?></p>
                    </div>
                </div>
                <div class="col-xl-2 col-md-4 col-lg-2">
                    <div class="wsus__footer_content">
                        <h4><?php echo e(__('user.Support')); ?></h4>
                        <ul>
                            <li><a href="<?php echo e(route('contact-us')); ?>"><?php echo e(__('user.Contact Us')); ?></a></li>
                            <li><a href="<?php echo e(route('blogs')); ?>"><?php echo e(__('user.Our Blog')); ?></a></li>
                            <li><a href="<?php echo e(route('faq')); ?>"><?php echo e(__('user.FAQ')); ?></a></li>
                            <li><a href="<?php echo e(route('privacy-policy')); ?>"><?php echo e(__('user.Privacy Policy')); ?></a></li>
                        </ul>
                    </div>
                </div>
                <div class="col-xl-2 col-md-4 col-lg-2">
                    <div class="wsus__footer_content">
                        <h4><?php echo e(__('user.Quick Link')); ?></h4>
                        <ul>
                            <li><a href="<?php echo e(route('dashboard')); ?>"><?php echo e(__('user.My Profile')); ?></a></li>
                            <li><a href="<?php echo e(route('about-us')); ?>"><?php echo e(__('user.About Us')); ?></a></li>
                            <li><a href="<?php echo e(route('login')); ?>"><?php echo e(__('user.Login')); ?></a></li>
                            <li><a href="<?php echo e(route('register')); ?>"><?php echo e(__('user.Registration')); ?></a></li>
                        </ul>
                    </div>
                </div>
                <div class="col-xl-2 col-md-4 col-lg-3">
                    <div class="wsus__footer_content">
                        <h4><?php echo e(__('user.Important Link')); ?></h4>
                        <ul>
                            <?php if($setting->commission_type == 'subscription'): ?>
                                <?php
                                    $json_module_data = file_get_contents(base_path('modules_statuses.json'));
                                    $module_status = json_decode($json_module_data);
                                ?>

                                <?php if($module_status->Subscription): ?>

                                    <li>
                                        <a href="<?php echo e(route('pricing-plan')); ?>"><?php echo e(__('user.Pricing Plan')); ?></a>
                                    </li>
                                <?php endif; ?>
                            <?php endif; ?>
                            <li><a href="<?php echo e(route('register')); ?>"><?php echo e(__('user.Become an author')); ?></a></li>
                            <li><a href="<?php echo e(route('terms-and-conditions')); ?>"><?php echo e(__('user.Terms & Conditions')); ?></a></li>
                            <li><a href="<?php echo e(route('products')); ?>"><?php echo e(__('user.Our product')); ?></a></li>
                            <li><a href="<?php echo e(route('cart-view')); ?>"><?php echo e(__('user.Cart page')); ?></a></li>
                        </ul>
                    </div>
                </div>
            </div>
        </div>

        <div class="wsus__footer_link mt_115 xs_mt_25">
            <div class="container">
                <div class="row align-items-center">
                    <div class="col-md-6">
                        <ul class="social_link d-flex flex-wrap">
                            <?php $__currentLoopData = $social_links; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $link): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <li><a href="<?php echo e($link->link); ?>"><i class="<?php echo e($link->icon); ?>"></i></a></li>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </ul>
                    </div>
                    <div class="col-md-6">
                        <ul class="footer_counter d-flex flex-wrap">
                            <li>
                                <p><?php echo e(__('user.Active Customers')); ?></p>
                                <h3 class="counter"><?php echo e($total_user); ?></h3>
                            </li>
                            <li>
                                <p><?php echo e(__('user.Total Sold Item')); ?></p>
                                <h3 class="counter"><?php echo e($item_sold); ?></h3>
                            </li>
                        </ul>
                    </div>
                </div>
            </div>
        </div>

        <div class="wsus__footer_bottom">
            <div class="container max-width">
                <div class="row align-items-center">
                    <div class="col-xl-6 col-lg-6">
                        <div class="wsus__footer_copyright d-flex flex-wrap">
                            <p><?php echo e($footer->footerlangfrontend->copyright); ?></p>
                        </div>
                    </div>
                    <div class="col-xl-6 col-lg-6">
                        <div class="wsus__footer_payment d-flex flex-wrap">
                            <div class="img">
                                <img src="<?php echo e(custom_asset($footer->payment_image)); ?>" alt="payment gateway" class="img-fluid w-100">
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </footer>
    <!--=============================
        FOOTER END
    ==============================-->


    <!--============================
        SCROLL BUTTON START
    =============================-->
    <div class="wsus__scroll_btn">
        <p><?php echo e(__('user.Up to Top')); ?></p>
        <span><i class="far fa-angle-up"></i></span>
    </div>
    <!--============================
        SCROLL BUTTON END
    =============================-->


    <!--jquery library js-->
    <script src="<?php echo e(asset('frontend/js/jquery-3.7.1.min.js')); ?>"></script>
    <!--bootstrap js-->
    <script src="<?php echo e(asset('frontend/js/bootstrap.bundle.min.js')); ?>"></script>
    <!--font-awesome js-->
    <script src="<?php echo e(asset('frontend/js/Font-Awesome.js')); ?>"></script>
    <!--simplyCountdown js-->
    <script src="<?php echo e(asset('frontend/js/simplyCountdown.js')); ?>"></script>
    <!--countup js-->
    <script src="<?php echo e(asset('frontend/js/jquery.waypoints.min.js')); ?>"></script>
    <script src="<?php echo e(asset('frontend/js/jquery.countup.min.js')); ?>"></script>
    <!--slick js-->
    <script src="<?php echo e(asset('frontend/js/slick.min.js')); ?>"></script>
    <!--nice select js-->
    <script src="<?php echo e(asset('frontend/js/jquery.nice-select.min.js')); ?>"></script>
    <!--wow js-->
    <script src="<?php echo e(asset('frontend/js/wow.min.js')); ?>"></script>
    <!--price range js-->
    <script src="<?php echo e(asset('frontend/js/price_range_script.js')); ?>"></script>
    <script src="<?php echo e(asset('frontend/js/price_range_ui.min.js')); ?>"></script>
    <!--isotope js-->
    <script src="<?php echo e(asset('frontend/js/isotope.pkgd.min.js')); ?>"></script>
    <!--summernote js-->
    <script src="<?php echo e(asset('frontend/js/summernote.min.js')); ?>"></script>

    <script src="<?php echo e(asset('frontend/js/bootstrap-tagsinput.min.js')); ?>"></script>
    <script src="<?php echo e(asset('backend/js/select2.min.js')); ?>"></script>

    <!--main/custom js-->
    <script src="<?php echo e(asset('frontend/js/main.js')); ?>"></script>

    <script src="<?php echo e(asset('toastr/toastr.min.js')); ?>"></script>
    <script src="<?php echo e(asset('backend/tinymce/js/tinymce/tinymce.min.js')); ?>"></script>
    <script src="https://www.google.com/recaptcha/api.js"></script>
    <script>
        <?php if(Session::has('messege')): ?>
        var type="<?php echo e(Session::get('alert-type','info')); ?>"
        switch(type){
            case 'info':
                toastr.info("<?php echo e(Session::get('messege')); ?>");
                break;
            case 'success':
                toastr.success("<?php echo e(Session::get('messege')); ?>");
                break;
            case 'warning':
                toastr.warning("<?php echo e(Session::get('messege')); ?>");
                break;
            case 'error':
                toastr.error("<?php echo e(Session::get('messege')); ?>");
                break;
        }
        <?php endif; ?>
    </script>
    <?php if($errors->any()): ?>
        <?php $__currentLoopData = $errors->all(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $error): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
            <script>
                toastr.error('<?php echo e($error); ?>');
            </script>
        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
    <?php endif; ?>

    <?php echo $__env->yieldPushContent('frontend_js'); ?>

    <script>
        (function($) {
            "use strict";
            $(document).ready(function () {
                $("#fsubscriberForm").on('submit', function(e){
                    e.preventDefault();
                    $('#fsubShowSpain').removeClass('d-none');
                    $('#fsubSubmitBtn').addClass('d-none');
                    var isDemo = "<?php echo e(env('APP_MODE')); ?>"
                    if(isDemo == 'DEMO'){
                        toastr.error('This Is Demo Version. You Can Not Change Anything');
                        return;
                    }

                    let loading = "<?php echo e(__('user.Processing...')); ?>"

                    $("#fsubscribe_btn").html(loading);
                    $("#fsubscribe_btn").attr('disabled',true);

                    $.ajax({
                        type: 'POST',
                        data: $('#fsubscriberForm').serialize(),
                        url: "<?php echo e(route('subscribe-request')); ?>",
                        success: function (response) {
                            if(response.status == 1){
                                toastr.success(response.message);
                                let subscribe = "<?php echo e(__('user.Subscribe')); ?>"
                                $("#fsubscribe_btn").html(subscribe);
                                $("#fsubscribe_btn").attr('disabled',false);
                                $("#fsubscriberForm").trigger("reset");
                                $('#fsubShowSpain').addClass('d-none');
                                $('#fsubSubmitBtn').removeClass('d-none');
                            }

                            if(response.status == 0){
                                toastr.error(response.message);
                                let subscribe = "<?php echo e(__('user.Subscribe')); ?>"
                                $("#fsubscribe_btn").html(subscribe);
                                $("#fsubscribe_btn").attr('disabled',false);
                                $("#fsubscriberForm").trigger("reset");
                                $('#fsubShowSpain').addClass('d-none');
                                $('#fsubSubmitBtn').removeClass('d-none');
                            }
                        },
                        error: function(err) {
                            $('#fsubShowSpain').addClass('d-none');
                            $('#fsubSubmitBtn').removeClass('d-none');
                            toastr.error('Something went wrong');
                            let subscribe = "<?php echo e(__('user.Subscribe')); ?>"
                            $("#fsubscribe_btn").html(subscribe);
                            $("#fsubscribe_btn").attr('disabled',false);
                            $("#fsubscriberForm").trigger("reset");
                        }
                    });
                });


                $("#footerTopSubscriberForm").on('submit', function(e){
                    e.preventDefault();
                    $('#footerTopSubShowSpain').removeClass('d-none');
                    $('#footerTopSubSubmitBtn').addClass('d-none');
                    var isDemo = "<?php echo e(env('APP_MODE')); ?>"
                    if(isDemo == 'DEMO'){
                        toastr.error('This Is Demo Version. You Can Not Change Anything');
                        return;
                    }

                    let loading = "<?php echo e(__('user.Processing...')); ?>"

                    $("#fsubscribe_btn").html(loading);
                    $("#fsubscribe_btn").attr('disabled',true);

                    $.ajax({
                        type: 'POST',
                        data: $('#footerTopSubscriberForm').serialize(),
                        url: "<?php echo e(route('subscribe-request')); ?>",
                        success: function (response) {
                            if(response.status == 1){
                                toastr.success(response.message);
                                let subscribe = "<?php echo e(__('user.Subscribe')); ?>"
                                $("#fsubscribe_btn").html(subscribe);
                                $("#fsubscribe_btn").attr('disabled',false);
                                $("#footerTopSubscriberForm").trigger("reset");
                                $('#footerTopSubShowSpain').addClass('d-none');
                                $('#footerTopSubSubmitBtn').removeClass('d-none');
                            }

                            if(response.status == 0){
                                toastr.error(response.message);
                                let subscribe = "<?php echo e(__('user.Subscribe')); ?>"
                                $("#fsubscribe_btn").html(subscribe);
                                $("#fsubscribe_btn").attr('disabled',false);
                                $("#footerTopSubscriberForm").trigger("reset");
                                $('#footerTopSubShowSpain').addClass('d-none');
                                $('#footerTopSubSubmitBtn').removeClass('d-none');
                            }
                        },
                        error: function(err) {
                            $('#footerTopSubShowSpain').addClass('d-none');
                            $('#footerTopSubSubmitBtn').removeClass('d-none');
                            toastr.error('Something went wrong');
                            let subscribe = "<?php echo e(__('user.Subscribe')); ?>"
                            $("#fsubscribe_btn").html(subscribe);
                            $("#fsubscribe_btn").attr('disabled',false);
                            $("#footerTopSubscriberForm").trigger("reset");
                        }
                    });
                });

                $("#country_id").on("change",function(){
                    var countryId = $("#country_id").val();
                    if(countryId){
                        $.ajax({
                            type:"get",
                            url:"<?php echo e(url('/state-by-country/')); ?>"+"/"+countryId,
                            success:function(response){
                                $("#state_id").html(response.states);
                            },
                            error:function(err){

                            }
                        })
                    }else{
                        var response= "<option value=''><?php echo e(__('user.Select a State')); ?></option>";
                        $("#state_id").html(response);
                    }

                });

                $("#state_id").on("change",function(){
                    var stateId = $("#state_id").val();
                    if(stateId){
                        $.ajax({
                            type:"get",
                            url:"<?php echo e(url('/city-by-state/')); ?>"+"/"+stateId,
                            success:function(response){
                                $("#city_id").html(response.cities);
                            },
                            error:function(err){

                            }
                        })
                    }else{
                        var response= "<option value=''><?php echo e(__('user.Select a city')); ?></option>";
                        $("#state_id").html(response);
                    }

                });

                $('.select2').select2();
                tinymce.init({
                    selector: '#editor',
                    plugins: 'anchor autolink charmap codesample emoticons image link lists media searchreplace table visualblocks wordcount checklist mediaembed casechange export formatpainter pageembed linkchecker a11ychecker tinymcespellchecker permanentpen powerpaste advtable advcode editimage tinycomments tableofcontents footnotes mergetags autocorrect typography inlinecss',
                    toolbar: 'undo redo | blocks fontfamily fontsize | bold italic underline strikethrough | link image media table mergetags | addcomment showcomments | spellcheckdialog a11ycheck typography | align lineheight | checklist numlist bullist indent outdent | emoticons charmap | removeformat',
                    tinycomments_mode: 'embedded',
                    tinycomments_author: 'Author name',
                    mergetags_list: [
                        { value: 'First.Name', title: 'First Name' },
                        { value: 'Email', title: 'Email' },
                    ]
                });
            });
        })(jQuery);

    </script>

    <script>
        "use strict";
            //wishlist start
            function addWishlist(product_id){
                $.ajax({
                    headers: {
                    'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
                    },
                    type:"POST",
                    url:"<?php echo e(url('/add/wishlist/')); ?>/"+product_id,
                    dataType:'json',
                    success:function(response){
                        if(response.success){
                            toastr.success(response.success);
                        }else{
                            toastr.error(response.error);
                        }
                    }
                })
            };
        //wishlist end
        //cart start
        function addToCard(product_id){
            let product_type=$('#product_type').val();
            let regular_price = $('#script_regular_price').val();
            let extend_price = $('#script_extend_price').val();
            let price = $('#image_price').val();
            let variant_id = $('#variant_id option:selected').val();
            let variant_name = $('#variant_id option:selected').text();
            let price_type = $('#price_type option:selected').val();
            let product_name = $('#product_name').val();
            let slug = $('#slug').val();
            let category_name = $('#category_name').val();
            let category_id = $('#category_id').val();
            let product_image = $('#product_image').val();
            let author_name = $('#author_name').val();
            let author_id = $('#author_id').val();
            $.ajax({
                headers: {
                'X-CSRF-Token': $('meta[name="_token"]').attr('content')
                },
                type:"POST",
                dataType:"json",
                data:{
                    product_type:product_type,
                    regular_price:regular_price,
                    extend_price:extend_price,
                    price:price,
                    variant_id:variant_id,
                    variant_name:variant_name,
                    price_type:price_type,
                    product_name:product_name,
                    slug:slug,
                    category_name:category_name,
                    category_id:category_id,
                    product_image:product_image,
                    author_name:author_name,
                    author_id:author_id,
                },
                url: "<?php echo e(url('/add-to-cart')); ?>" + "/" + product_id,
                success:function(response){
                    miniCart();
                    if(response.status == 1){
                        toastr.success(response.message);
                    }
                    if(response.status == 0){
                        toastr.error(response.message);
                    }
                }
            });
        };
    //add to cart function end
    //mini cart function start
        function miniCart(){
            $.ajax({
                type:"GET",
                dataType:"json",
                url: "<?php echo e(url('/mini-cart')); ?>",
                success:function(response){
                    $('#cartQty').text(response.cartQty);
                }
            });
        }
        miniCart();
        //mini cart function end

        //cart item  function start
        function cartItem(){
            $.ajax({
                type:"GET",
                dataType:"json",
                url: "<?php echo e(url('/cart-item')); ?>",
                success:function(response){
                    let cartItem="";
                    $('#cartTotal').text(response.cartTotal * response.currencyRate);
                    $.each(response.carts, function(key, value){
                        let itemPrice = response.currencyRate * value.price;
                        if (response.currencyPosition == 'right') {
                            cartItem+=`<tr>
                                    <td class="img">
                                        <a href="<?php echo e(url('/product/${value.options.slug}')); ?>">
                                            <img src="${ value.options.image }" alt="cart item"
                                                class="img-fluid w-100">
                                        </a>
                                    </td>
                                    <td class="description">
                                        <h3><a href="<?php echo e(url('/product/${value.options.slug}')); ?>">${value.name}</a></h3>
                                        <p>
                                            <span><?php echo e(__('user.Item by')); ?></span> ${value.options.author}
                                            <b class="${value.options.variant_name!=null?'':'d-none'}">${value.options.variant_name!=null?value.options.variant_name:''}</b>
                                            <b class="${value.options.price_type!=null?'':'d-none'}">${value.options.price_type!=null?value.options.price_type:''}</b>
                                        </p>

                                    </td>
                                    <td class="price">
                                        <p>${itemPrice+response.currencyIcon}</p>
                                    </td>
                                    <td class="discount">
                                        <p>${value.options.category}</p>
                                    </td>
                                    <td class="action">
                                        <a href="javascript:;" id="${value.rowId}" onclick="cartRemove(this.id)"><i class="far fa-times"></i></a>
                                    </td>
                            </tr>`;
                        } else {
                            cartItem+=`<tr>
                                    <td class="img">
                                        <a href="<?php echo e(url('/product/${value.options.slug}')); ?>">
                                            <img src="${ value.options.image }" alt="cart item"
                                                class="img-fluid w-100">
                                        </a>
                                    </td>
                                    <td class="description">
                                        <h3><a href="<?php echo e(url('/product/${value.options.slug}')); ?>">${value.name}</a></h3>
                                        <p>
                                            <span><?php echo e(__('user.Item by')); ?></span> ${value.options.author}
                                            <b class="${value.options.variant_name!=null?'':'d-none'}">${value.options.variant_name!=null?value.options.variant_name:''}</b>
                                            <b class="${value.options.price_type!=null?'':'d-none'}">${value.options.price_type!=null?value.options.price_type:''}</b>
                                        </p>

                                    </td>
                                    <td class="price">
                                        <p>${response.currencyIcon+itemPrice}</p>
                                    </td>
                                    <td class="discount">
                                        <p>${value.options.category}</p>
                                    </td>
                                    <td class="action">
                                        <a href="javascript:;" id="${value.rowId}" onclick="cartRemove(this.id)"><i class="far fa-times"></i></a>
                                    </td>
                            </tr>`;
                        }
                    });
                    $('#cartItem').html(cartItem);
                }
            });
        }
        cartItem();

        function cartRemove(rowId){
            $.ajax({
                type:"GET",
                dataType:"json",
                url: "<?php echo e(url('/cart-remove')); ?>"+ "/" + rowId,
                success:function(response){
                    miniCart();
                    cartItem();
                    couponCalculation();
                    if(response.status == 1){
                        toastr.success(response.message);
                    }
                }
            });
        };
        //cart item function end
        //coupon start
        function couponApply(){
            let coupon_name=$('#coupon_name').val();
            if(coupon_name){
                $.ajax({
                    headers: {
                    'X-CSRF-Token': $('meta[name="_token"]').attr('content')
                    },
                    type:"POST",
                    dataType:"json",
                    data:{
                        coupon_name:coupon_name,
                    },
                    url: "<?php echo e(url('/coupon-apply')); ?>",
                    success:function(response){
                        if(response.status == 1){
                            $('#coupon_name').val('');
                            couponCalculation();
                            toastr.success(response.message);
                        }
                        if(response.status == 0){
                            $('#coupon_name').val('');
                            toastr.error(response.message);
                        }
                    }
                });
            }else{
                let coupon_valid = $('#coupon_valid').val();
                toastr.error(coupon_valid);
            }
        };

        function couponCalculation(){
            $.ajax({
               type:"GET",
               url: "<?php echo e(url('/coupon-calculation')); ?>",
               dataType:'json',
               success:function(data){
                if(data.coupon_name){
                    if (data.currencyPosition == 'right') {
                        $('#calprice').html(`
                        <p class="subtotal"><?php echo e(__('user.Subtotal')); ?> <span><span id="cartTotal">${data.sub_total}</span>${data.currencyIcon}</span></p>
                        <p class="subtotal"><?php echo e(__('user.Coupon')); ?> <span>${data.coupon_name} <button type="submit" class="btn btn-danger btn-sm" onclick="couponRemove()"><i class="fa fa-times"></i></button></span></p>
                        <p class="discount"><?php echo e(__('user.Discount')); ?> <span>(-)${data.discount_amount} ${data.currencyIcon}</span></p>
                        <p class="total"><?php echo e(__('user.Total')); ?> <span>${data.total_amount}<span>${data.currencyIcon}</span></span></p>
                        <a class="common_btn" href="<?php echo e(route('checkout')); ?>"><?php echo e(__('user.Proceed to Checkout')); ?></a>
                    `);
                    } else {
                        $('#calprice').html(`
                        <p class="subtotal"><?php echo e(__('user.Subtotal')); ?> <span>${data.currencyIcon}<span id="cartTotal">${data.sub_total}</span></span></p>
                        <p class="subtotal"><?php echo e(__('user.Coupon')); ?> <span>${data.coupon_name} <button type="submit" class="btn btn-danger btn-sm" onclick="couponRemove()"><i class="fa fa-times"></i></button></span></p>
                        <p class="discount"><?php echo e(__('user.Discount')); ?> <span>(-)${data.currencyIcon} ${data.discount_amount}</span></p>
                        <p class="total"><?php echo e(__('user.Total')); ?> <span><span>${data.currencyIcon}</span>${data.total_amount}</span></p>
                        <a class="common_btn" href="<?php echo e(route('checkout')); ?>"><?php echo e(__('user.Proceed to Checkout')); ?></a>
                    `);
                    }

                }else{

                    if (data.currencyPosition == 'right') {
                        $('#calprice').html(`
                        <p class="subtotal"><?php echo e(__('user.Subtotal')); ?> <span><span id="cartTotal">${data.sub_total}</span>${data.currencyIcon}</span></p>
                        <p class="discount"><?php echo e(__('user.Discount')); ?> <span>(-)0 ${data.currencyIcon}</span></p>
                        <p class="total"><?php echo e(__('user.Total')); ?> <span><span><span>${data.sub_total}</span>${data.currencyIcon}</span></p>
                        <a class="common_btn" href="<?php echo e(route('checkout')); ?>"><?php echo e(__('user.Proceed to Checkout')); ?></a>
                    `);
                    } else {
                        $('#calprice').html(`
                        <p class="subtotal"><?php echo e(__('user.Subtotal')); ?> <span>${data.currencyIcon}<span id="cartTotal">${data.sub_total}</span></span></p>
                        <p class="discount"><?php echo e(__('user.Discount')); ?> <span>(-)${data.currencyIcon} 0</span></p>
                        <p class="total"><?php echo e(__('user.Total')); ?> <span><span>${data.currencyIcon}<span>${data.sub_total}</span></span></p>
                        <a class="common_btn" href="<?php echo e(route('checkout')); ?>"><?php echo e(__('user.Proceed to Checkout')); ?></a>
                    `);
                    }
                }
            }
         });
        };
        couponCalculation();
        function couponRemove(){
            $.ajax({
               type:"GET",
               url: "<?php echo e(url('/coupon-remove')); ?>",
               dataType:'json',
               success:function(response){
                 $('#coupon_name').val('');
                couponCalculation();
                if(response.status == 1){
                    toastr.success(response.message);
                }
            }
         })
        }
        //coupon end
    </script>

</body>

</html>
<?php /**PATH C:\xampp\htdocs\Projects\New folder\alasmart_cc\main_files\main_files\resources\views/layout2.blade.php ENDPATH**/ ?>