{"id":528891,"date":"2021-10-20T15:05:57","date_gmt":"2021-10-20T07:05:57","guid":{"rendered":"https:\/\/loyseo.com\/code-snippet\/woocommerce%ef%bc%9a%e5%9c%a8%e7%b5%90%e5%b8%b3%e9%a0%81%e9%9d%a2%e4%b8%8a%e9%a1%af%e7%a4%ba%e7%94%a2%e5%93%81%e5%9c%96%e7%89%87\/"},"modified":"2023-08-25T14:37:33","modified_gmt":"2023-08-25T06:37:33","slug":"woocommerce-show-product-images-checkout-page","status":"publish","type":"code-snippet","link":"https:\/\/loyseo.com\/zh-hant\/code-snippet\/woocommerce-show-product-images-checkout-page\/","title":{"rendered":"WooCommerce\uff1a\u5728\u7d50\u5e33\u9801\u9762\u4e0a\u986f\u793a\u7522\u54c1\u5716\u7247"},"content":{"rendered":"\n<p><a href=\"https:\/\/loyseo.com\/zh-hant\/tutorial\/woocommerce\/\">WooCommerce<\/a> \u7d50\u5e33\u9801\u9762\u7684\u8a02\u55ae\u5be9\u67e5\u90e8\u5206\u986f\u793a\u4e86\u7522\u54c1\u540d\u7a31\u3001\u6578\u91cf\u548c\u8cbb\u7528\uff0c\u4f46\u6c92\u6709\u7522\u54c1\u5716\u50cf\uff0c\u7522\u54c1\u5716\u50cf\u5c0d\u65bc\u8b58\u5225\/\u5340\u5206\u76f8\u4f3c\u7522\u54c1\u6216\u7522\u54c1\u8b8a\u9ad4\u975e\u5e38\u6709\u7528\u3002<\/p>\n\n<p>\u9019\u500b\u7c21\u55ae\u7684\u4ee3\u78bc\u6bb5\u5c07\u8aac\u660e\u4f60\u5728\u8a02\u55ae\u5be9\u67e5\u9801\u9762\u4e2d\u5c55\u793a\u7522\u54c1\u7684\u7279\u8272\u5716\u7247\u3002<\/p>\n\n<figure class=\"wp-block-image\"><img fetchpriority=\"high\" decoding=\"async\" width=\"1024\" height=\"619\" src=\"https:\/\/loyseo.com\/wp-content\/uploads\/2021\/11\/woocommerce-product-image-checkout-page-1024x619-1.png\" alt=\"\" class=\"wp-image-513417\" title=\"-\"><\/figure>\n\n<p>\u901a\u904e\u6dfb\u52a0\u4e0b\u9762\u7684PHP\u4ee3\u78bc\u6bb5\uff0c\u60a8\u53ef\u4ee5\u5728\u7d50\u5e33\u9801\u9762\u4e2d\u7684\u7522\u54c1\u540d\u7a31\u5feb\u901f\u986f\u793a\u7522\u54c1\u7279\u8272\u5716\u7247<\/p>\n\n<h2 class=\"wp-block-heading\">PHP\u4ee3\u78bc\u6bb5\uff1a\u6dfb\u52a0\u7522\u54c1\u7279\u8272\u5716\u7247\u5230woocommerce\u7684\u7d50\u5e33\u9801\u9762\u7684\u8a02\u55ae\u5be9\u6838\u8868\u4e2d<\/h2>\n\n<p>\u8acb\u6ce8\u610f\uff0c\u4e0b\u9762\u7684\u7247\u6bb5\u5c07\u751f\u6210\u4e00\u500b\u5c3a\u5bf8\u70ba50*50\u50cf\u7d20\u7684\u7e2e\u7565\u5716\uff08\u8acb\u96a8\u610f\u6539\u8b8a\u9663\u5217\uff08\uff09\u5167\u7684\u5c3a\u5bf8\uff09\uff0c\u4e26\u5c07\u5176\u5411\u5de6\u5c0d\u9f4a\uff08\u79fb\u9664\u5305\u542bclass\u7684array\u5247\u53ef\u4ee5\u907f\u514d\u5de6\u5c0d\u9f4a\uff09\u3002<\/p>\n\n<div class=\"wp-block-syntaxhighlighter-code \">\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\/**\n* @snippet       Product Images @ Woo Checkout\n*\/\n\nadd_filter( 'woocommerce_cart_item_name', 'bbloomer_product_image_review_order_checkout', 9999, 3 );\n\nfunction bbloomer_product_image_review_order_checkout( $name, $cart_item, $cart_item_key ) {\n\nif ( ! is_checkout() ) return $name;\n\n$product = $cart_item['data'];\n\n$thumbnail = $product->get_image( array( '50', '50' ), array( 'class' => 'alignleft' ) );\n\nreturn $thumbnail . $name;\n\n}\n\n<\/pre>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>WooCommerce \u7d50\u5e33\u9801\u9762\u7684\u8a02\u55ae\u5be9\u67e5\u90e8\u5206\u986f\u793a\u4e86\u7522\u54c1\u540d\u7a31\u3001\u6578\u91cf\u548c\u8cbb\u7528\uff0c\u4f46\u6c92\u6709\u7522\u54c1\u5716\u50cf\uff0c\u7522\u54c1\u5716\u50cf\u5c0d\u65bc\u8b58\u5225\/\u5340\u5206\u76f8\u4f3c\u7522\u54c1\u6216\u7522\u54c1\u8b8a\u9ad4\u975e\u5e38\u6709\u7528\u3002 \u9019\u500b\u7c21\u55ae\u7684\u4ee3\u78bc\u6bb5\u5c07\u8aac\u660e\u4f60\u5728\u8a02\u55ae\u5be9\u67e5\u9801\u9762\u4e2d\u5c55\u793a\u7522\u54c1\u7684\u7279\u8272\u5716\u7247\u3002 \u901a\u904e\u6dfb\u52a0\u4e0b\u9762\u7684PHP\u4ee3\u78bc\u6bb5\uff0c\u60a8\u53ef\u4ee5\u5728\u7d50\u5e33\u9801\u9762\u4e2d\u7684\u7522\u54c1\u540d\u7a31\u5feb\u901f\u986f\u793a\u7522\u54c1\u7279\u8272\u5716\u7247 PHP\u4ee3\u78bc\u6bb5\uff1a\u6dfb\u52a0\u7522\u54c1\u7279\u8272\u5716\u7247\u5230woocommerce\u7684\u7d50\u5e33\u9801\u9762\u7684\u8a02\u55ae\u5be9\u6838\u8868\u4e2d \u8acb\u6ce8\u610f\uff0c\u4e0b\u9762\u7684\u7247\u6bb5\u5c07\u751f\u6210\u4e00\u500b\u5c3a\u5bf8\u70ba50 [&hellip;]<\/p>\n","protected":false},"featured_media":0,"template":"","class_list":["post-528891","code-snippet","type-code-snippet","status-publish","hentry"],"acf":[],"taxonomy_info":[],"featured_image_src_large":false,"author_info":[],"comment_info":"","_links":{"self":[{"href":"https:\/\/loyseo.com\/zh-hant\/wp-json\/wp\/v2\/code-snippet\/528891","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/loyseo.com\/zh-hant\/wp-json\/wp\/v2\/code-snippet"}],"about":[{"href":"https:\/\/loyseo.com\/zh-hant\/wp-json\/wp\/v2\/types\/code-snippet"}],"wp:attachment":[{"href":"https:\/\/loyseo.com\/zh-hant\/wp-json\/wp\/v2\/media?parent=528891"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}