Hallo,
wie kann ich bei dem Widget Neuste Produkte das Produktbild anzeigen lassen?
Im PHP Code ist das Image drin aber es wird nicht ausgeben:
PHP
if ( count( $latest_products ) > 0 ) {
$output .= '<ul class="wpsc-latest-products">';
foreach ( $latest_products as $latest_product ) {
$output .= '<li class="wpsc-latest-product">';
// Thumbnails, if required
if ($image) {
$output .= '<div class="item_image">';
$output .= '<a href="' . wpsc_product_url( $latest_product->ID, null ) . '">';
$attached_images = (array)get_posts( array(
'post_type' => 'attachment',
'numberposts' => 1,
'post_status' => null,
'post_parent' => $latest_product->ID,
'orderby' => 'menu_order',
'order' => 'ASC'
) );
$attached_image = $attached_images[0];
if ( $attached_image->ID > 0 )
$output .= '<img src="' . wpsc_product_image( $attached_image->ID, $width, $height ) . '" title="' . $latest_product->post_title . '" alt="' . $latest_product->post_title . '" />';
else
$output .='<img class="no-image" id="product_image_'.wpsc_the_product_id().'" alt="No Image" title="'.wpsc_the_product_title().'" src="'.WPSC_URL.'/wpsc-theme/wpsc-images/noimage.png" width="' . $width . '" height="' . $height . '" />';
$output .= '</a>';
$output .= '</div>';
}
// Link
$output .= '<h4 class="title">' .stripslashes( $latest_product->post_title ) . '</h4>' . '<a href="' . wpsc_product_url( $latest_product->ID, null ) . '" class="wpsc-product-title">Produkt ansehen</a>';
$output .= '</li>';
}
$output .= "</ul>";
}
echo $output;
}
Alles anzeigen
Es wird nur den Titel des Produkts und Produkt ansehen ausgeben aber das Produktbild nicht obwohl eines vorhande ist?
Hoffe es kann mir jemand weiterhelfen.