

<?php
$brand = $product->brand->brand_name;
$fullName = ucfirst($brand).' '.ucfirst($product->prod_name);
?>

<?php $prices = app('App\Lib\Prices'); ?>

<?php $__env->startSection('title'); ?><?php echo e($fullName); ?> <?php $__env->stopSection(); ?>
<?php $__env->startSection('description'); ?><?php echo e($product->prod_name); ?> <?php $__env->stopSection(); ?>
<?php $__env->startSection('keywords'); ?><?php echo e($product->prod_name); ?> <?php $__env->stopSection(); ?>
<?php $__env->startSection('h1'); ?><?php echo e($fullName); ?> <?php $__env->stopSection(); ?>
<?php $__env->startSection('breadcumbs'); ?> <?php $__env->stopSection(); ?>

<?php $__env->startSection('content'); ?>
    <section id="maincontent" class="pad">
    <div class="container-fluid">
        <div class="row">
            <div id="product" class="col-xs-12">

                <div class="row">

                    <div class="col-xs-12 col-md-5">
                        <div id="galery">
                            <div id="main-image">
                                <img id="mainimg" data-gid="1" alt="<?php echo e($fullName); ?>" title="<?php echo e($fullName); ?>" src="<?php echo e(url($product->prod_bimg)); ?>">
                            </div>
                        </div><!--galery-->

                        <?php
                            $images = $product->images()->where('prod_def_img', '=', 0)->get();
                            $i = 2;
                        ?>
                        <?php if(count($images)): ?>
                        <div id="thumbs">
                            <div class="row">
                                <div class="col-xs-3 tw">
                                    <a class="ilb" id="ilb1" href="<?php echo e(url($product->prod_bimg)); ?>" data-imagelightbox="e">
                                        <img class="timg" data-ord="1" data-img="<?php echo e(url($product->prod_mimg)); ?>" alt="<?php echo e($fullName); ?> - slika 1" src="<?php echo e(url($product->prod_timg)); ?>">
                                    </a>
                                </div>

                                <?php $__currentLoopData = $images; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $image): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <div class="col-xs-3 tw">
                                        <a class="ilb" id="ilb<?php echo e($i); ?>" href="<?php echo e(url($image->prod_bimg)); ?>" data-imagelightbox="e">
                                            <img class="timg" data-ord="<?php echo e($i); ?>" data-img="<?php echo e(url($image->prod_mimg)); ?>" alt="<?php echo e($fullName); ?> - slika <?php echo e($i); ?>" src="<?php echo e(url($image->prod_timg)); ?>">
                                        </a>
                                    </div>
                                <?php ++$i; ?>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

                            </div><!--row-->
                        </div><!--// thumbs-->
                        <?php endif; ?>
                    </div><!--col-->

                    <div class="col-xs-12 col-md-7" id="proddet">
                        <h2><?php echo e($fullName); ?></h2>
                        <div class="detblc">
                            <p><?php echo $product->prod_sdesc; ?>...</p>
                        </div>
                        <div class="detblc">

                            <span class="dbtitle"><?php echo e(__('frontside.common.brand')); ?>:</span> <a href="<?php echo e(url($product->category->cat_slug.'/'.$product->brand->brand_slug)); ?>"><?php echo e($product->brand->brand_name); ?></a><br>
                            <span class="dbtitle"><?php echo e(__('frontside.product.prod_code')); ?>:</span> <span><?php echo e($product->prod_sku); ?></span><br>
                            <span class="dbtitle"><?php echo e(__('frontside.product.availability')); ?>:</span> <span><?php echo e(($product->prod_status) ? __('frontside.product.in_stock') : __('frontside.product.out_stock')); ?></span>
                        </div><!--detblc-->
                        <div class="detblc" id="pricesblock">
                            <?php

                                $cproduct = $product->getProdData();
                                
                                $oldPrice = $prices->getOldPrice($product);

                                $price = $prices->getPrice($cproduct);

                                $saving = ($oldPrice > $price) ? $oldPrice-$price : false;
                            ?>
                            <div class="old-price"><?php echo e(($saving) ? $prices::formatPrice($oldPrice) : ''); ?></div>
                            <div class="savings"><?php echo ($saving) ? __('frontside.common.saving').': '.$prices::formatPrice($saving) : ''; ?></div>
                            <div class="price"><?php echo e($prices->formatPrice($price)); ?></div>
                            <span class="price-tax"></span>
                        </div><!--detblc-->
                        <div class="detblc" id="cart">
                            <form action="<?php echo e(locRoute('cart.post')); ?>" method="post" class="form-inline">
                                <div class="form-group">
                                    <label for="quantity"><?php echo e(__('frontside.product.qnt')); ?>: </label>
                                    <input id="qnty" size="2" name="qnty" value="1" class="form-control input-sm" type="text">
                                    <input type="hidden" name="act" value="add">
                                </div>
                                <input name="ind" value="<?php echo e($product->prod_id); ?>" type="hidden">
                                <?php echo e(csrf_field()); ?>

                                <button id="adtocart" name="submit" type="submit" class="btn btn-primary btn-sm"> <i class="glyphicon glyphicon-shopping-cart"></i> Dodaj u korpu</button>
                                
                                
                            </form>
                        </div><!--detblc-->
                    </div><!--proddet-->

                </div><!--row-->

                <div class="row">
                    <div class="col-xs-12" id="proddesc">

                        <!-- Nav tabs -->
                        <ul class="nav nav-tabs" role="tablist">
                            <li role="presentation" class="active"><a href="#md" role="tab" data-toggle="tab"><?php echo e(__('frontside.product.description')); ?></a></li>
                            <li role="presentation"><a href="#sd" role="tab" data-toggle="tab"><?php echo e(__('frontside.product.specification')); ?></a></li>
                            <?php if(count($product->documents)): ?>
                                <li role="presentation"><a href="#doc" role="tab" data-toggle="tab"><?php echo e(__('frontside.product.documents')); ?></a></li>
                            <?php endif; ?>
                        </ul> <!-- Tab panes -->

                        <div class="tab-content">
                            <div role="tabpanel" class="tab-pane proddesc active" id="md"><?php echo $product->description->prod_mdesc; ?></div>
                            <div role="tabpanel" class="tab-pane proddesc" id="sd"><?php echo $product->description->prod_desc; ?></div>
                            <?php if(count($product->documents)): ?>
                                <div role="tabpanel" class="tab-pane documentstab" id="doc">
                                    <div style="padding:15px;">
                                        <ul class="list-inline">
                                        <?php $__currentLoopData = $product->documents; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $doc): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                            <?php if(is_file(public_path($doc->pd_path))): ?>
                                            <li>
                                                <a href="<?php echo e(url($doc->pd_path)); ?>" title="<?php echo e($doc->pd_name); ?>" target="_blank">
                                                    <img src="<?php echo e(asset('assets/img/pdficon.png')); ?>" width="120" height="120" alt="<?php echo e($doc->pd_name); ?>">
                                                </a>
                                                <p class="text-center"><?php echo e($doc->pd_name); ?></p>
                                            </li>
                                            <?php endif; ?>
                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                        </ul>
                                        <br clear="all"/><br/>
                                    </div>
                                </div>
                            <?php endif; ?>
                        </div><!--tab-content-->
                    </div><!--proddesc-->
                </div><!--row-->
                <?php $ifSimilar = count($similarproducts); ?>
                <?php if($ifSimilar): ?>
                <div class="pcintro"><h3><?php echo e(__('frontside.product.similar_prod')); ?>:</h3><hr></div>

                <div class="row products">

                <?php echo $__env->renderWhen($ifSimilar, 'frontend.components.products_list', ['products' => $similarproducts, 'type' => 'r', 'num' => 6 ], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path'))); ?>
                </div><!--end products -->
                <?php endif; ?>
            </div><!-- / #product -->

        </div><!-- / .row -->
    </div><!-- / .container-fluid -->
    </section>
<?php $__env->stopSection(); ?>

<?php $__env->startPush('css'); ?>
    <link rel="stylesheet" href="<?php echo e(asset('assets/css/product.css')); ?>">
    <link rel="stylesheet" href="<?php echo e(asset('assets/css/imagelightbox.css')); ?>">
    <link rel="stylesheet" href="<?php echo e(asset('assets/css/comments.css.css')); ?>">
<?php $__env->stopPush(); ?>

<?php $__env->startPush('scripts'); ?>
    <script src="<?php echo e(asset('assets/js/imagelightbox.min.js')); ?>"></script>
    <script src="<?php echo e(asset('assets/js/galeryop.js')); ?>"></script>
    <script src="<?php echo e(asset('assets/js/comments.js')); ?>"></script>
    <script src="<?php echo e(asset('assets/js/pop.js')); ?>"></script>
<?php $__env->stopPush(); ?>

<?php echo $__env->make('layouts.frontend', \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>