Advertisement
danine1

cart

Nov 27th, 2018
449
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 7.34 KB | None | 0 0
  1. <?php
  2. /**
  3. * Cart Page
  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://docs.woocommerce.com/document/template-structure/
  14. * @author  WooThemes
  15. * @package WooCommerce/Templates
  16. * @version 3.1.0
  17. */
  18.  
  19. if ( ! defined( 'ABSPATH' ) ) {
  20.     exit;
  21. }
  22.  
  23. wc_print_notices();
  24.  
  25. do_action( 'woocommerce_before_cart' ); ?>
  26.  
  27. <div class="col-md-8">
  28. <form class="woocommerce-cart-form" action="<?php echo esc_url( wc_get_cart_url() ); ?>" method="post">
  29.     <?php do_action( 'woocommerce_before_cart_table' ); ?>
  30.  
  31.     <table class="shop_table shop_table_responsive cart woocommerce-cart-form__contents" cellspacing="0">
  32.         <thead>
  33.             <tr>
  34.                 <th class="product-remove">&nbsp;</th>
  35.                 <th class="product-thumbnail">&nbsp;</th>
  36.                 <th class="product-name"><?php _e( 'Product', 'woocommerce' ); ?></th>
  37.                 <th class="product-price"><?php _e( 'Price', 'woocommerce' ); ?></th>
  38.                 <th class="product-quantity"><?php _e( 'Quantity', 'woocommerce' ); ?></th>
  39.                 <th class="product-subtotal"><?php _e( 'Total', 'woocommerce' ); ?></th>
  40.             </tr>
  41.         </thead>
  42.         <tbody>
  43.             <?php do_action( 'woocommerce_before_cart_contents' ); ?>
  44.  
  45.             <?php
  46.             foreach ( WC()->cart->get_cart() as $cart_item_key => $cart_item ) {
  47.                 $_product   = apply_filters( 'woocommerce_cart_item_product', $cart_item['data'], $cart_item, $cart_item_key );
  48.                 $product_id = apply_filters( 'woocommerce_cart_item_product_id', $cart_item['product_id'], $cart_item, $cart_item_key );
  49.  
  50.                 if ( $_product && $_product->exists() && $cart_item['quantity'] > 0 && apply_filters( 'woocommerce_cart_item_visible', true, $cart_item, $cart_item_key ) ) {
  51.                     $product_permalink = apply_filters( 'woocommerce_cart_item_permalink', $_product->is_visible() ? $_product->get_permalink( $cart_item ) : '', $cart_item, $cart_item_key );
  52.                     ?>
  53.                     <tr class="woocommerce-cart-form__cart-item <?php echo esc_attr( apply_filters( 'woocommerce_cart_item_class', 'cart_item', $cart_item, $cart_item_key ) ); ?>">
  54.  
  55.                         <!-- DBeratung edit - Add row - product image and details -->
  56.                             <tr>
  57.                                 <td class="product-thumbnail">
  58.                                     <?php
  59.                                         $thumbnail = apply_filters( 'woocommerce_cart_item_thumbnail', $_product->get_image(), $cart_item, $cart_item_key );
  60.  
  61.                                         if ( ! $product_permalink ) {
  62.                                             echo $thumbnail;
  63.                                         } else {
  64.                                             printf( '<a href="%s">%s</a>', esc_url( $product_permalink ), $thumbnail );
  65.                                         }
  66.                                     ?>
  67.                                 </td>
  68.  
  69.                                 <td class="product-name" data-title="<?php esc_attr_e( 'Product', 'woocommerce' ); ?>">
  70.                                     <?php
  71.                                         if ( ! $product_permalink ) {
  72.                                             echo apply_filters( 'woocommerce_cart_item_name', $_product->get_name(), $cart_item, $cart_item_key ) . '&nbsp;';
  73.                                         } else {
  74.                                             echo apply_filters( 'woocommerce_cart_item_name', sprintf( '<a href="%s">%s</a>', esc_url( $product_permalink ), $_product->get_name() ), $cart_item, $cart_item_key );
  75.                                         }
  76.  
  77.                                         // Meta data
  78.                                         echo WC()->cart->get_item_data( $cart_item );
  79.  
  80.                                         // Backorder notification
  81.                                         if ( $_product->backorders_require_notification() && $_product->is_on_backorder( $cart_item['quantity'] ) ) {
  82.                                             echo '<p class="backorder_notification">' . esc_html__( 'Available on backorder', 'woocommerce' ) . '</p>';
  83.                                         }
  84.                                     ?>
  85.                                 </td>
  86.  
  87.                                 <td>
  88.                                     <!-- DBeratung edit - move delete button  -->
  89.                                     <?php
  90.                                         echo apply_filters( 'woocommerce_cart_item_remove_link', sprintf(
  91.                                             '<a href="%s" class="remove" aria-label="%s" data-product_id="%s" data-product_sku="%s">&times;</a>',
  92.                                             esc_url( WC()->cart->get_remove_url( $cart_item_key ) ),
  93.                                             __( 'Remove this item', 'woocommerce' ),
  94.                                             esc_attr( $product_id ),
  95.                                             esc_attr( $_product->get_sku() )
  96.                                         ), $cart_item_key );
  97.                                     ?>
  98.                                 </td>
  99.                             </tr>
  100.                     <tr>
  101.                         <td class="product-price" data-title="<?php esc_attr_e( 'Price', 'woocommerce' ); ?>">
  102.                             <?php
  103.                                 echo apply_filters( 'woocommerce_cart_item_price', WC()->cart->get_product_price( $_product ), $cart_item, $cart_item_key );
  104.                             ?>
  105.                         </td>
  106.  
  107.                         <td class="product-quantity" data-title="<?php esc_attr_e( 'Quantity', 'woocommerce' ); ?>">
  108.                             <?php
  109.                                 if ( $_product->is_sold_individually() ) {
  110.                                     $product_quantity = sprintf( '1 <input type="hidden" name="cart[%s][qty]" value="1" />', $cart_item_key );
  111.                                 } else {
  112.                                     $product_quantity = woocommerce_quantity_input( array(
  113.                                         'input_name'  => "cart[{$cart_item_key}][qty]",
  114.                                         'input_value' => $cart_item['quantity'],
  115.                                         'max_value'   => $_product->get_max_purchase_quantity(),
  116.                                         'min_value'   => '0',
  117.                                     ), $_product, false );
  118.                                 }
  119.  
  120.                                 echo apply_filters( 'woocommerce_cart_item_quantity', $product_quantity, $cart_item_key, $cart_item );
  121.                             ?>
  122.                         </td>
  123.                     </tr>
  124.  
  125.                         <td class="product-subtotal" data-title="<?php esc_attr_e( 'Total', 'woocommerce' ); ?>">
  126.                             <?php
  127.                                 echo apply_filters( 'woocommerce_cart_item_subtotal', WC()->cart->get_product_subtotal( $_product, $cart_item['quantity'] ), $cart_item, $cart_item_key );
  128.                             ?>
  129.                         </td>
  130.                     </tr>
  131.                     <?php
  132.                 }
  133.             }
  134.             ?>
  135.  
  136.             <?php do_action( 'woocommerce_cart_contents' ); ?>
  137.  
  138.             <tr>
  139.                 <td colspan="6" class="actions">
  140.  
  141.                     <?php if ( wc_coupons_enabled() ) { ?>
  142.                         <div class="coupon">
  143.                             <label for="coupon_code"><?php _e( 'Coupon:', 'woocommerce' ); ?></label> <input type="text" name="coupon_code" class="input-text" id="coupon_code" value="" placeholder="<?php esc_attr_e( 'Coupon code', 'woocommerce' ); ?>" /> <input type="submit" class="button" name="apply_coupon" value="<?php esc_attr_e( 'Apply coupon', 'woocommerce' ); ?>" />
  144.                             <?php do_action( 'woocommerce_cart_coupon' ); ?>
  145.                         </div>
  146.                     <?php } ?>
  147.  
  148.                     <input type="submit" class="button" name="update_cart" value="<?php esc_attr_e( 'Update cart', 'woocommerce' ); ?>" />
  149.  
  150.                     <?php do_action( 'woocommerce_cart_actions' ); ?>
  151.  
  152.                     <?php wp_nonce_field( 'woocommerce-cart' ); ?>
  153.                 </td>
  154.             </tr>
  155.  
  156.             <?php do_action( 'woocommerce_after_cart_contents' ); ?>
  157.         </tbody>
  158.     </table>
  159.     <?php do_action( 'woocommerce_after_cart_table' ); ?>
  160. </form>
  161.  
  162. <div class="cart-collaterals">
  163.     <?php
  164.         /**
  165.          * woocommerce_cart_collaterals hook.
  166.          *
  167.          * @hooked woocommerce_cross_sell_display
  168.          * @hooked woocommerce_cart_totals - 10
  169.          */
  170.         do_action( 'woocommerce_cart_collaterals' );
  171.     ?>
  172. </div>
  173.  
  174. </div>
  175.  
  176. <div class="col-md-4">
  177.     <div class="gesamtsumme">
  178.         <h4>Gesamtsumme</h4><br>
  179.         <div class="subtotal">
  180.             <span>Zwischensumme</span>
  181.             <span>CHF 190.24</span>
  182.         </div>
  183.         <div class="versand">
  184.             <span>description</span>
  185.             <span>wird zzgl. berechnet(gratis ab CHF200)</span>
  186.         </div>
  187.         <hr>
  188.         <button type="button" class="button checkout-continue">Weiter zur Kasse</button>
  189.     </div>
  190. </div>
  191.  
  192. <?php do_action( 'woocommerce_after_cart' ); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement