Tagged: placeholder image, product image, woocommerce
-
AuthorPosts
-
April 26, 2016 at 8:12 pm #622500
Hey,
I tried these:
http://stackoverflow.com/questions/27844825/how-does-one-replace-woocommerce-default-placeholder-image-for-shop-categories#answers-header
https://docs.woothemes.com/document/change-the-placeholder-image/But dont work… :( Do you have any idea?
Kind regards,
PeterApril 26, 2016 at 8:40 pm #622513Hm, 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
April 29, 2016 at 12:30 pm #624323Hi,
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,
Ismael-
This reply was modified 9 years, 6 months ago by
Ismael.
May 11, 2016 at 5:06 pm #630840Amazing it’s work! :) Thank you!
-
This reply was modified 9 years, 6 months ago by
-
AuthorPosts
- The topic ‘Woocommerce placeholder image’ is closed to new replies.
