在 WooCommerce 购物车页面中更改送货方式费率值字体粗细

Change shipping method rate value font weight in WooCommerce cart page

如何从 WooCommerce 购物车页面的运费中删除粗体?我不想用粗体字引起过多注意运费,所以我希望那里有常规字体粗细。

请注意,我在下面将 "Shipping" 重命名为 "Delivery"

更新: 添加下面的 html 代码以响应评论部分

中的问题
<tr class="woocommerce-shipping-totals shipping">
<th>Delivery</th>
<td data-title="Delivery">
    <ul id="ship_method" class="woocommerce-ship-type">
        <li> 
        class="ship_method"/><label for="ship_method"> <span class="woocommerce_totals totals"><span class="woocommerce_curr_sym">&#36;</span>300.00</span></label>                 </li>
    </ul>
</td>

只需检查运费值并取 class 运费值。例如,class 名称为:.shipping_fee。因此,只需将以下 css 放入您的附加 CSS 或您的自定义 CSS 文件中即可。

.shipping_fee {
 font-weight: normal !important;
}

根据您的问题进行编辑 第二次编辑 (您在其中更改了生成的 html 输出)

您可以使用以下 CCS 规则添加到主题的 styles.css 文件中 (对于购物车):

.cart-collaterals #ship_method label,
.cart-collaterals #ship_method label span {
    font-weight: normal !important;
}

购物车和结帐页面使用:

#ship_method label,
#ship_method label span {
    font-weight: normal !important;
}

应该可以。


原始答案 (适用于 Woocommerce 默认 html 结构)

您可以使用以下 CCS 规则添加到主题的 styles.css 文件中 (对于购物车):

.cart-collaterals #shipping_method label,
.cart-collaterals #shipping_method label span {
    font-weight: normal !important;
}

购物车和结帐页面使用:

#shipping_method label,
#shipping_method label span {
    font-weight: normal !important;
}

应该可以。