Product photos appear above list of products at Checkout (Wordpress/WooCommerce) -


on wordpress website, using woocommerce, on checkout page, seeing photos appear above list of products @ checkout. how make them appear in list of products, shown?

enter image description here

this have @ moment:

add_action('woocommerce_checkout_before_order_review', 'displays_cart_products_feature_image'); function displays_cart_products_feature_image() {     foreach ( wc()->cart->get_cart() $cart_item ) {         $item = $cart_item['data'];         if(!empty($item)){             $product = new wc_product($item->id);             // $image = wp_get_attachment_image_src( get_post_thumbnail_id( $product->id ), 'single-post-thumbnail' );             echo $product->get_image();              // display first product image uncomment line bellow             // break;         }     } } 

this related get cart products id on checkout woocommerce page, display product images.

thanks!

enter image description here

instead of woocommerce_checkout_before_order_review, can use woocommerce_cart_item_name filter this:

add_action('woocommerce_cart_item_name', 'displays_cart_products_feature_image', 10, 2 ); function displays_cart_products_feature_image( $cart_item_name, $cart_item ) {      return ( is_checkout() ) ? $cart_item['data']->get_image() . $cart_item_name : $cart_item_name;  } 

what put image before product name. image below:

reigelgallarde.me

still not need right? yes it's closest thing can get. , css fixed problem.

.woocommerce-checkout-review-order-table .cart_item .product-name img {     float: right; } 

will below: enter image description here


Comments

Popular posts from this blog

python Tkinter Capturing keyboard events save as one single string -

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

javascript - Z-index in d3.js -