123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364 |
- <?php $__env->startSection('panel_content'); ?>
- <!--<div class="aiz-titlebar mt-2 mb-4">-->
- <!-- <div class="row align-items-center">-->
- <!-- <div class="col-md-6">-->
- <!-- <h1 class="h3"><?php echo e(translate('Products')); ?></h1>-->
- <!-- </div>-->
- <!-- </div>-->
- <!--</div>-->
- <div class="row gutters-10 justify-content-center">
- <?php if(addon_is_activated('seller_subscription')): ?>
- <div class="col-md-4 mx-auto mb-3" >
- <div class="bg-grad-1 text-white rounded-lg overflow-hidden">
- <span class="size-30px rounded-circle mx-auto bg-soft-primary d-flex align-items-center justify-content-center mt-3">
- <i class="las la-upload la-2x text-white"></i>
- </span>
- <div class="px-3 pt-3 pb-3">
- <div class="h4 fw-700 text-center"><?php echo e(max(0, auth()->user()->shop->product_upload_limit - auth()->user()->products()->count())); ?></div>
- <div class="opacity-50 text-center"><?php echo e(translate('Remaining Uploads')); ?></div>
- </div>
- </div>
- </div>
- <?php endif; ?>
- <div class="col-md-4 mx-auto mb-3" >
- <!--<a href="<?php echo e(route('seller.products.create')); ?>">-->
- <!-- <div class="p-3 rounded mb-3 c-pointer text-center bg-white shadow-sm hov-shadow-lg has-transition">-->
- <!-- <span class="size-60px rounded-circle mx-auto bg-secondary d-flex align-items-center justify-content-center mb-3">-->
- <!-- <i class="las la-plus la-3x text-white"></i>-->
- <!-- </span>-->
- <!-- <div class="fs-18 text-primary"><?php echo e(translate('Add New Product')); ?></div>-->
- <!-- </div>-->
- <!--</a>-->
- </div>
- <?php if(addon_is_activated('seller_subscription')): ?>
- <?php
- $seller_package = \App\Models\SellerPackage::find(Auth::user()->shop->seller_package_id);
- ?>
- <div class="col-md-4">
- <a href="<?php echo e(route('seller.seller_packages_list')); ?>" class="text-center bg-white shadow-sm hov-shadow-lg text-center d-block p-3 rounded">
- <?php if($seller_package != null): ?>
- <img src="<?php echo e(uploaded_asset($seller_package->logo)); ?>" height="44" class="mw-100 mx-auto">
- <span class="d-block sub-title mb-2"><?php echo e(translate('Current Package')); ?>: <?php echo e($seller_package->getTranslation('name')); ?></span>
- <?php else: ?>
- <i class="la la-frown-o mb-2 la-3x"></i>
- <div class="d-block sub-title mb-2"><?php echo e(translate('No Package Found')); ?></div>
- <?php endif; ?>
- <div class="btn btn-outline-primary py-1"><?php echo e(translate('Upgrade Package')); ?></div>
- </a>
- </div>
- <?php endif; ?>
- </div>
- <div class="card">
- <div class="card-header row gutters-5">
- <div class="col">
- <h5 class="mb-md-0 h6"><?php echo e(translate('All Products')); ?></h5>
- </div>
- <div class="col-md-4">
- <form class="" id="sort_brands" action="" method="GET">
- <div class="input-group input-group-sm">
- <input type="text" class="form-control" id="search" name="search" <?php if(isset($search)): ?> value="<?php echo e($search); ?>" <?php endif; ?> placeholder="<?php echo e(translate('Search product')); ?>">
- </div>
- </form>
- </div>
- </div>
- <div class="card-body">
- <table class="table aiz-table mb-0">
- <thead>
- <tr>
- <th>#</th>
- <th data-breakpoints="md">
- <?php echo e(translate('Thumbnail Image')); ?>
- </th>
- <th width="30%"><?php echo e(translate('Name')); ?></th>
- <th data-breakpoints="md"><?php echo e(translate('Category')); ?></th>
- <th data-breakpoints="md"><?php echo e(translate('Current Qty')); ?></th>
- <th><?php echo e(translate('Base Price')); ?></th>
- <?php if(get_setting('product_approve_by_admin') == 1): ?>
- <th data-breakpoints="md"><?php echo e(translate('Approval')); ?></th>
- <?php endif; ?>
- <th data-breakpoints="md"><?php echo e(translate('Published')); ?></th>
- <th data-breakpoints="md"><?php echo e(translate('Featured')); ?></th>
- <th data-breakpoints="md">直通车推广</th>
- <th data-breakpoints="md" class="text-right"><?php echo e(translate('Options')); ?></th>
- </tr>
- </thead>
- <tbody>
- <?php $__currentLoopData = $products; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $product): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
- <tr>
- <td><?php echo e(($key+1) + ($products->currentPage() - 1)*$products->perPage()); ?></td>
- <td>
- <img
- height="80px"
- class="lazyload"
- src="<?php echo e(static_asset('assets/img/placeholder.jpg')); ?>"
- data-src="<?php echo e(uploaded_asset($product->thumbnail_img)); ?>"
- alt="<?php echo e($product->getTranslation('name')); ?>"
- onerror="this.onerror=null;this.src='<?php echo e(static_asset('assets/img/placeholder.jpg')); ?>';"
- >
- </td>
- <td>
- <a href="<?php echo e(route('product', $product->slug)); ?>" target="_blank" class="text-reset">
- <?php echo e($product->getTranslation('name')); ?>
- </a>
- </td>
- <td>
- <?php if($product->category != null): ?>
- <?php echo e($product->category->getTranslation('name')); ?>
- <?php endif; ?>
- </td>
- <td>
- <?php
- $qty = 0;
- foreach ($product->stocks as $key => $stock) {
- $qty += $stock->qty;
- }
- echo $qty;
- ?>
- </td>
- <td><?php echo e($product->unit_price); ?></td>
- <?php if(get_setting('product_approve_by_admin') == 1): ?>
- <td>
- <?php if($product->approved == 1): ?>
- <span class="badge badge-inline badge-success"><?php echo e(translate('Approved')); ?></span>
- <?php else: ?>
- <span class="badge badge-inline badge-info"><?php echo e(translate('Pending')); ?></span>
- <?php endif; ?>
- </td>
- <?php endif; ?>
- <td>
- <label class="aiz-switch aiz-switch-success mb-0">
- <input onchange="update_published(this)" value="<?php echo e($product->id); ?>" type="checkbox" <?php if($product->published == 1) echo "checked";?> >
- <span class="slider round"></span>
- </label>
- </td>
- <td>
- <label class="aiz-switch aiz-switch-success mb-0">
- <input onchange="update_featured(this)" value="<?php echo e($product->id); ?>" type="checkbox" <?php if($product->seller_featured == 1) echo "checked";?> >
- <span class="slider round"></span>
- </label>
- </td>
- <td>
- <label class="aiz-switch aiz-switch-success mb-0">
- <?php if( count($seller_spread_packages_payments)==0 && $product->seller_spread_package_payment): ?>
- <?php if($product->seller_spread_package_payment && $product->seller_spread_package_payment->expire_at > time()): ?>
- <input type="checkbox" checked readonly disabled >
- <?php else: ?>
- <input onchange="toJump()" type="checkbox" >
- <?php endif; ?>
- <?php else: ?>
- <?php if( $product->seller_spread_package_payment && $product->seller_spread_package_payment->expire_at > time()): ?>
- <input type="checkbox" checked readonly disabled >
- <?php else: ?>
- <input onchange="select_spread_package(<?php echo e($product->id); ?>)" type="checkbox">
- <?php endif; ?>
- <?php endif; ?>
- <span class="slider round"></span>
- </label>
- </td>
- <td class="text-right">
- <a class="btn btn-soft-warning btn-icon btn-circle btn-sm" style="width: auto" href="javascript:void(0);" onclick="product_review('<?php echo e($product->id); ?>')" title="<?php echo e(translate('Review')); ?>">
- <?php echo e(translate('Review')); ?>
- </a>
- <!--<a class="btn btn-soft-info btn-icon btn-circle btn-sm" href="<?php echo e(route('seller.products.edit', ['id'=>$product->id, 'lang'=>env('DEFAULT_LANGUAGE')])); ?>" title="<?php echo e(translate('Edit')); ?>">-->
- <!-- <i class="las la-edit"></i>-->
- <!--</a>-->
- <!-- <a href="<?php echo e(route('seller.products.duplicate', $product->id)); ?>" class="btn btn-soft-success btn-icon btn-circle btn-sm" title="<?php echo e(translate('Duplicate')); ?>">-->
- <!-- <i class="las la-copy"></i>-->
- <!--</a>-->
- <!-- <a href="#" class="btn btn-soft-danger btn-icon btn-circle btn-sm confirm-delete" data-href="<?php echo e(route('seller.products.destroy', $product->id)); ?>" title="<?php echo e(translate('Delete')); ?>">-->
- <!-- <i class="las la-trash"></i>-->
- <!-- </a>-->
- </td>
- </tr>
- <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
- </tbody>
- </table>
- <div class="aiz-pagination">
- <?php echo e($products->links()); ?>
- </div>
- </div>
- </div>
- <?php $__env->stopSection(); ?>
- <?php $__env->startSection('modal'); ?>
- <?php echo $__env->make('modals.delete_modal', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
- <!-- 选择直通车 -->
- <div class="modal fade" id="select_payment_type_modal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
- <form class="" id="package_payment_form" action="<?php echo e(route('seller.products.spread')); ?>" method="post">
- <div class="modal-dialog modal-dialog-centered" role="document">
- <div class="modal-content">
- <div class="modal-header">
- <h5 class="modal-title" id="exampleModalLabel"><?php echo e(translate('Select Spread Package')); ?></h5>
- <button type="button" class="close" data-dismiss="modal" aria-label="Close"></button>
- </div>
- <div class="modal-body">
- <input type="hidden" id="product_id" name="product_id" value="">
- <div class="row">
- <div class="col-md-2">
- <label><?php echo e(translate('Spread Package')); ?></label>
- </div>
- <div class="col-md-10">
- <div class="mb-3">
- <select class="form-control aiz-selectpicker" name="seller_spread_package_payment_id"
- data-minimum-results-for-search="Infinity" required>
- <option value=""><?php echo e(translate('Select One')); ?></option>
- <?php $__currentLoopData = $seller_spread_packages_payments; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $seller_spread_packages_payment): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
- <option value="<?php echo e($seller_spread_packages_payment['id']); ?>"><?php echo e($seller_spread_packages_payment['seller_spread_package']['name']); ?></option>
- <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
- </select>
- </div>
- </div>
- </div>
- <div class="form-group text-right">
- <button type="button" class="btn btn-sm btn-primary transition-3d-hover mr-1" id="select_type_cancel" data-dismiss="modal"><?php echo e(translate('Cancel')); ?></button>
- <button type="submit" class="btn btn-sm btn-primary transition-3d-hover mr-1"><?php echo e(translate('Confirm')); ?></button>
- </div>
- </div>
- </div>
- </div>
- </form>
- </div>
- <!-- Product Review Modal -->
- <div class="modal fade" id="product-review-modal">
- <div class="modal-dialog">
- <div class="modal-content">
- <div class="modal-header">
- <h5 class="modal-title h6"><?php echo e(translate('Review')); ?></h5>
- <button type="button" class="close" data-dismiss="modal">
- </button>
- </div>
- <form action="<?php echo e(route('reviews.store')); ?>" enctype="multipart/form-data" method="POST">
- <div id="product-review-modal-content">
- </div>
- <div class="modal-body">
- <div class="form-group">
- <label class="opacity-60"><?php echo e(translate('Product')); ?></label>
- <p>1</p>
- </div>
- <div class="form-group">
- <label class="opacity-60"><?php echo e(translate('Customer')); ?></label>
- <div>
- <?php
- $customers = \App\Models\User::where('user_type', 'customer')->where('email_verified_at', '!=', null)->orderBy('created_at', 'desc')->get();
- ?>
- <select name="user_id" class="form-control aiz-selectpicker pos-customer" data-live-search="true">
- <?php $__currentLoopData = $customers; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $customer): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
- <option value="<?php echo e($customer->id); ?>" data-contact="<?php echo e($customer->email); ?>">
- <?php echo e($customer->name); ?> <?php if($customer->is_virtual == 1): ?> (<font color="red"><?php echo e(translate('Virtual')); ?></font>) <?php endif; ?>
- </option>
- <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
- </select>
- </div>
- </div>
- <div class="form-group">
- <label class="opacity-60"><?php echo e(translate('Rating')); ?></label>
- <div class="rating rating-input">
- <label> <input type="radio" name="rating" value="1" required> <i class="las la-star"></i> </label>
- <label> <input type="radio" name="rating" value="2"> <i class="las la-star"></i> </label> <label>
- <input type="radio" name="rating" value="3"> <i class="las la-star"></i> </label> <label>
- <input type="radio" name="rating" value="4"> <i class="las la-star"></i> </label> <label>
- <input type="radio" name="rating" value="5"> <i class="las la-star"></i> </label>
- </div>
- </div>
- <div class="form-group">
- <label class="opacity-60"><?php echo e(translate('Comment')); ?></label>
- <textarea class="form-control" rows="4" name="comment" placeholder="<?php echo e(translate('Your review')); ?>" required></textarea>
- </div>
- </div>
- <div class="modal-footer">
- <button type="submit" class="btn btn-sm btn-primary"><?php echo e(translate('Submit review')); ?></button>
- <button type="button" class="btn btn-sm btn-light" data-dismiss="modal"><?php echo e(translate('Cancel')); ?></button>
- </div>
- </form>
- </div>
- </div>
- </div>
- <?php $__env->stopSection(); ?>
- <?php $__env->startSection('script'); ?>
- <script type="text/javascript">
- function product_review(product_id) {
- $.post('<?php echo e(route('seller.products.product_seller_review_modal')); ?>', {
- _token: '<?php echo e(@csrf_token()); ?>',
- product_id: product_id
- }, function(data) {
- console.log(data);
- $('#product-review-modal-content').html(data);
- $('#product-review-modal').modal('show', {
- backdrop: 'static'
- });
- AIZ.extra.inputRating();
- });
- }
- function update_featured(el){
- if(el.checked){
- var status = 1;
- }
- else{
- var status = 0;
- }
- $.post('<?php echo e(route('seller.products.featured')); ?>', {_token:'<?php echo e(csrf_token()); ?>', id:el.value, status:status}, function(data){
- if(data == 1){
- AIZ.plugins.notify('success', '<?php echo e(translate('Featured products updated successfully')); ?>');
- }
- else{
- AIZ.plugins.notify('danger', '<?php echo e(translate('Something went wrong')); ?>');
- location.reload();
- }
- });
- }
- function update_published(el){
- if(el.checked){
- var status = 1;
- }
- else{
- var status = 0;
- }
- $.post('<?php echo e(route('seller.products.published')); ?>', {_token:'<?php echo e(csrf_token()); ?>', id:el.value, status:status}, function(data){
- if(data == 1){
- AIZ.plugins.notify('success', '<?php echo e(translate('Published products updated successfully')); ?>');
- }
- else if(data == 2){
- AIZ.plugins.notify('danger', '<?php echo e(translate('Please upgrade your package.')); ?>');
- location.reload();
- }
- else{
- AIZ.plugins.notify('danger', '<?php echo e(translate('Something went wrong')); ?>');
- location.reload();
- }
- });
- }
- function toJump(){
- AIZ.plugins.notify('danger', '请开通直通车');
- window.location.href = "<?php echo e(route('seller.seller_spread_packages_list')); ?>"
- }
- function select_spread_package(product_id){
- $('input[name=product_id]').val(product_id);
- $('#select_payment_type_modal').modal('show');
- }
- </script>
- <?php $__env->stopSection(); ?>
- <?php echo $__env->make('seller.layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /Users/shaoguo/Desktop/公司资料/小梦/商城/ebayShop/resources/views/seller/product/products/index.blade.php ENDPATH**/ ?>
|