Guest User

menu cart

a guest
Jul 13th, 2016
375
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.08 KB | None | 0 0
  1. <div id="expanded-menucart">
  2.  
  3. <?php
  4.  
  5. foreach ( WC()->cart->get_cart() as $cart_item_key => $cart_item ) {
  6.  
  7. ?>
  8.  
  9. <div class="one-menucart-item">
  10.  
  11. <?php
  12.  
  13. $_product = apply_filters( 'woocommerce_cart_item_product', $cart_item['data'], $cart_item, $cart_item_key );
  14. $thumbnail = apply_filters( 'woocommerce_cart_item_thumbnail', $_product->get_image(), $cart_item, $cart_item_key );
  15. $product_subtotal = apply_filters( 'woocommerce_cart_item_subtotal', WC()->cart->get_product_subtotal( $_product, $cart_item['quantity']), $cart_item, $cart_item_key );
  16. $quantity = $_product->get_stock_quantity();
  17. $antal = $cart_item['variation']['attribute_antal'];
  18. $productid = $cart_item['product_id'];
  19.  
  20.  
  21. echo apply_filters( 'woocommerce_cart_item_remove_link', sprintf(
  22. '<a href="%s" class="remove, cart-remove" title="%s" data-product_id="%s" data-product_sku="%s">&times;</a>',
  23. esc_url( WC()->cart->get_remove_url( $cart_item_key ) ),
  24. __( 'Remove this item', 'woocommerce' ),
  25. esc_attr( $product_id ),
  26. esc_attr( $_product->get_sku() )
  27. ), $cart_item_key );
  28.  
  29.  
  30. echo $thumbnail; ?>
  31. <a id="<?php $productid; ?>" href="<?php the_permalink($productid); ?>"> <?php echo $cart_item['data']->post->post_title;?></a><br><br><?php
  32. echo $antal;
  33. echo $product_subtotal;?><br>
  34.  
  35. </div><?php
  36.  
  37. }
  38.  
  39. ?>
  40.  
  41. <?php global $woocommerce; ?>
  42. <p>TOTAL:
  43. <a class="cart-contents" href="<?php echo $woocommerce->cart->get_cart_url(); ?>"><?php echo $woocommerce->cart->get_cart_total(); ?></a></p><br>
  44.  
  45. <?php if ( WC()->cart->get_cart_contents_count() != 0 ) { ?>
  46.  
  47. <div class="row">
  48. <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
  49. <div class="menucart-checkout">
  50. <a href="<?php get_home_url(); ?>/fcb/checkout">TILL CHECKOUTEN</a>
  51. </div>
  52. </div>
  53. </div>
  54.  
  55. <?php } ?>
  56.  
  57. </div>
Advertisement
Add Comment
Please, Sign In to add comment