Skip to content

Commit

Permalink
New structure + started moving template code to files
Browse files Browse the repository at this point in the history
  • Loading branch information
mikejolley committed Dec 9, 2011
1 parent 6b0ef66 commit 033735b
Show file tree
Hide file tree
Showing 9 changed files with 1,327 additions and 1,452 deletions.
41 changes: 41 additions & 0 deletions templates/single-product/add-to-cart/simple.php
@@ -0,0 +1,41 @@
<?php
/**
* Simple Product Add to Cart
*/

global $woocommerce, $_product;

if( $_product->get_price() === '') return;
?>

<?php
$availability = $_product->get_availability();

if ($availability['availability']) :
echo apply_filters( 'woocommerce_stock_html', '<p class="stock '.$availability['class'].'">'.$availability['availability'].'</p>', $availability['availability'] );
endif;
?>

<?php if (!$_product->is_in_stock()) : ?>
<link itemprop="availability" href="http://schema.org/OutOfStock">
<?php else : ?>

<link itemprop="availability" href="http://schema.org/InStock">

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

<form action="<?php echo esc_url( $_product->add_to_cart_url() ); ?>" class="cart" method="post" enctype='multipart/form-data'>

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

<?php if (!$_product->is_downloadable()) woocommerce_quantity_input(); ?>

<button type="submit" class="button alt"><?php _e('Add to cart', 'woothemes'); ?></button>

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

</form>

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

<?php endif; ?>

0 comments on commit 033735b

Please sign in to comment.