在Storefront中更改标题购物车文本

时间:2016-02-16 21:29:55

标签: wordpress woocommerce storefront

我想编辑Storefront主题标题迷你购物车中的文字: ' X项' 只是: ' X' http://demo.woothemes.com/storefront/

我在哪里可以访问它?无法在店面或woocommerce文件中的任何位置找到它。我可以在header.php中看到钩子: storefront_header_cart 但是在其他文件中找不到任何功能吗?

我想将鼠标悬停在它上面时删除下拉列表。我在哪里可以改变这个?

1 个答案:

答案 0 :(得分:2)

该功能由BasicDBObject item1 = new BasicDBObject("STR1", "text").append("STR2", "txt"); // also for item2 and item3... BasicDBObject field3 = new BasicDBObject("ITEM1", item1).append("ITEM2", item2); update.put("$set", new BasicDBObject("FIELD3", field3)); 功能...

处理

你可以覆盖这个功能... open functions.php ...寻找storefront_cart_link

正上方,粘贴此代码......

require get_template_directory() . '/inc/init.php';

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' ); ?>"> <?php echo wp_kses_data( WC()->cart->get_cart_subtotal() ); ?> <span class="count"><?php echo wp_kses_data( sprintf( '%d', WC()->cart->get_cart_contents_count() ) );?></span> </a> <?php } } 已加载此调用storefront_cart_link。所以上面将首先加载,使得require get_template_directory() . '/inc/init.php';的调用不再创建该函数。

这样可以解决问题..但最好使用子主题...你可以直接将上面的函数粘贴到子主题的functions.php上。子主题上的functions.php将首先加载父类的函数,因此首先使您的函数存在。