fork download
  1. <?php
  2. /**
  3.  * Cart Page (cart.php)
  4.  *
  5.  * This template can be overridden by copying it to yourtheme/woocommerce/cart/cart.php.
  6.  *
  7.  * HOWEVER, on occasion WooCommerce will need to update template files and you
  8.  * (the theme developer) will need to copy the new files to your theme to
  9.  * maintain compatibility. We try to do this as little as possible, but it does
  10.  * happen. When this occurs the version of the template file will be bumped and
  11.  * the readme will list any important changes.
  12.  *
  13.  * @see https://d...content-available-to-author-only...e.com/document/template-structure/
  14.  * @package WooCommerce\Templates
  15.  * @version 3.8.0
  16.  */
  17.  
  18. defined( 'ABSPATH' ) || exit;
  19.  
  20. do_action( 'woocommerce_before_cart' ); ?>
  21.  
  22. <form class="woocommerce-cart-form" action="<?php echo esc_url( wc_get_cart_url() ); ?>" method="post">
  23. <?php do_action( 'woocommerce_before_cart_table' ); ?>
  24.  
  25.  
  26.  
  27.  
  28. <div class="cart-block">
  29. <div class="wrapper">
  30.  
  31. <?php
  32. foreach ( WC()->cart->get_cart() as $cart_item_key => $cart_item ) {
  33. $_product = apply_filters( 'woocommerce_cart_item_product', $cart_item['data'], $cart_item, $cart_item_key );
  34. $product_id = apply_filters( 'woocommerce_cart_item_product_id', $cart_item['product_id'], $cart_item, $cart_item_key );
  35.  
  36. if ( $_product && $_product->exists() && $cart_item['quantity'] > 0 && apply_filters( 'woocommerce_cart_item_visible', true, $cart_item, $cart_item_key ) ) {
  37. $product_permalink = apply_filters( 'woocommerce_cart_item_permalink', $_product->is_visible() ? $_product->get_permalink( $cart_item ) : '', $cart_item, $cart_item_key );
  38. ?>
  39.  
  40.  
  41. <div class="cart-flex">
  42. <div class="remove-product product-remove">
  43.  
  44. <?php
  45. echo sprintf(
  46. '<a href="%s" class="remove" aria-label="%s" data-product_id="%s" data-product_sku="%s">+</a>',
  47. esc_url( wc_get_cart_remove_url( $cart_item_key ) ),
  48. esc_html__( 'Remove this item', 'woocommerce' ),
  49. esc_attr( $product_id ),
  50. esc_attr( $_product->get_sku() )
  51. )
  52. ?>
  53. </div>
  54. <div class="cart-img-box">
  55. <?php
  56. $thumbnail = apply_filters( 'woocommerce_cart_item_thumbnail', $_product->get_image(), $cart_item, $cart_item_key );
  57.  
  58. if ( ! $product_permalink ) {
  59. echo $thumbnail; // PHPCS: XSS ok.
  60. } else {
  61. printf( '<a href="%s">%s</a>', esc_url( $product_permalink ), $thumbnail ); // PHPCS: XSS ok.
  62. }
  63. ?>
  64. </div>
  65. <div class="cart-title-box">
  66. <?php
  67. if ( ! $product_permalink ) {
  68. echo wp_kses_post( apply_filters( 'woocommerce_cart_item_name', $_product->get_name(), $cart_item, $cart_item_key ) . '&nbsp;' );
  69. } else {
  70. echo wp_kses_post( apply_filters( 'woocommerce_cart_item_name', sprintf( '<div href="%s" class="cart-title">%s</div>', esc_url( $product_permalink ), $_product->get_name() ), $cart_item, $cart_item_key ) );
  71. }
  72.  
  73. ?>
  74. </div>
  75. <div class="cart-count-box">
  76.  
  77. <div class="quantity-btn-group d-flex">
  78.  
  79. <?php
  80. if ( $_product->is_sold_individually() ) {
  81. $product_quantity = sprintf( '1 <input type="hidden" id="quantity" name="cart[%s][qty]" value="1" />', $cart_item_key );
  82. } else {
  83. $product_quantity = woocommerce_quantity_input(
  84. 'input_name' => "cart[{$cart_item_key}][qty]",
  85. 'input_value' => $cart_item['quantity'],
  86. 'max_value' => $_product->get_max_purchase_quantity(),
  87. 'min_value' => '0',
  88. 'product_name' => $_product->get_name(),
  89. ),
  90. $_product,
  91. false
  92. );
  93. }
  94. echo $product_quantity;
  95. ?>
  96. <!-- <div class="pro-qty">
  97. <input type="text" id="quantity" value="1"/>
  98. </div> -->
  99. </div>
  100. </div>
  101. <div class="cart-price-box">
  102. <div class="price">
  103. <?php echo WC()->cart->get_product_subtotal( $_product, $cart_item['quantity'] ) ?>
  104. </div>
  105. </div>
  106. </div>
  107. <?php } } ?>
  108. </div>
  109. </div>
  110.  
  111. <div class="total-block">
  112. <div class="wrapper">
  113. <div class="flex-right-block">
  114. <div class="total-price-blck">
  115. <div class="total-count-row">
  116. <div class="total-count-number"><?php echo WC()->cart->get_cart_contents_count(); ?><span>x produse in sumă de</span></div>
  117. <div class="total-price-number" data-title="<?php esc_attr_e( 'Subtotal', 'woocommerce' ); ?>"><?php wc_cart_totals_subtotal_html(); ?></div>
  118. </div>
  119. <div class="total-livr-row">
  120. <div class="total-livr-text">Livrare</div>
  121. <div class="livr-price">0</div>
  122. </div>
  123. </div>
  124. </div>
  125. <div class="flex-right-block">
  126.  
  127. <div class="order-total final-price-blck">
  128. <div class="final-price-text"><?php esc_html_e( 'Total', 'woocommerce' ); ?></div>
  129. <div class="final-number" data-title="<?php esc_attr_e( 'Total', 'woocommerce' ); ?>"><?php wc_cart_totals_order_total_html(); ?></div>
  130. </div>
  131. </div>
  132.  
  133. </div>
  134.  
  135. </div>
  136.  
  137.  
  138.  
  139. </form>
  140.  
  141.  
  142.  
  143. <div class="cart-collaterals">
  144.  
  145. </div>
  146.  
  147.  
  148.  
Success #stdin #stdout 0.02s 25160KB
stdin
Standard input is empty
stdout
Standard output is empty