Hide thumbnails when empty. Closes #2409.
This commit is contained in:
parent
76ebd4e3c3
commit
b67492fe68
|
@ -106,7 +106,7 @@ abstract class WC_Product {
|
|||
$this->product_image_gallery = implode( ',', $attachment_ids );
|
||||
}
|
||||
|
||||
return (array) explode( ',', $this->product_image_gallery );
|
||||
return array_filter( (array) explode( ',', $this->product_image_gallery ) );
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -200,6 +200,7 @@ Yes you can! Join in on our [GitHub repository](http://github.com/woothemes/wooc
|
|||
* Feature - Linking to mydomain.com/product#review_form will now open the review form on load (if WooCommerce lightbox is turned on)
|
||||
* Feature - Customers can sort by popularity + rating.
|
||||
* Feature - Option to exclude coupons from sale items (thanks aj-adl)
|
||||
* Feature - Logout "page" which can be added to menus.
|
||||
|
||||
* Templating - Revised pagination, sorting areas (sorting is now above products, numbered pagination below) and added a result count.
|
||||
* Templating - email-order-items.php change get_downloadable_file_url() to get_downloadable_file_urls() to support multiple files.
|
||||
|
|
|
@ -10,12 +10,12 @@
|
|||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
global $post, $product, $woocommerce;
|
||||
?>
|
||||
<div class="thumbnails"><?php
|
||||
|
||||
$attachment_ids = $product->get_gallery_attachment_ids();
|
||||
$attachment_ids = $product->get_gallery_attachment_ids();
|
||||
|
||||
if ( $attachment_ids ) {
|
||||
if ( $attachment_ids ) {
|
||||
?>
|
||||
<div class="thumbnails"><?php
|
||||
|
||||
$loop = 0;
|
||||
$columns = apply_filters( 'woocommerce_product_thumbnails_columns', 3 );
|
||||
|
@ -40,5 +40,6 @@ global $post, $product, $woocommerce;
|
|||
$loop++;
|
||||
}
|
||||
|
||||
}
|
||||
?></div>
|
||||
?></div>
|
||||
<?php
|
||||
}
|
|
@ -454,7 +454,7 @@ if ( ! function_exists( 'woocommerce_output_product_data_tabs' ) ) {
|
|||
* @return void
|
||||
*/
|
||||
function woocommerce_output_product_data_tabs() {
|
||||
woocommerce_get_template( 'single-product/tabs.php' );
|
||||
woocommerce_get_template( 'single-product/tabs/tabs.php' );
|
||||
}
|
||||
}
|
||||
if ( ! function_exists( 'woocommerce_template_single_title' ) ) {
|
||||
|
|
Loading…
Reference in New Issue