Forece strict comparisons on single products template

This commit is contained in:
mitogh 2015-11-14 20:31:23 -06:00
parent 65e69e00da
commit d3804dc16c
5 changed files with 7 additions and 7 deletions

View File

@ -33,14 +33,14 @@ ob_start();
<?php if ( $product->enable_dimensions_display() ) : ?>
<?php if ( $product->has_weight() ) : $has_row = true; ?>
<tr class="<?php if ( ( $alt = $alt * -1 ) == 1 ) echo 'alt'; ?>">
<tr class="<?php if ( ( $alt = $alt * -1 ) === 1 ) echo 'alt'; ?>">
<th><?php _e( 'Weight', 'woocommerce' ) ?></th>
<td class="product_weight"><?php echo $product->get_weight() . ' ' . esc_attr( get_option( 'woocommerce_weight_unit' ) ); ?></td>
</tr>
<?php endif; ?>
<?php if ( $product->has_dimensions() ) : $has_row = true; ?>
<tr class="<?php if ( ( $alt = $alt * -1 ) == 1 ) echo 'alt'; ?>">
<tr class="<?php if ( ( $alt = $alt * -1 ) === 1 ) echo 'alt'; ?>">
<th><?php _e( 'Dimensions', 'woocommerce' ) ?></th>
<td class="product_dimensions"><?php echo $product->get_dimensions(); ?></td>
</tr>

View File

@ -33,10 +33,10 @@ if ( $attachment_ids ) {
$classes = array( 'zoom' );
if ( $loop == 0 || $loop % $columns == 0 )
if ( $loop === 0 || $loop % $columns === 0 )
$classes[] = 'first';
if ( ( $loop + 1 ) % $columns == 0 )
if ( ( $loop + 1 ) % $columns === 0 )
$classes[] = 'last';
$image_link = wp_get_attachment_url( $attachment_id );

View File

@ -27,7 +27,7 @@ if ( empty( $product ) || ! $product->exists() ) {
$related = $product->get_related( $posts_per_page );
if ( sizeof( $related ) == 0 ) return;
if ( sizeof( $related ) === 0 ) return;
$args = apply_filters( 'woocommerce_related_products_args', array(
'post_type' => 'product',

View File

@ -33,7 +33,7 @@ $verified = wc_review_is_from_verified_owner( $comment->comment_ID );
<div class="comment-text">
<?php if ( $rating && get_option( 'woocommerce_enable_review_rating' ) == 'yes' ) : ?>
<?php if ( $rating && get_option( 'woocommerce_enable_review_rating' ) === 'yes' ) : ?>
<div itemprop="reviewRating" itemscope itemtype="http://schema.org/Rating" class="star-rating" title="<?php echo sprintf( __( 'Rated %d out of 5', 'woocommerce' ), $rating ) ?>">
<span style="width:<?php echo ( $rating / 5 ) * 100; ?>%"><strong itemprop="ratingValue"><?php echo $rating; ?></strong> <?php _e( 'out of 5', 'woocommerce' ); ?></span>

View File

@ -23,7 +23,7 @@ global $product, $woocommerce_loop;
$upsells = $product->get_upsells();
if ( sizeof( $upsells ) == 0 ) {
if ( sizeof( $upsells ) === 0 ) {
return;
}