{"id":7132,"date":"2020-06-10T10:11:08","date_gmt":"2020-06-10T02:11:08","guid":{"rendered":"https:\/\/blog.naibabiji.com\/?p=7132"},"modified":"2020-08-14T16:51:22","modified_gmt":"2020-08-14T08:51:22","slug":"change-add-to-cart-button-text","status":"publish","type":"post","link":"https:\/\/blog.naibabiji.com\/woocommerce\/change-add-to-cart-button-text.html","title":{"rendered":"\u4fee\u6539WooCommerce\u9ed8\u8ba4\u6dfb\u52a0\u5230\u8d2d\u7269\u8f66\u6309\u94ae\u6587\u5b57\u7684\u65b9\u6cd5"},"content":{"rendered":"<p>\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0cWooCommerce\u5b89\u88c5\u5b8c\u6bd5\u8d2d\u7269\u8f66\u6309\u94ae\u7684\u6587\u5b57\u662f\u201c\u52a0\u5165\u8d2d\u7269\u8f66\u201d\u6216\u8005\u201cADD TO CART\u201d\uff0c\u6709\u4e9b\u5916\u8d38\u7f51\u7ad9\u4f1a\u4e3a\u4e86\u8ffd\u6c42\u4e2a\u6027\u5316\uff0c\u60f3\u8981\u4fee\u6539\u8fd9\u4e2a\u6dfb\u52a0\u5230\u8d2d\u7269\u8f66\u6309\u94ae\u7684\u6587\u5b57\u5185\u5bb9\uff0c\u65b9\u6cd5\u975e\u5e38\u7b80\u5355\uff0c\u53ea\u9700\u8981\u6dfb\u52a0\u4e00\u6bb5\u4ee3\u7801\u5230\u4e3b\u9898\u51fd\u6570\u6587\u4ef6\u5c31\u53ef\u4ee5\u89e3\u51b3\u4e86\uff0c\u6548\u679c\u5982\u4e0b\u56fe\uff1a<\/p>\n<p><a href=\"https:\/\/edgeone.naibabiji.com\/wp-content\/uploads\/2020\/06\/103173b55a289078c19ef5c24b712464.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-7133 size-full\" src=\"https:\/\/edgeone.naibabiji.com\/wp-content\/uploads\/2020\/06\/103173b55a289078c19ef5c24b712464.png\" alt=\"woocommerce\u6dfb\u52a0\u5230\u8d2d\u7269\u8f66\u6309\u94ae\u6539\u6587\u5b57\" width=\"837\" height=\"388\" \/><\/a><\/p>\n<p>\u5b9e\u73b0\u65b9\u6cd5\uff1a\u590d\u5236\u4e0b\u9762\u5185\u5bb9\u6dfb\u52a0\u5230\u4e3b\u9898\u51fd\u6570\u6587\u4ef6\u91cc\u9762\u3002<\/p>\n<pre>\/\/ \u4fee\u6539\u5355\u4e2a\u4ea7\u54c1\u9875\u9762\u7684\u8d2d\u7269\u8f66\u6309\u94ae\u6587\u5b57\r\n\/\/ https:\/\/blog.naibabiji.com\/woocommerce\/change-add-to-cart-button-text.html\r\nadd_filter( 'woocommerce_product_single_add_to_cart_text', 'woocommerce_custom_single_add_to_cart_text' ); \r\nfunction woocommerce_custom_single_add_to_cart_text() {\r\n    return __( 'Buy Now', 'woocommerce' ); \r\n}\r\n\r\n\/\/ \u4fee\u6539\u4ea7\u54c1\u5f52\u6863\u9875\u8d2d\u7269\u8f66\u6309\u94ae\u6587\u5b57\r\nadd_filter( 'woocommerce_product_add_to_cart_text', 'woocommerce_custom_product_add_to_cart_text' );  \r\nfunction woocommerce_custom_product_add_to_cart_text() {\r\n    return __( 'Buy Now', 'woocommerce' );\r\n}<\/pre>\n<p>\u81ea\u5df1\u4fee\u6539\u4e0a\u9762\u4ee3\u7801\u91cc\u9762\u7684Buy Now\u4e3a\u4f60\u60f3\u8981\u4fee\u6539\u7684\u5185\u5bb9\u5c31\u53ef\u4ee5\u4e86\u3002<\/p>\n<p>\u5982\u679c\u4f60\u60f3\u7ed9WooCommerce\u6dfb\u52a0\u8be2\u76d8\u6309\u94ae\u7684\u8bdd\uff0c\u53c2\u89c1\u4e0b\u9762\u4e24\u7bc7\u6587\u7ae0\uff1a<\/p>\n<ol>\n<li><a href=\"https:\/\/blog.naibabiji.com\/files\/wordpress-woocommerce-quote.html\">5\u6b3eWordPress\u53d1\u9001\u8be2\u76d8\u63d2\u4ef6_WooCommerce\u90ae\u4ef6\u8be2\u4ef7\u6309\u94ae<\/a><\/li>\n<li><a href=\"https:\/\/blog.naibabiji.com\/woocommerce\/woocommerce-extra-button.html\">\u7ed9WooCommerce\u8d2d\u7269\u6309\u94ae\u4e0b\u65b9\u6dfb\u52a0\u81ea\u5b9a\u4e49\u6309\u94ae<\/a><\/li>\n<li><a href=\"https:\/\/blog.naibabiji.com\/woocommerce\/catalog-mode.html\">\u5220\u9664\u548c\u9690\u85cfWooCommerce\u6dfb\u52a0\u5230\u8d2d\u7269\u8f66\u6309\u94ae\u7684\u51e0\u79cd\u65b9\u5f0f<\/a><\/li>\n<\/ol>\n\n\n<div class=\"kk-star-ratings kksr-auto kksr-align-center kksr-valign-bottom\"\n    data-payload='{&quot;align&quot;:&quot;center&quot;,&quot;id&quot;:&quot;7132&quot;,&quot;slug&quot;:&quot;default&quot;,&quot;valign&quot;:&quot;bottom&quot;,&quot;ignore&quot;:&quot;&quot;,&quot;reference&quot;:&quot;auto&quot;,&quot;class&quot;:&quot;&quot;,&quot;count&quot;:&quot;3&quot;,&quot;legendonly&quot;:&quot;&quot;,&quot;readonly&quot;:&quot;&quot;,&quot;score&quot;:&quot;3&quot;,&quot;starsonly&quot;:&quot;&quot;,&quot;best&quot;:&quot;5&quot;,&quot;gap&quot;:&quot;4&quot;,&quot;greet&quot;:&quot;\u7ed9\u672c\u6587\u6253\u5206 post&quot;,&quot;legend&quot;:&quot;3\\\/5 - (3 votes)&quot;,&quot;size&quot;:&quot;24&quot;,&quot;title&quot;:&quot;\u4fee\u6539WooCommerce\u9ed8\u8ba4\u6dfb\u52a0\u5230\u8d2d\u7269\u8f66\u6309\u94ae\u6587\u5b57\u7684\u65b9\u6cd5&quot;,&quot;width&quot;:&quot;82&quot;,&quot;_legend&quot;:&quot;{score}\\\/{best} - ({count} {votes})&quot;,&quot;font_factor&quot;:&quot;1.25&quot;}'>\n            \n<div class=\"kksr-stars\">\n    \n<div class=\"kksr-stars-inactive\">\n            <div class=\"kksr-star\" data-star=\"1\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"2\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"3\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"4\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"5\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n    <\/div>\n    \n<div class=\"kksr-stars-active\" style=\"width: 82px;\">\n            <div class=\"kksr-star\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n    <\/div>\n<\/div>\n                \n\n<div class=\"kksr-legend\" style=\"font-size: 19.2px;\">\n            3\/5 - (3 votes)    <\/div>\n    <\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0cWooCommerce\u5b89\u88c5\u5b8c\u6bd5\u8d2d\u7269\u8f66\u6309\u94ae\u7684\u6587\u5b57\u662f\u201c\u52a0\u5165\u8d2d\u7269\u8f66\u201d\u6216\u8005\u201cADD TO CART\u201d\uff0c\u6709\u4e9b [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":7134,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"slim_seo":{"title":"\u4fee\u6539WooCommerce\u9ed8\u8ba4\u6dfb\u52a0\u5230\u8d2d\u7269\u8f66\u6309\u94ae\u6587\u5b57\u7684\u65b9\u6cd5 - \u5976\u7238\u5efa\u7ad9\u7b14\u8bb0","description":"\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0cWooCommerce\u5b89\u88c5\u5b8c\u6bd5\u8d2d\u7269\u8f66\u6309\u94ae\u7684\u6587\u5b57\u662f\u201c\u52a0\u5165\u8d2d\u7269\u8f66\u201d\u6216\u8005\u201cADD TO CART\u201d\uff0c\u6709\u4e9b\u5916\u8d38\u7f51\u7ad9\u4f1a\u4e3a\u4e86\u8ffd\u6c42\u4e2a\u6027\u5316\uff0c\u60f3\u8981\u4fee\u6539\u8fd9\u4e2a\u6dfb\u52a0\u5230\u8d2d\u7269\u8f66\u6309\u94ae\u7684\u6587\u5b57\u5185\u5bb9\uff0c\u65b9\u6cd5\u975e\u5e38\u7b80\u5355\uff0c\u53ea\u9700\u8981\u6dfb\u52a0\u4e00\u6bb5\u4ee3\u7801\u5230\u4e3b\u9898\u51fd\u6570\u6587\u4ef6\u5c31\u53ef\u4ee5\u89e3\u51b3\u4e86\uff0c\u6548\u679c\u5982\u4e0b\u56fe\uff1a \u5b9e\u73b0\u65b9\u6cd5\uff1a\u590d\u5236\u4e0b\u9762\u5185\u5bb9\u6dfb\u52a0\u5230\u4e3b\u9898\u51fd\u6570\u6587\u4ef6\u91cc\u9762\u3002 \u81ea\u5df1\u4fee\u6539\u4e0a\u9762\u4ee3\u7801\u91cc\u9762\u7684"},"footnotes":""},"categories":[405],"tags":[],"class_list":["post-7132","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-woocommerce"],"_links":{"self":[{"href":"https:\/\/blog.naibabiji.com\/wp-json\/wp\/v2\/posts\/7132","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.naibabiji.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.naibabiji.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.naibabiji.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.naibabiji.com\/wp-json\/wp\/v2\/comments?post=7132"}],"version-history":[{"count":0,"href":"https:\/\/blog.naibabiji.com\/wp-json\/wp\/v2\/posts\/7132\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.naibabiji.com\/wp-json\/wp\/v2\/media\/7134"}],"wp:attachment":[{"href":"https:\/\/blog.naibabiji.com\/wp-json\/wp\/v2\/media?parent=7132"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.naibabiji.com\/wp-json\/wp\/v2\/categories?post=7132"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.naibabiji.com\/wp-json\/wp\/v2\/tags?post=7132"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}