cart-shipping.php
4.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
<?php
/**
* Shipping Methods Display
*
* In 2.1 we show methods per package. This allows for multiple methods per order if so desired.
*
* This template can be overridden by copying it to yourtheme/woocommerce/cart/cart-shipping.php.
*
* HOWEVER, on occasion WooCommerce will need to update template files and you (the theme developer).
* will need to copy the new files to your theme to maintain compatibility. We try to do this.
* as little as possible, but it does happen. When this occurs the version of the template file will.
* be bumped and the readme will list any important changes.
*
* @see http://docs.woothemes.com/document/template-structure/
* @author WooThemes
* @package WooCommerce/Templates
* @version 2.5.0
*/
if (!defined('ABSPATH')) {
exit;
}
?>
<tr class="shipping text-uppercase robotoregular tvhide shippingwc">
<td class="desktop carthide"> </td>
<th><?php echo wp_kses_post($package_name); ?></th>
<td class="font18 text-right" data-title="<?php echo esc_attr($package_name); ?>">
<?php if (1 < count($available_methods)) : ?>
<ul id="shipping_method">
<?php foreach ($available_methods as $method) : ?>
<li>
<?php
if ($method->cost > 0) {
$method_cost = wc_price($method->cost);
} else {
$method_cost = "Free";
}
printf('<input type="radio" name="shipping_method[%1$d]" data-index="%1$d" id="shipping_method_%1$d_%2$s" value="%3$s" class="shipping_method" %4$s />
<label for="shipping_method_%1$d_%2$s">%5$s</label>', $index, sanitize_title($method->id), esc_attr($method->id), checked($method->id, $chosen_method, false), $method_cost);
do_action('woocommerce_after_shipping_rate', $method, $index);
?>
</li>
<?php endforeach; ?>
</ul>
<style type="text/css">
#order_reviews tfoot{
bottom: -15px;
}
ul#shipping_method {
font-size: 9px;
font-weight: 300;
}
#order_reviews .shop_table {
padding-bottom: 80px;
}
.shipping.text-uppercase p{
display:none;
}
</style>
<?php elseif (1 === count($available_methods)) : ?>
<?php
$method = current($available_methods);
if ($method->cost > 0) {
$method_cost = wc_price($method->cost);
} else {
$method_cost = "Free";
}
printf('%3$s <input type="hidden" name="shipping_method[%1$d]" data-index="%1$d" id="shipping_method_%1$d" value="%2$s" class="shipping_method" />', $index, esc_attr($method->id), $method_cost);
do_action('woocommerce_after_shipping_rate', $method, $index);
if ($method->cost > 0) {
?>
<style type="text/css">
@media screen and (min-width: 747px) {
.shipping.shippingwc{
display: flex !important;
}
}
.shipping.shippingwcs{
display: none !important;
}
</style>
<?php
}
?>
<?php elseif (!WC()->customer->has_calculated_shipping()) : ?>
<?php echo wpautop(__('Shipping costs will be calculated once you have provided your address.', 'woocommerce')); ?>
<?php else : ?>
<?php echo apply_filters(is_cart() ? 'woocommerce_cart_no_shipping_available_html' : 'woocommerce_no_shipping_available_html', wpautop(__('No shipping.', 'woocommerce'))); ?>
<?php endif; ?>
<?php if ($show_package_details) : ?>
<?php echo '<p class="woocommerce-shipping-contents"><small>' . esc_html($package_details) . '</small></p>'; ?>
<?php endif; ?>
<?php if (is_cart() && !$index) : ?>
<?php woocommerce_shipping_calculator(); ?>
<?php endif; ?>
</td>
</tr>