2c712d234de0dd35073a197cfa893d31e4f0bdc6.php 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  1. <div class="card rounded border-0 shadow-sm">
  2. <div class="card-header">
  3. <h3 class="fs-16 fw-600 mb-0"><?php echo e(translate('Summary')); ?></h3>
  4. <div class="text-right">
  5. <span class="badge badge-inline badge-primary">
  6. <?php echo e(count($carts)); ?>
  7. <?php echo e(translate('Items')); ?>
  8. </span>
  9. <?php
  10. $coupon_discount = 0;
  11. ?>
  12. <?php if(Auth::check() && get_setting('coupon_system') == 1): ?>
  13. <?php
  14. $coupon_code = null;
  15. ?>
  16. <?php $__currentLoopData = $carts; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $cartItem): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
  17. <?php
  18. $product = \App\Models\Product::find($cartItem['product_id']);
  19. ?>
  20. <?php if($cartItem->coupon_applied == 1): ?>
  21. <?php
  22. $coupon_code = $cartItem->coupon_code;
  23. break;
  24. ?>
  25. <?php endif; ?>
  26. <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
  27. <?php
  28. $coupon_discount = carts_coupon_discount($coupon_code);
  29. ?>
  30. <?php endif; ?>
  31. <?php $subtotal_for_min_order_amount = 0; ?>
  32. <?php $__currentLoopData = $carts; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $cartItem): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
  33. <?php $subtotal_for_min_order_amount += cart_product_price($cartItem, $cartItem->product, false, false) * $cartItem['quantity']; ?>
  34. <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
  35. <?php if(get_setting('minimum_order_amount_check') == 1 && $subtotal_for_min_order_amount < get_setting('minimum_order_amount')): ?>
  36. <span class="badge badge-inline badge-primary">
  37. <?php echo e(translate('Minimum Order Amount') . ' ' . single_price(get_setting('minimum_order_amount'))); ?>
  38. </span>
  39. <?php endif; ?>
  40. </div>
  41. </div>
  42. <div class="card-body">
  43. <?php if(addon_is_activated('club_point')): ?>
  44. <?php
  45. $total_point = 0;
  46. ?>
  47. <?php $__currentLoopData = $carts; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $cartItem): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
  48. <?php
  49. $product = \App\Models\Product::find($cartItem['product_id']);
  50. $total_point += $product->earn_point * $cartItem['quantity'];
  51. ?>
  52. <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
  53. <div class="bg-soft-primary border-soft-primary mb-2 rounded border px-2">
  54. <?php echo e(translate('Total Club point')); ?>:
  55. <span class="fw-700 float-right"><?php echo e($total_point); ?></span>
  56. </div>
  57. <?php endif; ?>
  58. <table class="table">
  59. <thead>
  60. <tr>
  61. <th class="product-name"><?php echo e(translate('Product')); ?></th>
  62. <th class="product-total text-right"><?php echo e(translate('Total')); ?></th>
  63. </tr>
  64. </thead>
  65. <tbody>
  66. <?php
  67. $subtotal = 0;
  68. $tax = 0;
  69. $shipping = 0;
  70. $product_shipping_cost = 0;
  71. $shipping_region = $shipping_info['city'];
  72. ?>
  73. <?php $__currentLoopData = $carts; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $cartItem): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
  74. <?php
  75. $product = \App\Models\Product::find($cartItem['product_id']);
  76. $subtotal += cart_product_price($cartItem, $product, false, false) * $cartItem['quantity'];
  77. $tax += cart_product_tax($cartItem, $product, false) * $cartItem['quantity'];
  78. $product_shipping_cost = $cartItem['shipping_cost'];
  79. $shipping += $product_shipping_cost;
  80. $product_name_with_choice = $product->getTranslation('name');
  81. if ($cartItem['variant'] != null) {
  82. $product_name_with_choice = $product->getTranslation('name') . ' - ' . $cartItem['variant'];
  83. }
  84. ?>
  85. <tr class="cart_item">
  86. <td class="product-name">
  87. <?php echo e($product_name_with_choice); ?>
  88. <strong class="product-quantity">
  89. × <?php echo e($cartItem['quantity']); ?>
  90. </strong>
  91. </td>
  92. <td class="product-total text-right">
  93. <span
  94. class="pl-4 pr-0"><?php echo e(single_price(cart_product_price($cartItem, $cartItem->product, false, false) * $cartItem['quantity'])); ?></span>
  95. </td>
  96. </tr>
  97. <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
  98. </tbody>
  99. </table>
  100. <input type="hidden" id="sub_total" value="<?php echo e($subtotal); ?>">
  101. <table class="table">
  102. <tfoot>
  103. <tr class="cart-subtotal">
  104. <th><?php echo e(translate('Subtotal')); ?></th>
  105. <td class="text-right">
  106. <span class="fw-600"><?php echo e(single_price($subtotal)); ?></span>
  107. </td>
  108. </tr>
  109. <tr class="cart-shipping">
  110. <th><?php echo e(translate('Tax')); ?></th>
  111. <td class="text-right">
  112. <span class="font-italic"><?php echo e(single_price($tax)); ?></span>
  113. </td>
  114. </tr>
  115. <tr class="cart-shipping">
  116. <th><?php echo e(translate('Total Shipping')); ?></th>
  117. <td class="text-right">
  118. <span class="font-italic"><?php echo e(single_price($shipping)); ?></span>
  119. </td>
  120. </tr>
  121. <?php if(Session::has('club_point')): ?>
  122. <tr class="cart-shipping">
  123. <th><?php echo e(translate('Redeem point')); ?></th>
  124. <td class="text-right">
  125. <span class="font-italic"><?php echo e(single_price(Session::get('club_point'))); ?></span>
  126. </td>
  127. </tr>
  128. <?php endif; ?>
  129. <?php if($coupon_discount > 0): ?>
  130. <tr class="cart-shipping">
  131. <th><?php echo e(translate('Coupon Discount')); ?></th>
  132. <td class="text-right">
  133. <span class="font-italic"><?php echo e(single_price($coupon_discount)); ?></span>
  134. </td>
  135. </tr>
  136. <?php endif; ?>
  137. <?php
  138. $total = $subtotal + $tax + $shipping;
  139. if (Session::has('club_point')) {
  140. $total -= Session::get('club_point');
  141. }
  142. if ($coupon_discount > 0) {
  143. $total -= $coupon_discount;
  144. }
  145. ?>
  146. <tr class="cart-total">
  147. <th><span class="strong-600"><?php echo e(translate('Total')); ?></span></th>
  148. <td class="text-right">
  149. <strong><span><?php echo e(single_price($total)); ?></span></strong>
  150. </td>
  151. </tr>
  152. </tfoot>
  153. </table>
  154. <?php if(addon_is_activated('club_point')): ?>
  155. <?php if(Session::has('club_point')): ?>
  156. <div class="mt-3">
  157. <form class="" action="<?php echo e(route('checkout.remove_club_point')); ?>" method="POST"
  158. enctype="multipart/form-data">
  159. <?php echo csrf_field(); ?>
  160. <div class="input-group">
  161. <div class="form-control"><?php echo e(Session::get('club_point')); ?></div>
  162. <div class="input-group-append">
  163. <button type="submit"
  164. class="btn btn-primary"><?php echo e(translate('Remove Redeem Point')); ?></button>
  165. </div>
  166. </div>
  167. </form>
  168. </div>
  169. <?php endif; ?>
  170. <?php endif; ?>
  171. <?php if(Auth::check() && get_setting('coupon_system') == 1): ?>
  172. <?php if($coupon_discount > 0 && $coupon_code): ?>
  173. <div class="mt-3">
  174. <form class="" id="remove-coupon-form" enctype="multipart/form-data">
  175. <?php echo csrf_field(); ?>
  176. <div class="input-group">
  177. <div class="form-control"><?php echo e($coupon_code); ?></div>
  178. <div class="input-group-append">
  179. <button type="button" id="coupon-remove"
  180. class="btn btn-primary"><?php echo e(translate('Change Coupon')); ?></button>
  181. </div>
  182. </div>
  183. </form>
  184. </div>
  185. <?php else: ?>
  186. <div class="mt-3">
  187. <form class="" id="apply-coupon-form" enctype="multipart/form-data">
  188. <?php echo csrf_field(); ?>
  189. <input type="hidden" name="owner_id" value="<?php echo e($carts[0]['owner_id']); ?>">
  190. <div class="input-group">
  191. <input type="text" class="form-control" name="code"
  192. onkeydown="return event.key != 'Enter';"
  193. placeholder="<?php echo e(translate('Have coupon code? Enter here')); ?>" required>
  194. <div class="input-group-append">
  195. <button type="button" id="coupon-apply"
  196. class="btn btn-primary"><?php echo e(translate('Apply')); ?></button>
  197. </div>
  198. </div>
  199. </form>
  200. </div>
  201. <?php endif; ?>
  202. <?php endif; ?>
  203. </div>
  204. </div>
  205. <?php /**PATH /Users/shaoguo/Desktop/公司资料/小梦/商城/ebayShop/resources/views/frontend/partials/cart_summary.blade.php ENDPATH**/ ?>