Default Image for products without image not working

When we put an image to be the default product image if an image is not placed for a product in the Store Settings: Presentation it does not work. No image is visible on a product.

"Show default product placeholder thumbnail when product image is not available?
Yes
Select default placeholder image thumbnail when product image is not available (if empty, plugin's built-in image will be used)"
We put one in from Media manager

see example

http://s17661.p20.sites.pressdns.com/store/products/1test/

  • Panos

    Hi MSAMike ,

    I see this doesn't happen in your products list page, this is how this feature is designed to work. Let me explain a bit :slight_smile:

    For reasons of uniformity in the products list page, when a product doesn't have an image but some of the others have, it's better for the eye to fill the gaps. That's not required in the single page though.

    However I have attached file
    wp_content/plugins/marketpress/includes/common/template-functions.php
    which you can download, unzip and replace.

    Please let me know how this works for you :slight_smile:

    Thanks!
    Panos

  • Panos

    Sorry for not being clear :slight_smile:

    You can imagine a page with several products listed, one next to another with their images, short descriptions and the "add to cart" buttons.

    They don't look very nice if some of them is missing something, like an image for example. It doesn't make it appealing to the eye. The default placeholder image is trying to replace that gap so it looks better.

    In the single page though there is no need to make things similar, as it is only one page. Also there's no actual need for an image that's not representing the product. I attached these files just in case you disagree with my last sentence :slight_smile:

    Please let me know if you need further explanation on this and how these files work for you :slight_smile:

    Cheers!
    Panos

  • MSAMike

    The code worked but the whole marketpress as a whole is not working well as it relates to photos.

    The setting in Store Settings are terrible and almost never work.

    This code worked but it places a huge photo and we have it sized down in settings and in media files to 300x300

    So the code placed the image, but not in a usable format.

    I was really hoping that Marketpress would be a better product. OSCommerce was better out of the box 14 years ago. Not trying to be insulting, but you all should really consider this project not for commercial use.

  • Panos

    Hi MSAMike ,

    Thank you for your valuable feedback!

    In this specific case though, originally the plugin was not designed for this feature, as I tried to explain in previous replies. The issue you are having now is an error/neglect of mine in the fix I provided.

    I added some sizing to image (retrieving from settings) and also a filter hook which you can use to override this size.

    It's the same file:
    wp_content/plugins/marketpress/includes/common/template-functions.php

    If the image size is not working for you, as mentioned, you can use the filter "mp_default_product_img_size" in your functions.php to override the size as in the following example:

    add_filter( 'mp_default_product_img_size', 'wpmudev_mp_default_product_img_size', 10, 1 );
    
    function wpmudev_mp_default_product_img_size( $size ){
    	return array( 300,300 );
    }

    Would appreciate you feedback!

    Thanks again!
    Panos

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.