我正在使用 WordPress 4.3.1、Woocommerce 2.4.7 和主题店面 1.5.1。
我想更改标题中的“site-header-cart”,它显示购物车的当前价格以及购物车中的商品数量,仅显示商品数量:
<span class="amount">463,33 €</span>
<span class="count">7 items</span>
应该:
<span class="count">7</span>
每当我对 template-tags.php 进行更改时,只会在
<a class="cart-contents" ...>
...
</a>
正在显示。每当我尝试更改 href 内的某些内容时,都会显示未更改的原始内容:
if ( ! function_exists( 'storefront_cart_link' ) ) {
function storefront_cart_link() {
?>
<a class="cart-contents" href="<?php echo esc_url( WC()->cart->get_cart_url() ); ?>" title="<?php _e( 'View your shopping cart', 'storefront' ); ?>">
<span class="count"><?php echo wp_kses_data( sprintf( _n( '%d item', '%d items', WC()->cart->get_cart_contents_count(), 'storefront' ), WC()->cart->get_cart_contents_count() ) );?></span>
</a>
<?php
}
}
怎么回事,谁能帮帮我?