Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • #622500


    I tried these: (Purchase code hidden if logged out)(Purchase code hidden if logged out) -categories#answers-header

    How to Customize the WooCommerce Placeholder Image

    But dont work… :( Do you have any idea?

    Kind regards,


    Hm, I see the placholder image on the backend and I see the placeholder image on the singel product page… but I dont see the placeholder image on the shop / catalog page.

    Thank you



    Thank you for using Enfold.

    The theme is not using the default product thumbnail template. Add this in the functions.php file to add a placeholder:

    add_action( 'after_setup_theme', 'after_setup_theme_mod' );
    function after_setup_theme_mod(){
        remove_action( 'woocommerce_before_shop_loop_item_title', 'avia_woocommerce_thumbnail', 10);
        add_action( 'woocommerce_before_shop_loop_item_title', 'avia_woocommerce_thumbnail_mod', 10);
    function avia_woocommerce_thumbnail_mod($asdf)
    	global $product, $avia_config;
    	$rating = $product->get_rating_html(); //get rating
    	$id = get_the_ID();
    	$size = 'shop_catalog';
    	echo "<div class='thumbnail_container'>";
    		echo avia_woocommerce_gallery_first_thumbnail( $id , $size);
    		$thumbnail =  get_the_post_thumbnail( $id , $size );
    		if(!empty($thumbnail)) {
    			echo $thumbnail;
    		else {
    			echo "<img src='PLACEHOLDER IMAGE HERE'/>";
    		if(!empty($rating)) echo "<span class='rating_container'>".$rating."</span>";
    		if($product->product_type == 'simple') echo "<span class='cart-loading'></span>";
    	echo "</div>

    Adjust the src attribute “PLACEHOLDER IMAGE HERE”.

    Best regards,

    • This reply was modified 2 years, 5 months ago by  Ismael.

    Amazing it’s work! :) Thank you!

Viewing 4 posts - 1 through 4 (of 4 total)

The topic ‘Woocommerce placeholder image’ is closed to new replies.