Advertisement
bowenac

Untitled

Apr 9th, 2014
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.36 KB | None | 0 0
  1. function woo_add_cart_fee() {
  2.  
  3.     global $woocommerce;
  4.     $cart = $woocommerce->cart->cart_contents;
  5.     foreach ($cart as $key => $item ) {
  6.     //var_dump($item);
  7.     $itemClass = wp_get_post_terms($item->post_parent, 'product_shipping_class');
  8.     var_dump($itemClass);
  9.     $itemClass->slug;
  10.     }
  11. }
  12. add_action( 'woocommerce_before_calculate_totals', 'woo_add_cart_fee' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement