Skip to content

Commit

Permalink
Absolute path should have curly braces - part 2
Browse files Browse the repository at this point in the history
  • Loading branch information
shivapoudel committed Sep 22, 2014
1 parent fbf0314 commit 61430e1
Show file tree
Hide file tree
Showing 20 changed files with 91 additions and 40 deletions.
7 changes: 5 additions & 2 deletions templates/single-product/add-to-cart/external.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
* @version 2.1.0
*/

if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}

?>

<?php do_action( 'woocommerce_before_add_to_cart_button' ); ?>
Expand All @@ -16,4 +19,4 @@
<a href="<?php echo esc_url( $product_url ); ?>" rel="nofollow" class="single_add_to_cart_button button alt"><?php echo $button_text; ?></a>
</p>

<?php do_action( 'woocommerce_after_add_to_cart_button' ); ?>
<?php do_action( 'woocommerce_after_add_to_cart_button' ); ?>
6 changes: 4 additions & 2 deletions templates/single-product/add-to-cart/grouped.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
* @version 2.1.7
*/

if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}

global $product, $post;

Expand Down Expand Up @@ -79,4 +81,4 @@
<?php endif; ?>
</form>

<?php do_action( 'woocommerce_after_add_to_cart_form' ); ?>
<?php do_action( 'woocommerce_after_add_to_cart_form' ); ?>
13 changes: 9 additions & 4 deletions templates/single-product/add-to-cart/simple.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,23 @@
* @version 2.1.0
*/

if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}

global $product;

if ( ! $product->is_purchasable() ) return;
if ( ! $product->is_purchasable() ) {
return;
}

?>

<?php
// Availability
$availability = $product->get_availability();
$availability_html = empty( $availability['availability'] ) ? '' : '<p class="stock ' . esc_attr( $availability['class'] ) . '">' . esc_html( $availability['availability'] ) . '</p>';

echo apply_filters( 'woocommerce_stock_html', $availability_html, $availability['availability'], $product );
?>

Expand Down Expand Up @@ -46,4 +51,4 @@

<?php do_action( 'woocommerce_after_add_to_cart_form' ); ?>

<?php endif; ?>
<?php endif; ?>
5 changes: 4 additions & 1 deletion templates/single-product/add-to-cart/variable.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@
* @version 2.1.0
*/

if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}

global $product, $post;

?>

<?php do_action( 'woocommerce_before_add_to_cart_form' ); ?>
Expand Down
7 changes: 5 additions & 2 deletions templates/single-product/meta.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,15 @@
* @version 1.6.4
*/

if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}

global $post, $product;

$cat_count = sizeof( get_the_terms( $post->ID, 'product_cat' ) );
$tag_count = sizeof( get_the_terms( $post->ID, 'product_tag' ) );

?>
<div class="product_meta">

Expand All @@ -30,4 +33,4 @@

<?php do_action( 'woocommerce_product_meta_end' ); ?>

</div>
</div>
3 changes: 2 additions & 1 deletion templates/single-product/price.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
}

global $product;

?>
<div itemprop="offers" itemscope itemtype="http://schema.org/Offer">

Expand All @@ -21,4 +22,4 @@
<meta itemprop="priceCurrency" content="<?php echo get_woocommerce_currency(); ?>" />
<link itemprop="availability" href="http://schema.org/<?php echo $product->is_in_stock() ? 'InStock' : 'OutOfStock'; ?>" />

</div>
</div>
5 changes: 3 additions & 2 deletions templates/single-product/product-attributes.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
$attributes = $product->get_attributes();

ob_start();

?>
<table class="shop_attributes">

Expand Down Expand Up @@ -64,11 +65,11 @@
?></td>
</tr>
<?php endforeach; ?>

</table>
<?php
if ( $has_row ) {
echo ob_get_clean();
} else {
ob_end_clean();
}
}
4 changes: 3 additions & 1 deletion templates/single-product/product-image.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
* @version 2.0.14
*/

if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}

global $post, $woocommerce, $product;

Expand Down
6 changes: 4 additions & 2 deletions templates/single-product/product-thumbnails.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
* @version 2.0.3
*/

if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}

global $post, $product, $woocommerce;

Expand Down Expand Up @@ -46,4 +48,4 @@

?></div>
<?php
}
}
9 changes: 6 additions & 3 deletions templates/single-product/rating.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,15 @@
* @version 2.1.0
*/

if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}

global $product;

if ( get_option( 'woocommerce_enable_review_rating' ) === 'no' )
if ( get_option( 'woocommerce_enable_review_rating' ) === 'no' ) {
return;
}

$count = $product->get_rating_count();
$average = $product->get_average_rating();
Expand All @@ -28,4 +31,4 @@
<a href="#reviews" class="woocommerce-review-link" rel="nofollow">(<?php printf( _n( '%s customer review', '%s customer reviews', $count, 'woocommerce' ), '<span itemprop="ratingCount" class="count">' . $count . '</span>' ); ?>)</a>
</div>

<?php endif; ?>
<?php endif; ?>
4 changes: 3 additions & 1 deletion templates/single-product/related.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
* @version 1.6.4
*/

if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}

global $product, $woocommerce_loop;

Expand Down
5 changes: 4 additions & 1 deletion templates/single-product/review.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,12 @@
* @version 2.1.0
*/

if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}

$rating = intval( get_comment_meta( $comment->comment_ID, 'rating', true ) );

?>
<li itemprop="reviews" itemscope itemtype="http://schema.org/Review" <?php comment_class(); ?> id="li-comment-<?php comment_ID() ?>">

Expand Down
7 changes: 5 additions & 2 deletions templates/single-product/sale-flash.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,15 @@
* @version 1.6.4
*/

if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}

global $post, $product;

?>
<?php if ( $product->is_on_sale() ) : ?>

<?php echo apply_filters( 'woocommerce_sale_flash', '<span class="onsale">' . __( 'Sale!', 'woocommerce' ) . '</span>', $post, $product ); ?>

<?php endif; ?>
<?php endif; ?>
6 changes: 4 additions & 2 deletions templates/single-product/share.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@
* @version 1.6.4
*/

if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}

?>

<?php do_action( 'woocommerce_share' ); // Sharing plugins can hook into here ?>
<?php do_action( 'woocommerce_share' ); // Sharing plugins can hook into here ?>
11 changes: 8 additions & 3 deletions templates/single-product/short-description.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,17 @@
* @version 1.6.4
*/

if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}

global $post;

if ( ! $post->post_excerpt ) return;
if ( ! $post->post_excerpt ) {
return;
}

?>
<div itemprop="description">
<?php echo apply_filters( 'woocommerce_short_description', $post->post_excerpt ) ?>
</div>
</div>
8 changes: 4 additions & 4 deletions templates/single-product/tabs/additional-information.php
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
<?php
/**
* Additional Information tab
*
*
* @author WooThemes
* @package WooCommerce/Templates
* @version 2.0.0
*/

if ( ! defined( 'ABSPATH' ) ) {
// Exit if accessed directly
exit;
exit; // Exit if accessed directly
}

global $product;

$heading = apply_filters( 'woocommerce_product_additional_information_heading', __( 'Additional Information', 'woocommerce' ) );

?>

<?php if ( $heading ): ?>
<h2><?php echo $heading; ?></h2>
<?php endif; ?>

<?php $product->list_attributes(); ?>
<?php $product->list_attributes(); ?>
5 changes: 4 additions & 1 deletion templates/single-product/tabs/description.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,14 @@
* @version 2.0.0
*/

if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}

global $post;

$heading = esc_html( apply_filters( 'woocommerce_product_description_heading', __( 'Product Description', 'woocommerce' ) ) );

?>

<?php if ( $heading ): ?>
Expand Down
6 changes: 4 additions & 2 deletions templates/single-product/tabs/tabs.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
* @version 2.0.0
*/

if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}

/**
* Filter tabs and allow third parties to add their own
Expand Down Expand Up @@ -38,4 +40,4 @@
<?php endforeach; ?>
</div>

<?php endif; ?>
<?php endif; ?>
6 changes: 4 additions & 2 deletions templates/single-product/title.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
* @version 1.6.4
*/

if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}

?>
<h1 itemprop="name" class="product_title entry-title"><?php the_title(); ?></h1>
<h1 itemprop="name" class="product_title entry-title"><?php the_title(); ?></h1>
8 changes: 6 additions & 2 deletions templates/single-product/up-sells.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,17 @@
* @version 1.6.4
*/

if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}

global $product, $woocommerce_loop;

$upsells = $product->get_upsells();

if ( sizeof( $upsells ) == 0 ) return;
if ( sizeof( $upsells ) == 0 ) {
return;
}

$meta_query = WC()->query->get_meta_query();

Expand Down

0 comments on commit 61430e1

Please sign in to comment.