WordPress.org

Ready to get started?Download WordPress

Forums

WP e-Commerce Featured Product
Widget does not always show images (6 posts)

  1. bircha
    Member
    Posted 2 years ago #

    Hi,

    I am using the WP e-Commerce Featured Product widget on my site's homepage (to show random product pictures) and it does not always load the product picture correctly as the IMG SRC points to a wrong address. E.g. if this is the right address:

    http://www.domain.com/wp-content/uploads/tunnelmavalo-koristeetsisustus-sileavati-featured.jpg

    ... the widget renders something like this instead when the image does not show:

    http://www.domain.com/index.php?wpsc_action=scale_image&attachment_id=492&width=300&height=300"

    Any ideas what might be causing this?

    http://wordpress.org/extend/plugins/wp-e-commerce-featured-product/

  2. zorgbargle
    Member
    Plugin Author

    Posted 2 years ago #

    Hi,

    The WP e-Commerce Featured Product widget uses one of 2 methods to determine the img src:
    1) if full-size is selected, the WordPress function wp_get_attachment_url is used.
    2) if thumbnail size or custom size is selected, the WP e-Commerce function wpsc_product_image is used.
    From the URL you included, it looks like method 2 is being used, but I'm not sure why the image is not working. I would not expect the URL to point directly to the image in the uploads folder however, because this would be the full-size version.
    Could you try selected different sizes and see if you can narrow down the situations where the error occurs?
    Also, does the error occur if you choose a specific product rather than using the random feature?
    Lastly, are you using the current version of WP e-Commerce?

    Thanks,
    Z

  3. bircha
    Member
    Posted 2 years ago #

    Hi,

    I have the latest version of WP, WP e-Commerce and the Featured Product plugin that are available through WP. I am also using the "Allow PHP in Content" plugin as I have registered the widget area within the content area of the page.

    The error does not occur when the widget shows specific products.

    I've specified that the widget shows the images in 300x300px size which is also the native size of the featured product images.

  4. zorgbargle
    Member
    Plugin Author

    Posted 1 year ago #

    Hi,

    Thanks for the extra information. I suspect the issue may be related to using the widget within the content area (with the "Allow PHP in Content" plugin). Could you confirm if the issue occurs when you use the widget in a standard widget area without the use of the PHP Content plugin?

    Also, could you provide the php code that you add to your content area to allow the widget to be included? I will need this in order to try and reproduce the problem on my dev machine.

    Thanks,
    Z

  5. bircha
    Member
    Posted 1 year ago #

    Hi,

    The issue occurs also when the widget is used in the normal footer areas.

    This is how I use the widget:

    In functions.php I'll register the sidebar e.g.

    <?php
    	register_sidebar( array(
    		'name' => __( 'Frontpage Content Area', 'twentyeleven' ),
    		'id' => 'sidebar-7',
    		'description' => __( 'An optional widget area for your site content', 'twentyeleven' ),
    		'before_widget' => '<div id="%1$s" class="widget %2$s">',
    		'after_widget' => '</div>',
    		'before_title' => '<h2 class="widget-title">',
    		'after_title' => '</h2>',
    	) );
    ?>

    An then in the content area I'll insert the sidebar like this

    <!-- Sidebar 7 -->
    			<?php if ( is_active_sidebar( 'sidebar-7' ) ) : ?>
    			<div class="content-widget-area">
    				<?php dynamic_sidebar( 'sidebar-7' ); ?>
    			</div>
    			<?php endif; ?>
  6. zorgbargle
    Member
    Plugin Author

    Posted 1 year ago #

    Hi,

    Unfortunately I have still not been able to reproduce this issue. Another thing to try is:
    1) Using the random feature, when an image is not displayed, copy the img src attribute (as you described in your first message), and take note of which product should be displayed.
    2) Change the widget to display the product from step 1 - as you indicated previously, this should display the product image correctly. Ensure that the same sizing options are used.
    3) Compare the img src attribute with step 1 - these should normally be the same, but in your case I assume they're not.

    Hopefully this will give me a bit of a clue as to what's going wrong.

    Thanks,
    Z

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic