Best Multi Vendor Marketplace Plugin for WordPress › Forums › WCFM – Marketplace (WooCommerce Multivendor Marketplace) › Change woocommerce image placeholder
Tagged: woocommerce image placeholder
- This topic has 6 replies, 2 voices, and was last updated 5 years, 4 months ago by
Sushobhan.
- AuthorPosts
- January 5, 2020 at 9:17 pm #101002
paattal
ParticipantHi,
I use this snippet in my functions.php to change woocommerce image placeholder :
add_filter('woocommerce_placeholder_img_src', 'custom_woocommerce_placeholder_img_src'); function custom_woocommerce_placeholder_img_src( $src ) { $upload_dir = wp_upload_dir(); $uploads = untrailingslashit( $upload_dir['baseurl'] ); $src = $uploads . '/2019/12/charging-station.jpg'; return $src; }
That’s works fine in product page but not in vendor page managed by WCFM. How can I do to have the same feature in vendor page ?
Thanks
- January 9, 2020 at 9:33 pm #101499
paattal
Participantno answer ?
- January 14, 2020 at 3:54 pm #102021
Sushobhan
KeymasterHello,
You can use the following filter to do that-
apply_filters( 'wcfm_default_placeholder_image', $WCFM->plugin_url . 'includes/libs/upload/images/Placeholder.png' );
Thanks
- January 14, 2020 at 5:16 pm #102028
paattal
ParticipantHello,
Thank you, I tested your filter but sorry, the image is still not changed. I have always woocommerce-placeholder.png displayed. 🙁
- January 15, 2020 at 6:49 pm #102143
Sushobhan
KeymasterAs of WooCommerce 3.5x the placeholder image can now be set at: WooCommerce > Settings > Products
So you don’t need to use any code snippet for this. - January 15, 2020 at 10:00 pm #102163
paattal
ParticipantHello,
Great ! I had not seen this option, it works perfectly thanks for the tip 🙂
- January 16, 2020 at 12:44 pm #102267
Sushobhan
KeymasterYou are welcome 🙂
- AuthorPosts
- You must be logged in to reply to this topic.