wcfm-santa

A deal you can't resist! Get upto 35% Off on this entire cyber week.

CLAIM OFFER
01Day 20Hr 06Min 46Sec
wcfm-santa

Change woocommerce image placeholder

We're shifting our Forum based support to a more dedicated support system!

We'll be closing our Forum support from 10th June, 2020 and move to Email Support assistance.

  • If you are a WCFM premium add-ons user, contact us- here
  • Want to know more before buying our add-ons? Send Pre sale queries- here
  • If you are a WCFM free user, please open a support ticket at WordPress.org
  • For WCFM App related queries, reach us- here
From now the forum will be read-only!

Viewing 6 reply threads
  • Author
    Posts
    • #101002
      paattal
      Participant

      Hi,

      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

    • #101499
      paattal
      Participant

      no answer ?

    • #102021
      Sushobhan
      Keymaster

      Hello,
      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

    • #102028
      paattal
      Participant

      Hello,

      Thank you, I tested your filter but sorry, the image is still not changed. I have always woocommerce-placeholder.png displayed. 🙁

    • #102143
      Sushobhan
      Keymaster

      As 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.

    • #102163
      paattal
      Participant

      Hello,

      Great ! I had not seen this option, it works perfectly thanks for the tip 🙂

    • #102267
      Sushobhan
      Keymaster

      You are welcome 🙂

Viewing 6 reply threads
  • You must be logged in to reply to this topic.