在WooCommerce的购物车页面中选择本地选择时隐藏运费

时间:2017-09-20 21:18:27

标签: wordpress woocommerce shipping

<ul id="shipping_method">
    <li>
        <input name="shipping_method[0]" data-index="0" id="shipping_method_0_local_pickup5" value="local_pickup:5" class="shipping_method" checked="checked" type="radio">
        <label for="shipping_method_0_local_pickup5">Local pickup</label>
    </li>
    <li>
        <input name="shipping_method[0]" data-index="0" id="shipping_method_0_flat_rate8" value="flat_rate:8" class="shipping_method" type="radio">
    <label for="shipping_method_0_flat_rate8">Delivery</label>
    </li>
    <li>
        <input name="shipping_method[0]" data-index="0" id="shipping_method_0_flat_rate4" value="flat_rate:4" class="shipping_method" type="radio">
        <label for="shipping_method_0_flat_rate4">0-5 miles: <span class="woocommerce-Price-amount amount"><span class="woocommerce-Price-currencySymbol">$</span>3.50</span></label>
    </li>
    <li>
        <input name="shipping_method[0]" data-index="0" id="shipping_method_0_flat_rate6" value="flat_rate:6" class="shipping_method" type="radio">
        <label for="shipping_method_0_flat_rate6">5-9 miles: <span class="woocommerce-Price-amount amount"><span class="woocommerce-Price-currencySymbol">$</span>4.50</span></label>
    </li>
    <li>
        <input name="shipping_method[0]" data-index="0" id="shipping_method_0_flat_rate7" value="flat_rate:7" class="shipping_method" type="radio">
        <label for="shipping_method_0_flat_rate7">9-11 miles: <span class="woocommerce-Price-amount amount"><span class="woocommerce-Price-currencySymbol">$</span>5.50</span></label>
    </li>
</ul>

此代码来自woo-commerce购物车页面部分购物车总数,主要有两种选择:

  1. 本地选择
  2. 递送
  3. 运费
  4. 在交货时有运费,所以我的要求是,如果选择了本地选择但是应该可以看到交货option 2以及选项1,则应隐藏运费。
    只有在选择option 3投放时才会显示option (2),否则应隐藏option 3option (1)option (2)应默认显示option (3)应隐藏。

    enter image description here

0 个答案:

没有答案