• Resolved idee

    (@idee)


    Hi WP Lister Team,

    is it possible to use a custom featured image for the ebay auction, not the one from the woocommerce shop product?

    We need that for a certain profile/template.

    Edit: I found that filter. Is it possible to check first if template ID = 3? Because we use a spcific template and a specific profile for the products we want to show the custom featueed image. We do not want a custom featued image for all products.

    add_filter( "wple_get_product_main_image", "my_custom_ebay_product_main_image", 10, 2 );functionmy_custom_ebay_product_main_image( $image_url, $post_id) {
    // Check if a custom eBay image is set with AC
    $ebay_image= 'https://linkto image.com/img.jpg', $post_id);
    $image_url= $ebay_image? $ebay_image: $image_url;
    return$image_url;
    }

    • This topic was modified 1 year, 8 months ago by idee.
    • This topic was modified 1 year, 8 months ago by idee.
    • This topic was modified 1 year, 8 months ago by idee.
Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter idee

    (@idee)

    When I use that filter inside the templates function.php, it does show my custom featured image inside the wp lister product_gallery but does not use the image as the ebay main image

    add_filter( “wple_get_product_main_image”, “my_custom_ebay_product_main_image”, 10, 2 );

    function my_custom_ebay_product_main_image( $image_url ) {
    // Check if a custom eBay image is set with ACF
    $image_url = ‘https://data.spiegler.de/ebay/img/tusker_pro_ebay.jpg’;
    return $image_url;
    }

    Plugin Support WP Lab Support

    (@wp-lab-support)

    Hi @idee

    Thanks for reaching out. I will discuss this with the development team and we will be in touch.

    Kind regards,

    John

    Plugin Support iammvc

    (@iammvc)

    Hello @idee

    I recommend using the wple_filter_listing_item hook instead so you can have access to the template ID from the $listing object.

    Regards,

    Mike

    Thread Starter idee

    (@idee)

    Hey Mike,

    I use the “wple_get_product_main_image” hook inside the specific templates function.php, so that should be fine.
    It also does upoad my custom featured image to ebay ant does show it inside the the wplister ((product_gallery)). But NOT as featured image of the ebay auction. For that it it still uses the product featured image fromm woocommerce.

    Thanks for checking,

    Frank

    • This reply was modified 1 year, 8 months ago by idee.
    Plugin Support iammvc

    (@iammvc)

    Hello @idee

    The wple_get_product_main_image hook works if you don’t need to access the listing’s Template ID. If you do, as you also mentioned in your previous email, you’ll have to use wple_filter_listing_item instead.

    As for the featured image issue, WP-Lister uses the listing’s product thumbnail in the Listings Table (not the listing’s gallery image) so the filter you are hooked into will not affect that. We will discuss and see if this is something that needs to be tweaked.

    Kind regards

    Mike

    Thread Starter idee

    (@idee)

    Hi Mike,

    yeas thats the case. We do not need the template id anymore, as for each template there is a functins.php to place template specific functions.

    And our goal is for a specific template to NOT use the woocommerce product listing thumbnail, but a custom image.

    Thanks for checking,

    Frank

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘CUstom featured Image’ is closed to new replies.