WordPress.org

Support

Support » Plugins and Hacks » Remove noimage.png on a product page

Remove noimage.png on a product page

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi,

    update: i have set image thumbnail size at zero value in Settings > Store.

    It’s ok but I am sure the community can come out with a better workaround as I may need thumbnails to be displayed on other product Pges.

    thanks!

    Plugin Author Edward

    @edwardinstinct

    The best and easiest way would be.

    1. Go to your WordPress admin SETTINGS > STORE > PRESENTATION tab
    2. On this page on the right hand side you will see ADVANCED THEME SETTINGS
    3. Select and of the templates or all of them this will clone some files to your theme
    4. After selecting files scroll down and click “MOVE TEMPLATE FILES”
    5. Below that click “FLUSH THEME CACHE”
    6. Open your theme folder you will see the store files have been added including a folder named “wpsc-images”
    7. inside this folder you will find “noimage.png”

    Replace noimage.png with a 100% transparent png

    This will make it appear that there is no image but allow you to continue to use images where you want to.

    If you feel more adventurous you could alter the store template but that is a bit more complex.

    Regards
    Edward

    Hi!
    I did not get wanted result with changing the noimage.png with transparent one. It still had the border around and had no special no-image class attached. This is my solution with v3.9.1:

    You can do the backup as Edward mentions. Then go to wp-content/themes/your-theme/ and edit the file ‘wpsc-single_product.php’.

    Change

    <div class="imagecol">
    	<?php if ( wpsc_the_product_thumbnail() ) : ?>
    			<a rel="<?php echo wpsc_the_product_title(); ?>" class="<?php echo wpsc_the_product_image_link_classes(); ?>" href="<?php echo esc_url( wpsc_the_product_image() ); ?>">
    				<img class="product_image" id="product_image_<?php echo wpsc_the_product_id(); ?>" alt="<?php echo wpsc_the_product_title(); ?>" title="<?php echo wpsc_the_product_title(); ?>" src="<?php echo wpsc_the_product_thumbnail(); ?>"/>
    			</a>
    			<?php
    			if ( function_exists( 'gold_shpcrt_display_gallery' ) )
    				echo gold_shpcrt_display_gallery( wpsc_the_product_id() );
    			?>
    			<?php else: ?>
    						<a href="<?php echo esc_url( wpsc_the_product_permalink() ); ?>">
    						<img class="no-image" id="product_image_<?php echo wpsc_the_product_id(); ?>" alt="No Image" title="<?php echo wpsc_the_product_title(); ?>" src="<?php echo WPSC_CORE_THEME_URL; ?>wpsc-images/noimage.png" width="<?php echo get_option('product_image_width'); ?>" height="<?php echo get_option('product_image_height'); ?>" />
    						</a>
    			<?php endif; ?>
    </div><!--close imagecol-->

    to

    <?php if (strpos(wpsc_the_product_thumbnail(),'noimage.png') == false) : ?>
    	<div class="imagecol">
    		<?php if ( wpsc_the_product_thumbnail() ) : ?>
    				<a rel="<?php echo wpsc_the_product_title(); ?>" class="<?php echo wpsc_the_product_image_link_classes(); ?>" href="<?php echo esc_url( wpsc_the_product_image() ); ?>">
    					<img class="product_image" id="product_image_<?php echo wpsc_the_product_id(); ?>" alt="<?php echo wpsc_the_product_title(); ?>" title="<?php echo wpsc_the_product_title(); ?>" src="<?php echo wpsc_the_product_thumbnail(); ?>"/>
    				</a>
    				<?php
    				if ( function_exists( 'gold_shpcrt_display_gallery' ) )
    					echo gold_shpcrt_display_gallery( wpsc_the_product_id() );
    				?>
    				<?php else: ?>
    							<a href="<?php echo esc_url( wpsc_the_product_permalink() ); ?>">
    							<img class="no-image" id="product_image_<?php echo wpsc_the_product_id(); ?>" alt="No Image" title="<?php echo wpsc_the_product_title(); ?>" src="<?php echo WPSC_CORE_THEME_URL; ?>wpsc-images/noimage.png" width="<?php echo get_option('product_image_width'); ?>" height="<?php echo get_option('product_image_height'); ?>" />
    							</a>
    				<?php endif; ?>
    	</div>
    <?php endif; ?><!--close imagecol-->

    This way the whole div “imagecol” gets removed and no image is shown.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Remove noimage.png on a product page’ is closed to new replies.