Advertisement
danine1

cart-2022

Jun 8th, 2022
670
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 8.61 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.  * @package WooCommerce\Templates
  15.  * @version 3.8.0
  16.  */
  17.  
  18. defined( 'ABSPATH' ) || exit;
  19.  
  20. do_action( 'woocommerce_before_cart' ); ?>
  21.  
  22.  
  23. <section class="elementor-section elementor-top-section elementor-element elementor-element-b789d24 elementor-section-full_width elementor-section-stretched neuherz-cart-header elementor-section-height-default elementor-section-height-default" data-id="b789d24" data-element_type="section" data-settings="{&quot;stretch_section&quot;:&quot;section-stretched&quot;}" style="width: 1903px; left: -351.5px;">
  24.     <div class="elementor-container elementor-column-gap-default">
  25.  
  26.         <div class="elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-13b672b" data-id="13b672b" data-element_type="column">
  27.             <div class="elementor-widget-wrap elementor-element-populated">
  28.                 <div class="elementor-element elementor-element-aeecc2c elementor-widget elementor-widget-heading" data-id="aeecc2c" data-element_type="widget" data-widget_type="heading.default">
  29.                     <div class="elementor-widget-container">
  30.                         <div class="grid-container-cart-header">
  31.                             <div id="logo-item-cart" class="grid-item">
  32.                                 <span class="neu-banner-cart-page">Ihr Warenkorb</span>
  33.                                 <div class="neuherz-cart-container">
  34.                                     <a href="/shop">
  35.                                     <img src="/wp-content/uploads/2022/03/cropped-neuherz_logo_v2.png" class="neuherz-cart-logo" alt="">
  36.                                     </a>
  37.                                 </div>
  38.                             </div>
  39.                             <?php
  40.                             global $woocommerce;
  41.                             $items = $woocommerce->cart->get_cart();
  42.    
  43.                             foreach($items as $item => $values) {
  44.                                 $_product =  wc_get_product( $values['data']->get_id());
  45.                                 echo "<div class='grid-item'>". "<span class='service-icon-cart'>" . "<p class='service-title-cart'>" . $_product->get_title() . "</p>" . "</span>" ."</div>";
  46.                             }
  47.    
  48.                             ?>
  49.                     </div>
  50.                 </div>
  51.             </div>
  52.         </div>
  53.     </div>
  54. </section>
  55.  
  56. <!-- <section class="elementor-section elementor-top-section elementor-element elementor-element-b789d24 elementor-section-full_width elementor-section-stretched neuherz-cart-header elementor-section-height-default elementor-section-height-default" data-id="b789d24" data-element_type="section" data-settings="{&quot;stretch_section&quot;:&quot;section-stretched&quot;}" style="width: 1903px; left: -351.5px;">
  57.     <div class="elementor-container elementor-column-gap-default">
  58.         <div class="elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-13b672b" data-id="13b672b" data-element_type="column">
  59.             <div class="elementor-widget-wrap elementor-element-populated">
  60.                 <div class="elementor-element elementor-element-aeecc2c elementor-widget elementor-widget-heading" data-id="aeecc2c" data-element_type="widget" data-widget_type="heading.default">
  61.                     <div class="elementor-widget-container">
  62.                         <div class="grid-container-cart-header">
  63.                             <div class="grid-item">
  64.                             <div class="neuherz-cart-container">
  65.                             <img src="/wp-content/uploads/2022/03/cropped-neuherz_logo_v2.png" class="neuherz-cart-logo" alt="">
  66.                         </div>
  67.                             </div>
  68.                             <div class="grid-item service-cart-one"></div>
  69.                             <div class="grid-item service-cart-two"></div>
  70.                             <div class="grid-item service-cart-three"></div>
  71.                    
  72.                     </div>
  73.                 </div>
  74.             </div>
  75.         </div>
  76.     </div>
  77. </section> -->
  78.  
  79.  
  80. <form class="woocommerce-cart-form" action="<?php echo esc_url( wc_get_cart_url() ); ?>" method="post">
  81.     <?php do_action( 'woocommerce_before_cart_table' ); ?>
  82.  
  83.     <table class="shop_table shop_table_responsive cart woocommerce-cart-form__contents" cellspacing="0">
  84.         <tbody>
  85.             <?php do_action( 'woocommerce_before_cart_contents' ); ?>
  86.  
  87.             <?php
  88.             foreach ( WC()->cart->get_cart() as $cart_item_key => $cart_item ) {
  89.                 $_product   = apply_filters( 'woocommerce_cart_item_product', $cart_item['data'], $cart_item, $cart_item_key );
  90.                 $product_id = apply_filters( 'woocommerce_cart_item_product_id', $cart_item['product_id'], $cart_item, $cart_item_key );
  91.  
  92.                 if ( $_product && $_product->exists() && $cart_item['quantity'] > 0 && apply_filters( 'woocommerce_cart_item_visible', true, $cart_item, $cart_item_key ) ) {
  93.                     $product_permalink = apply_filters( 'woocommerce_cart_item_permalink', $_product->is_visible() ? $_product->get_permalink( $cart_item ) : '', $cart_item, $cart_item_key );
  94.                     ?>
  95.                    
  96.                     <tr class="woocommerce-cart-form__cart-item <?php echo esc_attr( apply_filters( 'woocommerce_cart_item_class', 'cart_item', $cart_item, $cart_item_key ) ); ?>">
  97.  
  98.                         <td class="product-name" data-title="<?php esc_attr_e( 'Product', 'woocommerce' ); ?>">
  99.                         <hr class="neuherz-cart-hr">
  100.                         <?php
  101.                         if ( ! $product_permalink ) {
  102.                             echo wp_kses_post( apply_filters( 'woocommerce_cart_item_name', $_product->get_name(), $cart_item, $cart_item_key ) . '&nbsp;' );
  103.                         } else {
  104.                             echo wp_kses_post( apply_filters( 'woocommerce_cart_item_name', sprintf( '<a href="%s">%s</a>', esc_url( $product_permalink ), $_product->get_name() ), $cart_item, $cart_item_key ) );
  105.                         }
  106.  
  107.                         do_action( 'woocommerce_after_cart_item_name', $cart_item, $cart_item_key );
  108.  
  109.                         // Meta data.
  110.                         echo wc_get_formatted_cart_item_data( $cart_item ); // PHPCS: XSS ok.
  111.  
  112.                         // Backorder notification.
  113.                         if ( $_product->backorders_require_notification() && $_product->is_on_backorder( $cart_item['quantity'] ) ) {
  114.                             echo wp_kses_post( apply_filters( 'woocommerce_cart_item_backorder_notification', '<p class="backorder_notification">' . esc_html__( 'Available on backorder', 'woocommerce' ) . '</p>', $product_id ) );
  115.                         }
  116.                         ?>
  117.                         </td>
  118.                        
  119.  
  120.                         <td class="product-remove">
  121.                             <?php
  122.                                 echo apply_filters( // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
  123.                                     'woocommerce_cart_item_remove_link',
  124.                                     sprintf(
  125.                                         '<a href="%s" class="remove" aria-label="%s" data-product_id="%s" data-product_sku="%s">&times;</a>',
  126.                                         esc_url( wc_get_cart_remove_url( $cart_item_key ) ),
  127.                                         esc_html__( 'Remove this item', 'woocommerce' ),
  128.                                         esc_attr( $product_id ),
  129.                                         esc_attr( $_product->get_sku() )
  130.                                     ),
  131.                                     $cart_item_key
  132.                                 );
  133.                             ?>
  134.                         </td>
  135.                        
  136.                     </tr>
  137.                    
  138.                     <tr>
  139.                    
  140.                     <td class="product-price neuherz-cart-price" data-title="<?php esc_attr_e( 'Price', 'woocommerce' ); ?>">
  141.                             <?php
  142.                                 echo apply_filters( 'woocommerce_cart_item_price', WC()->cart->get_product_price( $_product ), $cart_item, $cart_item_key ); // PHPCS: XSS ok.
  143.                             ?>
  144.                     </td>
  145.                     </tr>
  146.                     <?php
  147.                 }
  148.             }
  149.             ?>
  150.  
  151.             <?php do_action( 'woocommerce_cart_contents' ); ?>
  152.  
  153.             <tr>
  154.                 <td colspan="6" class="actions">
  155.  
  156.                     <?php if ( wc_coupons_enabled() ) { ?>
  157.                         <div class="coupon">
  158.                             <label for="coupon_code"><?php esc_html_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' ); ?>" /> <button type="submit" class="button" name="apply_coupon" value="<?php esc_attr_e( 'Apply coupon', 'woocommerce' ); ?>"><?php esc_attr_e( 'Apply coupon', 'woocommerce' ); ?></button>
  159.                             <?php do_action( 'woocommerce_cart_coupon' ); ?>
  160.                         </div>
  161.                     <?php } ?>
  162.  
  163.                     <button type="submit" class="button" name="update_cart" value="<?php esc_attr_e( 'Update cart', 'woocommerce' ); ?>"><?php esc_html_e( 'Update cart', 'woocommerce' ); ?></button>
  164.  
  165.                     <?php do_action( 'woocommerce_cart_actions' ); ?>
  166.  
  167.                     <?php wp_nonce_field( 'woocommerce-cart', 'woocommerce-cart-nonce' ); ?>
  168.                 </td>
  169.             </tr>
  170.  
  171.             <?php do_action( 'woocommerce_after_cart_contents' ); ?>
  172.         </tbody>
  173.     </table>
  174.     <?php do_action( 'woocommerce_after_cart_table' ); ?>
  175. </form>
  176.  
  177. <?php do_action( 'woocommerce_before_cart_collaterals' ); ?>
  178.  
  179. <div class="cart-collaterals">
  180.     <?php
  181.         /**
  182.          * Cart collaterals hook.
  183.          *
  184.          * @hooked woocommerce_cross_sell_display
  185.          * @hooked woocommerce_cart_totals - 10
  186.          */
  187.         do_action( 'woocommerce_cart_collaterals' );
  188.     ?>
  189. </div>
  190.  
  191. <?php do_action( 'woocommerce_after_cart' ); ?>
  192.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement