我在这里想要做的是从迷你购物车中删除较小的图像,看来我找不到真正的目录来对其进行修改。这些是我添加到function.php和review-order.php中的代码。 The attachment is my image of the interface
review-order.php
<?php $thumbnail= apply_filters( 'woocommerce_in_cart_product_thumbnail', $_product->get_image(), $cart_item, $cart_item_key ); ?>
Function.php
global $product;
if (is_cart()){ echo "<style>#checkout_thumbnail{display:none;}</style>"; }
$item_data = $cart_item_key['data'];
$post = get_post($item_data->id);
$thumb = get_the_post_thumbnail($item_data->id, array( 100, 100));
echo '<div id="checkout_thumbnail" style="float: left; padding-right: 8px">' . $thumb . '</div> ' . $post->post_title; } add_filter('woocommerce_cart_item_name', isa_woo_cart_attributes, 10, 2);```
答案 0 :(得分:0)
将此代码过滤器放置在function.php上,它将从购物车页面中删除图像:
function sv_remove_cart_product_link( $product_link, $cart_item, $cart_item_key ) {
$product = apply_filters( 'woocommerce_cart_item_product', $cart_item['data'], $cart_item, $cart_item_key );
return $product->get_title();
}
add_filter( 'woocommerce_cart_item_name', 'sv_remove_cart_product_link', 10, 3 );
答案 1 :(得分:0)
以CSS样式添加此CSS
.woocommerce table.cart .product-thumbnail { display:none !important; }