Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save UraraReika/a59a0ffac70c5a2fa8fbf5fd3f4b44c9 to your computer and use it in GitHub Desktop.
Save UraraReika/a59a0ffac70c5a2fa8fbf5fd3f4b44c9 to your computer and use it in GitHub Desktop.
Replace default Elementor image placeholder to Woocommerce Placeholder image
<?php
add_filter( 'jet-woo-builder/template-functions/placeholder-thumbnail-src', '__your_prefix_get_wc_placeholder_image' );
function __your_prefix_get_wc_placeholder_image() {
$placeholder = wc_placeholder_img_src( 'woocommerce_thumbnail' );
return $placeholder;
}
@Salimoh
Copy link

Salimoh commented Jul 17, 2021

Thanks, Perfectly worked on my client site, but I had to remove opening php tag, I think it is better to remove opening php tag. Should be mentioned that I am using Elementor pro+jetwoobuilder.

add_filter('jet-woo-builder/template-functions/product-thumbnail-placeholder', '__your_prefix_get_wc_placeholder_image');`

    function __your_prefix_get_wc_placeholder_image() {
            $placeholder = wc_placeholder_img_src( 'woocommerce_thumbnail' );

            return $placeholder;
    }

@UraraReika
Copy link
Author

This opening php tags used for highlighting the php syntax.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment