{"id":7745,"date":"2021-07-21T20:36:31","date_gmt":"2021-07-21T12:36:31","guid":{"rendered":"https:\/\/blog.naibabiji.com\/?p=7745"},"modified":"2021-07-21T20:36:31","modified_gmt":"2021-07-21T12:36:31","slug":"after-payment-redirect","status":"publish","type":"post","link":"https:\/\/blog.naibabiji.com\/woocommerce\/after-payment-redirect.html","title":{"rendered":"\u7ed9WooCommerce\u6dfb\u52a0\u4ed8\u6b3e\u6210\u529f\u63d0\u793a\u9875\u9762\u7684\u65b9\u6cd5"},"content":{"rendered":"<p><a href=\"https:\/\/blog.naibabiji.com\/fob-website-guide\" target=\"_blank\" rel=\"noopener\">\u5916\u8d38\u5efa\u7ad9<\/a>\u65f6\u4e0d\u5c11\u4f01\u4e1a\u90fd\u91c7\u7528WooCommerce\u505a\u7535\u5546\u7cfb\u7edf\u6765\u9500\u552e\u81ea\u5df1\u7684\u4ea7\u54c1\uff0c\u4eca\u5929\u5206\u4eab\u4e00\u4e0b\u5728\u5ba2\u6237\u4ed8\u6b3e\u5b8c\u6bd5\u540e\u518d\u6b21\u8425\u9500\u7684\u65b9\u6cd5\uff0c\u4f8b\u5982\u5c55\u793a\u76f8\u5173\u4ea7\u54c1\u3001\u5f15\u5bfc\u5206\u4eab\u5173\u6ce8\u3001\u6216\u8005\u4e00\u4e2a\u5f88\u6f02\u4eae\u7684\u611f\u8c22\u9875\u9762\u3002\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528WooCommerce\u4ed8\u6b3e\u540e\u91cd\u5b9a\u5411\u529f\u80fd\u3002<\/p>\n<p><strong>\u5177\u4f53\u64cd\u4f5c\u65b9\u6cd5\u5982\u4e0b\uff1a<\/strong><\/p>\n<p>1\u3001\u65b0\u5efa\u4e00\u4e2a\u9700\u8981\u8df3\u8f6c\u7684\u9875\u9762\u3002<\/p>\n<p>2\u3001\u590d\u5236\u4e0b\u9762\u7684\u4ee3\u7801\uff0c\u7c98\u8d34\u5230\u4e3b\u9898\u51fd\u6570\u6587\u4ef6\u91cc\u9762\u3002<\/p>\n<pre>\/**\r\n* WooCommerce\u4ed8\u6b3e\u540e\u91cd\u5b9a\u5411\u9875\u9762\r\n* @link https:\/\/blog.naibabiji.com\/\r\n*\/\r\n\r\nadd_action( 'woocommerce_thankyou', 'naibabiji_woocommerce_payment_redirect');\r\nfunction naibabiji_woocommerce_payment_redirect( $order_id ){\r\n$order = wc_get_order( $order_id );\r\n$url = 'https:\/\/blog.naibabiji.com\/';\r\nif ( ! $order-&gt;has_status( 'failed' ) ) {\r\nwp_safe_redirect( $url );\r\nexit;\r\n}\r\n}<\/pre>\n<p>3\u3001\u4fee\u6539\u4e0a\u9762\u4ee3\u7801\u4e2d$url =\u540e\u9762\u7684\u7f51\u5740\u4e3a\u8df3\u8f6c\u9875\u9762\u7684\u7f51\u5740\u3002<\/p>\n<p>\u4fdd\u5b58\u540e\u6d4b\u8bd5\u4e0b\u662f\u5426\u751f\u6548\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"762\" height=\"1010\" class=\"alignnone wp-image-7746 size-full\" src=\"https:\/\/edgeone.naibabiji.com\/wp-content\/uploads\/2020\/08\/Pasted-into-\u7ed9WooCommerce\u6dfb\u52a0\u4ed8\u6b3e\u6210\u529f\u63d0\u793a\u9875\u9762\u7684\u65b9\u6cd5.png\" \/><\/p>\n<p>\u6700\u540e\uff0c\u5982\u679c\u4f60\u89c9\u5f97\u8fd9\u4e2a\u4ee3\u7801\u592a\u7b80\u5355\u4e86\uff0c\u4e0d\u80fd\u6ee1\u8db3\u4f60\u4e2a\u6027\u5316\u7684\u8df3\u8f6c\u9700\u6c42\uff0c\u90a3\u4e48\u53ef\u4ee5\u4f7f\u7528\u4e0b\u9762\u8fd9\u4e2a\u4ed8\u8d39\u63d2\u4ef6\u6765\u5e2e\u4f60\u5904\u7406\u3002<\/p>\n<p><a href=\"https:\/\/yithemes.com\/themes\/plugins\/yith-custom-thank-you-page-for-woocommerce\/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">YITH WooCommerce Custom Thank You Page<\/a><\/p>\n<p>\u8fd9\u6b3e\u63d2\u4ef6\u53ef\u4ee5\u5e2e\u4f60\u81ea\u5b9a\u4e49\u5b8c\u6210\u8ba2\u5355\u540e\u663e\u793a\u7ed9\u5ba2\u6237\u7684\u201c\u8c22\u8c22\u201d\u9875\u9762\uff0c\u5e76\u4f7f\u7528\u5b83\u6765\u4fc3\u9500\u52a0\u552e\u4ea7\u54c1\u3002<\/p>\n<ol>\n<li>\u60a8\u53ef\u4ee5\u4e3a\u6574\u4e2a\u5546\u5e97\u6216\u5355\u4e2a\u4ea7\u54c1\u81ea\u5b9a\u4e49\u201c\u8c22\u8c22\u201d\u9875\u9762\u3002<\/li>\n<li>\u60a8\u53ef\u4ee5\u5229\u7528\u201c\u8c22\u8c22\u201d\u9875\u9762\u6765\u4fc3\u9500\u4e0e\u521a\u521a\u8d2d\u4e70\u7684\u4ea7\u54c1\u76f8\u5173\u7684\u4ea7\u54c1\uff0c\u4ece\u800c\u589e\u52a0\u9500\u552e\u91cf\u3002<\/li>\n<li>\u901a\u8fc7\u8ba9\u5ba2\u6237\u5728\u793e\u4ea4\u7f51\u7edc\u4e0a\u5206\u4eab\u4ed6\u4eec\u7684\u8d2d\u4e70\uff0c\u60a8\u53ef\u4ee5\u4e3a\u60a8\u7684\u5546\u5e97\u548c\u4ea7\u54c1\u83b7\u5f97\u95f4\u63a5\u5e7f\u544a\u3002<\/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;7745&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;2&quot;,&quot;legendonly&quot;:&quot;&quot;,&quot;readonly&quot;:&quot;&quot;,&quot;score&quot;:&quot;5&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;5\\\/5 - (2 votes)&quot;,&quot;size&quot;:&quot;24&quot;,&quot;title&quot;:&quot;\u7ed9WooCommerce\u6dfb\u52a0\u4ed8\u6b3e\u6210\u529f\u63d0\u793a\u9875\u9762\u7684\u65b9\u6cd5&quot;,&quot;width&quot;:&quot;138&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: 138px;\">\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            5\/5 - (2 votes)    <\/div>\n    <\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u5916\u8d38\u5efa\u7ad9\u65f6\u4e0d\u5c11\u4f01\u4e1a\u90fd\u91c7\u7528WooCommerce\u505a\u7535\u5546\u7cfb\u7edf\u6765\u9500\u552e\u81ea\u5df1\u7684\u4ea7\u54c1\uff0c\u4eca\u5929\u5206\u4eab\u4e00\u4e0b\u5728\u5ba2\u6237\u4ed8\u6b3e\u5b8c\u6bd5\u540e\u518d\u6b21\u8425\u9500 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":9209,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"slim_seo":{"title":"\u7ed9WooCommerce\u6dfb\u52a0\u4ed8\u6b3e\u6210\u529f\u63d0\u793a\u9875\u9762\u7684\u65b9\u6cd5 - \u5976\u7238\u5efa\u7ad9\u7b14\u8bb0","description":"\u5916\u8d38\u5efa\u7ad9 \u65f6\u4e0d\u5c11\u4f01\u4e1a\u90fd\u91c7\u7528WooCommerce\u505a\u7535\u5546\u7cfb\u7edf\u6765\u9500\u552e\u81ea\u5df1\u7684\u4ea7\u54c1\uff0c\u4eca\u5929\u5206\u4eab\u4e00\u4e0b\u5728\u5ba2\u6237\u4ed8\u6b3e\u5b8c\u6bd5\u540e\u518d\u6b21\u8425\u9500\u7684\u65b9\u6cd5\uff0c\u4f8b\u5982\u5c55\u793a\u76f8\u5173\u4ea7\u54c1\u3001\u5f15\u5bfc\u5206\u4eab\u5173\u6ce8\u3001\u6216\u8005\u4e00\u4e2a\u5f88\u6f02\u4eae\u7684\u611f\u8c22\u9875\u9762\u3002\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528WooCommerce\u4ed8\u6b3e\u540e\u91cd\u5b9a\u5411\u529f\u80fd\u3002 \u5177\u4f53\u64cd\u4f5c\u65b9\u6cd5\u5982\u4e0b\uff1a 1\u3001\u65b0\u5efa\u4e00\u4e2a\u9700\u8981\u8df3\u8f6c\u7684\u9875\u9762\u3002 2\u3001\u590d\u5236\u4e0b\u9762\u7684\u4ee3\u7801\uff0c\u7c98\u8d34\u5230\u4e3b\u9898\u51fd\u6570\u6587\u4ef6"},"footnotes":""},"categories":[405],"tags":[],"class_list":["post-7745","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\/7745","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=7745"}],"version-history":[{"count":0,"href":"https:\/\/blog.naibabiji.com\/wp-json\/wp\/v2\/posts\/7745\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.naibabiji.com\/wp-json\/wp\/v2\/media\/9209"}],"wp:attachment":[{"href":"https:\/\/blog.naibabiji.com\/wp-json\/wp\/v2\/media?parent=7745"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.naibabiji.com\/wp-json\/wp\/v2\/categories?post=7745"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.naibabiji.com\/wp-json\/wp\/v2\/tags?post=7745"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}