Advertisement
grappler

cart.php

Oct 4th, 2012
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 7.07 KB | None | 0 0
  1. <?php
  2. /**
  3.  * Cart Page
  4.  */
  5.  
  6. global $woocommerce;
  7. ?>
  8.  
  9.  
  10. <form action="<?php echo esc_url( $woocommerce->cart->get_cart_url() ); ?>" method="post" class="woo_cart">
  11. <?php do_action( 'woocommerce_before_cart_table' ); ?>
  12.     <script type="text/javascript">
  13.     jQuery(window).load(function() {
  14.         jQuery(".slide1").show();
  15.         if (navigator.appName == "Microsoft Internet Explorer") {
  16.             jQuery(".progress_wrapper .lines").css("background-position", "-263px 0");
  17.             jQuery(".progress_wrapper .cart").addClass('act');
  18.         } else {
  19.             jQuery(".progress_wrapper .lines").animate({ backgroundPosition: "-263px"},600, function() {
  20.                 jQuery(".progress_wrapper .cart").addClass('act'); 
  21.             });
  22.         }
  23.        
  24.     });
  25.     </script>
  26.  
  27. <div class="progress_wrapper top">
  28.  
  29.  <span class="lines"></span>
  30.  <div class="progress_bar"></div><!--close progress_bar--> 
  31.     <ul>
  32.         <li class="cart"><?php _e('Your Cart', 'sp'); ?></li>
  33.         <li class="info"><?php _e('Info', 'sp'); ?></li>
  34.         <li class="final"><?php _e('Final', 'sp'); ?></li>
  35.     </ul>
  36. </div><!--close progress_wrapper-->
  37. <div class="yourtotal"><p><?php _e('Sub-Total:', 'sp'); ?><?php echo $woocommerce->cart->get_cart_subtotal(); ?></p></div>
  38. <?php $woocommerce->show_messages(); ?>
  39. <table class="shop_table cart" cellspacing="0">
  40.     <thead>
  41.         <tr>
  42.             <th class="product-remove"> </th>
  43.             <th class="product-thumbnail"> </th>
  44.             <th class="product-name"><?php _e('Product', 'woocommerce'); ?></th>
  45.             <th class="product-price"><?php _e('Price', 'woocommerce'); ?></th>
  46.             <th class="product-quantity"><?php _e('Quantity', 'woocommerce'); ?></th>
  47.             <th class="product-subtotal"><?php _e('Total', 'woocommerce'); ?></th>
  48.         </tr>
  49.     </thead>
  50.     <tbody>
  51.         <?php do_action( 'woocommerce_before_cart_contents' ); ?>
  52.        
  53.         <?php
  54.         if ( sizeof( $woocommerce->cart->get_cart() ) > 0 ) {
  55.             foreach ( $woocommerce->cart->get_cart() as $cart_item_key => $values ) {
  56.                 $_product = $values['data'];
  57.                 if ( $_product->exists() && $values['quantity'] > 0 ) {
  58.                     ?>
  59.                     <tr class = "<?php echo esc_attr( apply_filters('woocommerce_cart_table_item_class', 'cart_table_item', $values, $cart_item_key ) ); ?>">
  60.                         <!-- Remove from cart link -->
  61.                         <td class="product-remove">
  62.                             <?php
  63.                                 echo apply_filters( 'woocommerce_cart_item_remove_link', sprintf('<a href="%s" class="remove" title="%s">×</a>', esc_url( $woocommerce->cart->get_remove_url( $cart_item_key ) ), __('Remove this item', 'woocommerce') ), $cart_item_key );
  64.                             ?>
  65.                         </td>
  66.                        
  67.                         <!-- The thumbnail -->
  68.                         <td class="product-thumbnail">
  69.                             <?php
  70.                                 $thumbnail = apply_filters( 'woocommerce_in_cart_product_thumbnail', $_product->get_image(), $values, $cart_item_key );
  71.                                 printf('<a href="%s">%s</a>', esc_url( get_permalink( apply_filters('woocommerce_in_cart_product_id', $values['product_id'] ) ) ), $thumbnail );
  72.                             ?>
  73.                         </td>
  74.                        
  75.                         <!-- Product Name -->
  76.                         <td class="product-name">
  77.                             <?php
  78.                                 if ( ! $_product->is_visible() || ( $_product instanceof WC_Product_Variation && ! $_product->parent_is_visible() ) )
  79.                                     echo apply_filters( 'woocommerce_in_cart_product_title', $_product->get_title(), $values, $cart_item_key );
  80.                                 else
  81.                                     printf('<a href="%s">%s</a>', esc_url( get_permalink( apply_filters('woocommerce_in_cart_product_id', $values['product_id'] ) ) ), apply_filters('woocommerce_in_cart_product_title', $_product->get_title(), $values, $cart_item_key ) );
  82.                                                        
  83.                                 // Meta data
  84.                                 echo $woocommerce->cart->get_item_data( $values );
  85.                                
  86.                                 // Backorder notification
  87.                                 if ( $_product->backorders_require_notification() && $_product->is_on_backorder( $values['quantity'] ) )
  88.                                     echo '<p class="backorder_notification">' . __('Available on backorder', 'woocommerce') . '</p>';
  89.                             ?>
  90.                         </td>
  91.                        
  92.                         <!-- Product price -->
  93.                         <td class="product-price">
  94.                             <?php                          
  95.                                 $product_price = get_option('woocommerce_display_cart_prices_excluding_tax') == 'yes' || $woocommerce->customer->is_vat_exempt() ? $_product->get_price_excluding_tax() : $_product->get_price();
  96.                            
  97.                                 echo apply_filters('woocommerce_cart_item_price_html', woocommerce_price( $product_price ), $values, $cart_item_key );
  98.                             ?>
  99.                         </td>
  100.                        
  101.                         <!-- Quantity inputs -->
  102.                         <td class="product-quantity">
  103.                             <?php
  104.                                 if ( $_product->is_sold_individually() ) {
  105.                                     $product_quantity = '1';
  106.                                 } else {
  107.                                     $data_min = apply_filters( 'woocommerce_cart_item_data_min', '', $_product );
  108.                                     $data_max = ( $_product->backorders_allowed() ) ? '' : $_product->get_stock_quantity();
  109.                                     $data_max = apply_filters( 'woocommerce_cart_item_data_max', $data_max, $_product );
  110.                                    
  111.                                     $product_quantity = sprintf( '<div class="quantity"><input name="cart[%s][qty]" data-min="%s" data-max="%s" value="%s" size="4" title="Qty" class="input-text qty text" maxlength="12" /></div>', $cart_item_key, $data_min, $data_max, esc_attr( $values['quantity'] ) );
  112.                                 }
  113.                                
  114.                                 echo apply_filters( 'woocommerce_cart_item_quantity', $product_quantity, $cart_item_key );                 
  115.                             ?>
  116.                         </td>
  117.                        
  118.                         <!-- Product subtotal -->
  119.                         <td class="product-subtotal">
  120.                             <?php
  121.                                 echo apply_filters( 'woocommerce_cart_item_subtotal', $woocommerce->cart->get_product_subtotal( $_product, $values['quantity'] ), $values, $cart_item_key );
  122.                             ?>
  123.                         </td>
  124.                     </tr>
  125.                     <?php
  126.                 }
  127.             }
  128.         }
  129.        
  130.         do_action( 'woocommerce_cart_contents' );
  131.         ?>
  132.         <tr>
  133.             <td colspan="6" class="actions">
  134.  
  135.                 <?php if ( get_option( 'woocommerce_enable_coupons' ) == 'yes' ) { ?>
  136.                     <div class="coupon">
  137.                    
  138.                         <label for="coupon_code"><?php _e('Coupon', 'woocommerce'); ?>:</label> <input name="coupon_code" class="input-text" id="coupon_code" value="" /> <input type="submit" class="button" name="apply_coupon" value="<?php _e('Apply Coupon', 'woocommerce'); ?>" />
  139.                        
  140.                         <?php do_action('woocommerce_cart_coupon'); ?>
  141.                        
  142.                     </div>
  143.                 <?php } ?>
  144.  
  145.                 <input type="submit" class="update button" name="update_cart" value="<?php _e('Update Cart', 'woocommerce'); ?>" />
  146.                
  147.                 <?php $woocommerce->nonce_field('cart') ?>
  148.             </td>
  149.         </tr>
  150.        
  151.         <?php do_action( 'woocommerce_after_cart_contents' ); ?>
  152.     </tbody>
  153. </table>
  154. <?php do_action( 'woocommerce_after_cart_table' ); ?>
  155. </form>
  156. <div class="cart-collaterals group">
  157.    
  158.     <?php do_action('woocommerce_cart_collaterals'); ?>
  159.    
  160.     <?php woocommerce_cart_totals(); ?>
  161.    
  162.     <?php woocommerce_shipping_calculator(); ?>
  163.     <a href="<?php echo esc_url( $woocommerce->cart->get_checkout_url() ); ?>" class="checkout-button alt"><span><?php _e('Proceed to Checkout ?', 'woocommerce'); ?></span></a>
  164.     <?php do_action('woocommerce_proceed_to_checkout'); ?>
  165.    
  166. </div>
  167. <div class="progress_wrapper below">
  168.  
  169.  <span class="lines"></span>
  170.  <div class="progress_bar_white"></div><!--close progress_bar-->   
  171.     <ul>
  172.         <li class="cart"><?php _e('Your Cart', 'sp'); ?></li>
  173.         <li class="info"><?php _e('Info', 'sp'); ?></li>
  174.         <li class="final"><?php _e('Final', 'sp'); ?></li>
  175.     </ul>
  176. </div><!--close progress_wrapper-->
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement