shortcode_wrapper('woocommerce_cart', $atts); } function woocommerce_cart( $atts ) { global $woocommerce; $errors = array(); $validation = &new woocommerce_validation(); // Process Discount Codes if (isset($_POST['apply_coupon']) && $_POST['apply_coupon'] && $woocommerce->verify_nonce('cart')) : $coupon_code = stripslashes(trim($_POST['coupon_code'])); $woocommerce->cart->add_discount($coupon_code); // Update Shipping elseif (isset($_POST['calc_shipping']) && $_POST['calc_shipping'] && $woocommerce->verify_nonce('cart')) : unset($_SESSION['_chosen_shipping_method']); $country = $_POST['calc_shipping_country']; $state = $_POST['calc_shipping_state']; $postcode = $_POST['calc_shipping_postcode']; if ($postcode && !$validation->is_postcode( $postcode, $country )) : $woocommerce->add_error( __('Please enter a valid postcode/ZIP.', 'woothemes') ); $postcode = ''; elseif ($postcode) : $postcode = $validation->format_postcode( $postcode, $country ); endif; if ($country) : // Update customer location $woocommerce->customer->set_location( $country, $state, $postcode ); $woocommerce->customer->set_shipping_location( $country, $state, $postcode ); // Re-calc price $woocommerce->cart->calculate_totals(); $woocommerce->add_message( __('Shipping costs updated.', 'woothemes') ); else : $woocommerce->customer->set_shipping_location( '', '', '' ); $woocommerce->add_message( __('Shipping costs updated.', 'woothemes') ); endif; endif; $result = $woocommerce->cart->check_cart_item_stock(); if (is_wp_error($result)) : $woocommerce->add_error( $result->get_error_message() ); endif; $woocommerce->show_messages(); if (sizeof($woocommerce->cart->cart_contents)==0) : echo '

'.__('Your cart is empty.', 'woothemes').'

'; return; endif; ?>
cart->cart_contents)>0) : foreach ($woocommerce->cart->cart_contents as $cart_item_key => $values) : $_product = $values['data']; if ($_product->exists() && $values['quantity']>0) : ?>
× plugin_url(). '/assets/images/placeholder.png" alt="Placeholder" width="'.$woocommerce->get_image_size('shop_thumbnail_image_width').'" height="'.$woocommerce->get_image_size('shop_thumbnail_image_height').'" />'; endif; ?> get_title(), $_product); ?> get_price()); ?>
get_price()*$values['quantity']); ?>
nonce_field('cart') ?>
shipping->get_available_shipping_methods(); if ($available_methods || !$woocommerce->customer->get_shipping_country() || !$woocommerce->shipping->enabled ) : ?>

cart->get_cart_shipping_total()) : ?>cart->get_cart_tax()) : ?>cart->get_total_discount()) : ?>
cart->get_cart_subtotal(); ?>
countries->shipping_to_prefix().' '.$woocommerce->countries->countries[ $woocommerce->customer->get_shipping_country() ]; ?> cart->get_cart_shipping_total(); ?> cart->get_cart_shipping_title(); ?>
customer->is_customer_outside_base()) : ?>countries->estimated_for_prefix() . $woocommerce->countries->countries[ $woocommerce->countries->get_base_country() ] ); ?> cart->get_cart_tax(); ?>
-cart->get_total_discount(); ?>
cart->get_total(); ?>
'.__('Sorry, it seems that there are no available shipping methods to your location. Please contact us if you require assistance or wish to make alternate arrangements.', 'woothemes').'

'; endif; ?>