Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Bas Elbers

    (@baaaaas)

    Below function will add the product image to the Description column. Micro template is not supported.

    function add_product_image( $description, $item_id, $item ) {
    	$product = $item->get_product();
    
    	if ( $product ) {
    		$description = sprintf( '<table style="border:none;padding:0;margin:0;"><tr><td width="10%%" style="border:none;padding:0;"><img src="%s" width="50" height="50"/></td><td width="40%%" style="border:none;padding:0;text-align:left;">%s</td></tr></table>', wp_get_attachment_url( $product->get_image_id() ), $description );
    	}
    
    	return $description;
    }
    
    add_filter( 'wpi_item_description_data', 'add_product_image', 10, 3 );

    Where i have to put this code please guide me

    Thank you

    further, it will show image and product description is it ??

    Thanks in advance

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Add product image’ is closed to new replies.