👋🏼Welcome to my WP-Host blog where I am excited to share my knowledge and expertise on WordPress hosting and website construction tutorials with you. Let’s connect and learn from each other! You can reach me at info@yrshare.com.

(如果你会中文,可以点击微信图标与我联系。)

扫一扫加我

注:因个人英文水平有限,所以暂时只能为懂中文的朋友提供wordpress建站服务

微信:18200592859 或 yrwordpress

修改Woocommerce产品列表页按扭文字

修改Woocommerce产品列表页按扭文字:默认情况下,只要woocommerce产品有多个价格属性时,woocommerce的产品列表页中,产品卡片上近按扭会显示为【选择选项】,很多用户觉得这要显示并不好。所以今天的wordpress教程就给大家分享如何修改上面的文字。

【WP-Host/悦然wordpress建站】
Modify the button text on the Woocommerce product list page-WP-Host

Continue to share the WordPress tutorial with you. Recently, 【WP-Host/悦然wordpress建站】 is working on a WordPress+WOOCOMMERCE shopping mall website construction project. Due to the large number of product attributes of customers, the text displayed on the default product list page of WOOCOMMERCE is “Select Options”, which means that customers can choose the corresponding product model to purchase. However, this does not conform to our daily shopping habits, and I always feel a bit strange, So I changed this text to “Buy Now”

Methods as below:

Open the functions.php file of the current wordpress website building theme, then add the following code to this file, and then save it.

//Modify the button text on the WOOCOMMERCE product list page
add_filter('woocommerce_product_add_to_cart_text', 'woo_archive_custom_cart_button_text'); // 2.1 + 

function woo_archive_custom_cart_button_text() { 

    return __('Buy Now', 'woocommerce'); 
} 

Note: You can change the [Buy Now] above to any text you want.

Modify the button text on the Woocommerce product list page-WP-Host

After the modification is complete, refresh the page to see the effect, as shown in the figure above.

Modify the button text on the Woocommerce product list page-WP-Host

继续给大家分享wordpress建站教程。之前悦然wordpress建站在做一个wordpress+woocommerce商城网站建设项目,因为客户的产品属性比较多,所以在woocommerce默认产品列表页中,产品的按扭显示文字为【选择选项】,意思是让客户选择对应的产品型号来购买,但是这并不符合我们的日常购物习惯,总觉得有一些奇怪,所以我把这个文字改成了【立即购买】

方法如下:

打开当前wordpress建站主题的functions.php文件,然后把这个文件中添加以下代码,然后保存即可。

//修改woo产品列表页按钮文字【www.zsxxfx.com收集整理】
add_filter('woocommerce_product_add_to_cart_text', 'woo_archive_custom_cart_button_text'); // 2.1 + 

function woo_archive_custom_cart_button_text() { 

    return __('立即购买', 'woocommerce'); 
} 

注意:你可以把上面的【立即购买】改成任何你想要的文字。

Modify the button text on the Woocommerce product list page-WP-Host

修改完成后刷新页面即可看到效果,如上图所示。

WordPress Hosting / 悦然wordpress建站

WordPress Hosting / 悦然wordpress建站

【WordPress Hosting / 悦然wordpress建站】我是来自中国的wordpress爱好,喜欢与世界各地的朋友一起交流学习wordpress建站和维护相关知识。