Bhupender rathor
Bhupender rathor

Reputation: 34

How Display Woocommerce Image on cart Page

I develope a woo-commerce website all product image is shown but these images are not shown full size in Cart page, and I want that product images are shown full size, please help me?

$thumbnail = apply_filters( 'get_the_post_thumbnail_url', $_product->get_image(), $cart_item, $cart_item_key, 'full' );

if ( ! $product_permalink ) {
    echo $thumbnail;
} else {
    printf( '<a href="%s">%s</a>', esc_url( $product_permalink ), $thumbnail );
}

Upvotes: 0

Views: 2010

Answers (1)

Vel
Vel

Reputation: 9331

Try this code.

You need to add full in $_product->get_image('full')

<?php
    $thumbnail = apply_filters( 'woocommerce_cart_item_thumbnail', $_product->get_image('full'), $cart_item, $cart_item_key );  

    if ( ! $product_permalink ) {
        echo $thumbnail; // PHPCS: XSS ok.
    } else {
        printf( '<a href="%s">%s</a>', esc_url( $product_permalink ), $thumbnail ); // PHPCS: XSS ok.
    }
?>

Upvotes: 1

Related Questions