W
W
wanderbit2016-09-10 17:37:18
WordPress
wanderbit, 2016-09-10 17:37:18

How to move the block of similar products to the place after the price in woocommerce and disable the image display?

How to move the block of similar products to the place after the price in woocommerce?
I was able to duplicate this block using the function

add_action( 'woocommerce_single_product_summary', 'woocommerce_related_products', 70 );

But how can I remove the product image in this block and remove it at the bottom of the page?
This 75a7f36cd2404f32ac9062ac7b14a7f2.pngfunction removes everything and I need to leave the block only after the price
function wc_remove_related_products( $args ) {
  return array();
}
 add_filter('woocommerce_related_products_args','wc_remove_related_products', 10);

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ivan Kozlov, 2016-09-12
@trampick

Option 1: The same content-product.php template is responsible for displaying product cards in catalog form. There you need to write crutches.
Option 2: the woocommerce_template_loop_product_thumbnail hook is responsible for displaying the thumbnail.
You need to add an example code to functions.php

if (strpos('_'.$_SERVER['REQUEST_URI'], 'category') < 1){
remove_action( 'woocommerce_before_shop_loop_item_title', 'woocommerce_template_loop_product_thumbnail', 10 );
}

Option 3: Hide the image via css property display:none;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question