代码如下:
// 结账页产品图片显示
add_filter( 'woocommerce_cart_item_name', 'product_thumbnail_in_checkout', 20, 3 );
function product_thumbnail_in_checkout( $product_name, $cart_item, $cart_item_key ){
if ( is_checkout() )
{
// $thumbnail = $cart_item['data']->get_image('woocommerce_thumbnail');
$thumbnail = $cart_item['data']->get_image(array(60,90));
$image_html = '<div class="product-item-thumbnail inline-block">'.$thumbnail.'</div> ';
$product_name = $image_html . $product_name;
}
return $product_name;
}
购物车中和结账页一样的。
© 版权声明
THE END
暂无评论内容