saving my branch
authorSteve Sutton <steve@gaslightmedia.com>
Mon, 11 Jan 2016 13:30:01 +0000 (08:30 -0500)
committerSteve Sutton <steve@gaslightmedia.com>
Mon, 11 Jan 2016 13:30:01 +0000 (08:30 -0500)
17 files changed:
woocommerce/checkout/add-to-cart/availability.php [new file with mode: 0644]
woocommerce/checkout/add-to-cart/button.php [new file with mode: 0644]
woocommerce/checkout/add-to-cart/deposit.php [new file with mode: 0644]
woocommerce/checkout/add-to-cart/grouped.php [new file with mode: 0644]
woocommerce/checkout/add-to-cart/opc.php [new file with mode: 0644]
woocommerce/checkout/add-to-cart/quantity-input.php [new file with mode: 0644]
woocommerce/checkout/add-to-cart/radio.php [new file with mode: 0644]
woocommerce/checkout/add-to-cart/simple.php [new file with mode: 0644]
woocommerce/checkout/add-to-cart/variable.php [new file with mode: 0644]
woocommerce/checkout/deprecated/review-order.php [new file with mode: 0644]
woocommerce/checkout/pricing-table.php [new file with mode: 0644]
woocommerce/checkout/product-list.php [new file with mode: 0644]
woocommerce/checkout/product-single.php [new file with mode: 0644]
woocommerce/checkout/product-table.php [new file with mode: 0644]
woocommerce/checkout/review-order-opc.php [new file with mode: 0644]
woocommerce/content-product_cat.php
woocommerce/content-single-product.php [new file with mode: 0644]

diff --git a/woocommerce/checkout/add-to-cart/availability.php b/woocommerce/checkout/add-to-cart/availability.php
new file mode 100644 (file)
index 0000000..926b12b
--- /dev/null
@@ -0,0 +1,18 @@
+<?php
+/**
+ * Display availability.
+ * 
+ * Primarily used for "Out of stock" text
+ *
+ * @package WooCommerce-One-Page-Checkout/Templates
+ * @version 1.0
+ */
+
+if ( ! defined( 'ABSPATH' ) ) {
+       exit; // Exit if accessed directly
+}
+// Availability
+$availability      = $product->get_availability();
+$availability_html = empty( $availability['availability'] ) ? '' : '<span class="stock ' . esc_attr( $availability['class'] ) . '">' . esc_html( $availability['availability'] ) . '</span>';
+
+echo apply_filters( 'woocommerce_stock_html', $availability_html, $availability['availability'], $product );
\ No newline at end of file
diff --git a/woocommerce/checkout/add-to-cart/button.php b/woocommerce/checkout/add-to-cart/button.php
new file mode 100644 (file)
index 0000000..e48204b
--- /dev/null
@@ -0,0 +1,18 @@
+<?php
+/**
+ * Product quantity input
+ *
+ * Extends the WooCommerce quantity input template to include the add_to_cart data attribute.
+ *
+ * @package WooCommerce-One-Page-Checkout/Templates
+ * @version 1.0
+ */
+
+if ( ! defined( 'ABSPATH' ) ) {
+       exit; // Exit if accessed directly
+}
+?>
+<button class="button add_to_cart_button checkout-quantity" id="product_<?php echo $product->add_to_cart_id; ?>" name="product_id" value="<?php echo $product->add_to_cart_id; ?>" data-add_to_cart="<?php echo $product->add_to_cart_id; ?>" data-opc_remove_text="<?php _e( 'Remove', 'wcopc' ); ?>">
+       <span><?php _e( 'Add Amount', 'wcopc' ); ?></span>
+</button>
+<a class="wc-south opc-complete-order" href="#customer_details"><?php _e( 'Modify &amp; complete order below', 'wcopc' ); ?></a>
diff --git a/woocommerce/checkout/add-to-cart/deposit.php b/woocommerce/checkout/add-to-cart/deposit.php
new file mode 100644 (file)
index 0000000..e640114
--- /dev/null
@@ -0,0 +1,18 @@
+<?php
+/**
+ * Add to Cart Input Template - Account Fund Products
+ *
+ * @package WooCommerce-One-Page-Checkout/Templates
+ * @version 1.0
+ */
+
+// Exit if accessed directly
+if ( ! defined( 'ABSPATH' ) ) {
+       exit;
+}
+
+ob_start();
+
+woocommerce_simple_add_to_cart();
+
+echo str_replace( array( '<form','</form>', 'method="post"', "enctype='multipart/form-data'" ), array( '<div', '</div>', '', '' ), ob_get_clean() );
diff --git a/woocommerce/checkout/add-to-cart/grouped.php b/woocommerce/checkout/add-to-cart/grouped.php
new file mode 100644 (file)
index 0000000..8e24acd
--- /dev/null
@@ -0,0 +1,17 @@
+<?php
+/**
+ * Add to Cart Input Template - Grouped Products
+ *
+ * @package WooCommerce-One-Page-Checkout/Templates
+ * @version 1.0
+ */
+
+if ( ! defined( 'ABSPATH' ) ) {
+       exit; // Exit if accessed directly
+}
+
+ob_start();
+
+woocommerce_grouped_add_to_cart();
+
+echo str_replace( array( '<form','</form>', 'method="post"', "enctype='multipart/form-data'" ), array( '<div', '</div>', '', '' ), ob_get_clean() );
diff --git a/woocommerce/checkout/add-to-cart/opc.php b/woocommerce/checkout/add-to-cart/opc.php
new file mode 100644 (file)
index 0000000..c751c91
--- /dev/null
@@ -0,0 +1,26 @@
+<?php
+/**
+ * Add to Cart Input Template - Displays the appropriate cart input or stock/availability notice for the OPC templates
+ *
+ * @package WooCommerce-One-Page-Checkout/Templates
+ * @version 1.0
+ */
+
+if ( ! defined( 'ABSPATH' ) ) {
+       exit; // Exit if accessed directly
+}
+
+if ( $product->is_in_stock() ) {
+
+       if ( $product->is_sold_individually() ) {
+               wc_get_template( 'checkout/add-to-cart/button.php', array( 'product' => $product ), '', PP_One_Page_Checkout::$template_path );
+       } else {
+               wc_get_template( 'checkout/add-to-cart/quantity-input.php', array( 'product' => $product ), '', PP_One_Page_Checkout::$template_path );
+       }
+
+} else {
+       
+       wc_get_template( 'checkout/add-to-cart/availability.php', array( 'product' => $product ), '', PP_One_Page_Checkout::$template_path );
+
+} ?>
+
diff --git a/woocommerce/checkout/add-to-cart/quantity-input.php b/woocommerce/checkout/add-to-cart/quantity-input.php
new file mode 100644 (file)
index 0000000..c2621c1
--- /dev/null
@@ -0,0 +1,21 @@
+<?php
+/**
+ * Product quantity input
+ *
+ * Extends the WooCommerce quantity input template to include the add_to_cart data attribute.
+ *
+ * @package WooCommerce-One-Page-Checkout/Templates
+ * @version 1.0
+ */
+
+if ( ! defined( 'ABSPATH' ) ) {
+       exit; // Exit if accessed directly
+}
+
+$input_button = woocommerce_quantity_input( array(
+       'input_name'  => 'product_id',
+       'input_value' => ! empty( $product->cart_item['quantity'] ) ? $product->cart_item['quantity'] : 0,
+       'max_value'   => $product->backorders_allowed() ? '' : $product->get_stock_quantity(),
+       'min_value'   => 0,
+), $product, false );
+echo str_replace( 'type="number"', 'type="number" data-add_to_cart="' . $product->add_to_cart_id . '"', $input_button ); ?>
diff --git a/woocommerce/checkout/add-to-cart/radio.php b/woocommerce/checkout/add-to-cart/radio.php
new file mode 100644 (file)
index 0000000..0cd6e42
--- /dev/null
@@ -0,0 +1,15 @@
+<?php
+/**
+ * Template to display product selection fields in a list
+ *
+ * @package WooCommerce-One-Page-Checkout/Templates
+ * @version 1.0
+ */
+
+if ( ! defined( 'ABSPATH' ) ) {
+       exit; // Exit if accessed directly
+}
+?>
+<label>
+       <input type="radio" id="product_<?php echo $product->add_to_cart_id; ?>" name="add_to_cart" value="<?php echo $product->add_to_cart_id; ?>" data-add_to_cart="<?php echo $product->add_to_cart_id; ?>" <?php checked( $product->in_cart ); ?>/>
+</label>
diff --git a/woocommerce/checkout/add-to-cart/simple.php b/woocommerce/checkout/add-to-cart/simple.php
new file mode 100644 (file)
index 0000000..1668fe0
--- /dev/null
@@ -0,0 +1,18 @@
+<?php
+/**
+ * Add to Cart Input Template - Simple Products
+ *
+ * @package WooCommerce-One-Page-Checkout/Templates
+ * @version 1.0
+ */
+
+// Exit if accessed directly
+if ( ! defined( 'ABSPATH' ) ) {
+       exit;
+}
+
+ob_start();
+
+woocommerce_simple_add_to_cart();
+
+echo str_replace( array( '<form','</form>', 'method="post"', "enctype='multipart/form-data'" ), array( '<div', '</div>', '', '' ), ob_get_clean() );
diff --git a/woocommerce/checkout/add-to-cart/variable.php b/woocommerce/checkout/add-to-cart/variable.php
new file mode 100644 (file)
index 0000000..644a8ad
--- /dev/null
@@ -0,0 +1,18 @@
+<?php
+/**
+ * Add to Cart Input Template - Variable Product
+ *
+ * @package WooCommerce-One-Page-Checkout/Templates
+ * @version 1.0
+ */
+
+// Exit if accessed directly
+if ( ! defined( 'ABSPATH' ) ) {
+       exit;
+}
+
+ob_start();
+
+woocommerce_variable_add_to_cart();
+
+echo str_replace( array( '<form','</form>', 'method="post"', "enctype='multipart/form-data'" ), array( '<div', '</div>', '', '' ), ob_get_clean() );
diff --git a/woocommerce/checkout/deprecated/review-order.php b/woocommerce/checkout/deprecated/review-order.php
new file mode 100644 (file)
index 0000000..7666dca
--- /dev/null
@@ -0,0 +1,218 @@
+<?php
+/**
+ * OPC review order form template with Remove/Quantity columns
+ *
+ * @version     2.1.8
+ */
+
+if ( ! defined( 'ABSPATH' ) ) {
+       exit; // Exit if accessed directly
+}
+
+?>
+
+<?php if ( ! $is_ajax ) : ?><div id="order_review" class="opc_order_review"><?php endif; ?>
+       <input type="hidden" name="is_opc" value="1" />
+       <table class="shop_table">
+               <thead>
+                       <tr>
+                               <th class="product-name">
+                                       <?php _e( 'Product', 'wcopc' ); ?>
+                                       <div class="product-quantity"><?php _e( 'Quantity', 'wcopc' ); ?></div>
+                               </th>
+                               <th class="product-total"><?php _e( 'Total', 'wcopc' ); ?></th>
+                       </tr>
+               </thead>
+               <tbody>
+                       <?php
+                               do_action( 'woocommerce_review_order_before_cart_contents' );
+
+                               foreach ( WC()->cart->get_cart() as $cart_item_key => $cart_item ) {
+                                       $_product = apply_filters( 'woocommerce_cart_item_product', $cart_item['data'], $cart_item, $cart_item_key );
+
+                                       if ( $_product && $_product->exists() && $cart_item['quantity'] > 0 && apply_filters( 'woocommerce_checkout_cart_item_visible', true, $cart_item, $cart_item_key ) ) {
+                                               ?>
+                                               <tr class="<?php echo esc_attr( apply_filters( 'woocommerce_cart_item_class', 'cart_item opc_cart_item', $cart_item, $cart_item_key ) ); ?>" data-add_to_cart="<?php echo $_product->variation_id ? $_product->variation_id : $_product->id; ?>" data-update_key="<?php echo $cart_item_key; ?>">
+                                                       <td class="product-name">
+                                                               <div class="product-remove" >
+                                                                       <?php echo apply_filters( 'woocommerce_cart_item_remove_link', sprintf( '<a href="%s" class="remove" title="%s">&times;</a>', esc_url( WC()->cart->get_remove_url( $cart_item_key ) ), __( 'Remove this item', 'wcopc' ) ), $cart_item_key ); ?>
+                                                               </div>
+                                                               <div class="product-details" >
+                                                                       <?php echo apply_filters( 'woocommerce_cart_item_name', $_product->get_title(), $cart_item, $cart_item_key ); ?>
+                                                                       <?php echo WC()->cart->get_item_data( $cart_item ); ?>
+                                                               </div>
+                                                               <div class="product-quantity">
+                                                               <?php
+                                                                       if ( $_product->is_sold_individually() ) {
+                                                                               $product_quantity = sprintf( '1 <input type="hidden" name="cart[%s][qty]" value="1" />', $cart_item_key );
+                                                                       } else {
+                                                                               $product_quantity = woocommerce_quantity_input( array(
+                                                                                       'input_name'  => "cart[{$cart_item_key}][qty]",
+                                                                                       'input_value' => $cart_item['quantity'],
+                                                                                       'max_value'   => $_product->backorders_allowed() ? '' : $_product->get_stock_quantity(),
+                                                                                       'min_value'   => '0'
+                                                                               ), $_product, false );
+                                                                       }
+
+                                                                       echo apply_filters( 'woocommerce_cart_item_quantity', $product_quantity, $cart_item_key );
+                                                               ?>
+                                                               </div>
+                                                       </td>
+                                                       <td class="product-total">
+                                                               <?php echo apply_filters( 'woocommerce_cart_item_subtotal', WC()->cart->get_product_subtotal( $_product, $cart_item['quantity'] ), $cart_item, $cart_item_key ); ?>
+                                                       </td>
+                                               </tr>
+                                               <?php
+                                       }
+                               }
+
+                               do_action( 'woocommerce_review_order_after_cart_contents' );
+                       ?>
+               </tbody>
+               <tfoot>
+
+                       <tr class="cart-subtotal">
+                               <th><?php _e( 'Cart Subtotal', 'wcopc' ); ?></th>
+                               <td><?php wc_cart_totals_subtotal_html(); ?></td>
+                       </tr>
+
+                       <?php foreach ( WC()->cart->get_coupons( 'cart' ) as $code => $coupon ) : ?>
+                               <tr class="cart-discount coupon-<?php echo esc_attr( $code ); ?>">
+                                       <th><?php wc_cart_totals_coupon_label( $coupon ); ?></th>
+                                       <td><?php wc_cart_totals_coupon_html( $coupon ); ?></td>
+                               </tr>
+                       <?php endforeach; ?>
+
+                       <?php if ( WC()->cart->needs_shipping() && WC()->cart->show_shipping() ) : ?>
+
+                               <?php do_action( 'woocommerce_review_order_before_shipping' ); ?>
+
+                               <?php wc_cart_totals_shipping_html(); ?>
+
+                               <?php do_action( 'woocommerce_review_order_after_shipping' ); ?>
+
+                       <?php endif; ?>
+
+                       <?php foreach ( WC()->cart->get_fees() as $fee ) : ?>
+                               <tr class="fee">
+                                       <th><?php echo esc_html( $fee->name ); ?></th>
+                                       <td><?php wc_cart_totals_fee_html( $fee ); ?></td>
+                               </tr>
+                       <?php endforeach; ?>
+
+                       <?php if ( WC()->cart->tax_display_cart === 'excl' ) : ?>
+                               <?php if ( get_option( 'woocommerce_tax_total_display' ) === 'itemized' ) : ?>
+                                       <?php foreach ( WC()->cart->get_tax_totals() as $code => $tax ) : ?>
+                                               <tr class="tax-rate tax-rate-<?php echo sanitize_title( $code ); ?>">
+                                                       <th><?php echo esc_html( $tax->label ); ?></th>
+                                                       <td><?php echo wp_kses_post( $tax->formatted_amount ); ?></td>
+                                               </tr>
+                                       <?php endforeach; ?>
+                               <?php else : ?>
+                                       <tr class="tax-total">
+                                               <th><?php echo esc_html( WC()->countries->tax_or_vat() ); ?></th>
+                                               <td><?php echo wc_price( WC()->cart->get_taxes_total() ); ?></td>
+                                       </tr>
+                               <?php endif; ?>
+                       <?php endif; ?>
+
+                       <?php foreach ( WC()->cart->get_coupons( 'order' ) as $code => $coupon ) : ?>
+                               <tr class="order-discount coupon-<?php echo esc_attr( $code ); ?>">
+                                       <th><?php wc_cart_totals_coupon_label( $coupon ); ?></th>
+                                       <td><?php wc_cart_totals_coupon_html( $coupon ); ?></td>
+                               </tr>
+                       <?php endforeach; ?>
+
+                       <?php do_action( 'woocommerce_review_order_before_order_total' ); ?>
+
+                       <tr class="order-total">
+                               <th><?php _e( 'Order Total', 'wcopc' ); ?></th>
+                               <td><?php wc_cart_totals_order_total_html(); ?></td>
+                       </tr>
+
+                       <?php do_action( 'woocommerce_review_order_after_order_total' ); ?>
+
+               </tfoot>
+       </table>
+
+       <?php do_action( 'woocommerce_review_order_before_payment' ); ?>
+
+       <div id="payment">
+               <?php if ( WC()->cart->needs_payment() ) : ?>
+               <ul class="payment_methods methods">
+                       <?php
+                               $available_gateways = WC()->payment_gateways->get_available_payment_gateways();
+                               if ( ! empty( $available_gateways ) ) {
+
+                                       // Chosen Method
+                                       if ( isset( WC()->session->chosen_payment_method ) && isset( $available_gateways[ WC()->session->chosen_payment_method ] ) ) {
+                                               $available_gateways[ WC()->session->chosen_payment_method ]->set_current();
+                                       } elseif ( isset( $available_gateways[ get_option( 'woocommerce_default_gateway' ) ] ) ) {
+                                               $available_gateways[ get_option( 'woocommerce_default_gateway' ) ]->set_current();
+                                       } else {
+                                               current( $available_gateways )->set_current();
+                                       }
+
+                                       foreach ( $available_gateways as $gateway ) {
+                                               ?>
+                                               <li class="payment_method_<?php echo $gateway->id; ?>">
+                                                       <input id="payment_method_<?php echo $gateway->id; ?>" type="radio" class="input-radio" name="payment_method" value="<?php echo esc_attr( $gateway->id ); ?>" <?php checked( $gateway->chosen, true ); ?> data-order_button_text="<?php echo esc_attr( $gateway->order_button_text ); ?>" />
+                                                       <label for="payment_method_<?php echo $gateway->id; ?>"><?php echo $gateway->get_title(); ?> <?php echo $gateway->get_icon(); ?></label>
+                                                       <?php
+                                                               if ( $gateway->has_fields() || $gateway->get_description() ) :
+                                                                       echo '<div class="payment_box payment_method_' . $gateway->id . '" ' . ( $gateway->chosen ? '' : 'style="display:none;"' ) . '>';
+                                                                       $gateway->payment_fields();
+                                                                       echo '</div>';
+                                                               endif;
+                                                       ?>
+                                               </li>
+                                               <?php
+                                       }
+                               } else {
+
+                                       if ( ! WC()->customer->get_country() )
+                                               $no_gateways_message = __( 'Please fill in your details above to see available payment methods.', 'wcopc' );
+                                       else
+                                               $no_gateways_message = __( 'Sorry, it seems that there are no available payment methods for your state. Please contact us if you require assistance or wish to make alternate arrangements.', 'wcopc' );
+
+                                       echo '<p>' . apply_filters( 'woocommerce_no_available_payment_methods_message', $no_gateways_message ) . '</p>';
+
+                               }
+                       ?>
+               </ul>
+               <?php endif; ?>
+
+               <div class="form-row place-order">
+
+                       <noscript><?php _e( 'Since your browser does not support JavaScript, or it is disabled, please ensure you click the <em>Update Totals</em> button before placing your order. You may be charged more than the amount stated above if you fail to do so.', 'wcopc' ); ?><br/><input type="submit" class="button alt" name="woocommerce_checkout_update_totals" value="<?php _e( 'Update totals', 'wcopc' ); ?>" /></noscript>
+
+                       <?php wp_nonce_field( 'woocommerce-process_checkout' ); ?>
+
+                       <?php do_action( 'woocommerce_review_order_before_submit' ); ?>
+
+                       <?php
+                       $order_button_text = apply_filters( 'woocommerce_order_button_text', __( 'Place order', 'wcopc' ) );
+
+                       echo apply_filters( 'woocommerce_order_button_html', '<input type="submit" class="button alt" name="woocommerce_checkout_place_order" id="place_order" value="' . esc_attr( $order_button_text ) . '" data-value="' . esc_attr( $order_button_text ) . '" />' );
+                       ?>
+
+                       <?php if ( wc_get_page_id( 'terms' ) > 0 && apply_filters( 'woocommerce_checkout_show_terms', true ) ) {
+                               $terms_is_checked = apply_filters( 'woocommerce_terms_is_checked_default', isset( $_POST['terms'] ) );
+                               ?>
+                               <p class="form-row terms">
+                                       <label for="terms" class="checkbox"><?php printf( __( 'I&rsquo;ve read and accept the <a href="%s" target="_blank">terms &amp; conditions</a>', 'wcopc' ), esc_url( get_permalink( wc_get_page_id( 'terms' ) ) ) ); ?></label>
+                                       <input type="checkbox" class="input-checkbox" name="terms" <?php checked( $terms_is_checked, true ); ?> id="terms" />
+                               </p>
+                       <?php } ?>
+
+                       <?php do_action( 'woocommerce_review_order_after_submit' ); ?>
+
+               </div>
+
+               <div class="clear"></div>
+
+       </div>
+
+       <?php do_action( 'woocommerce_review_order_after_payment' ); ?>
+
+<?php if ( ! $is_ajax ) : ?></div><?php endif; ?>
\ No newline at end of file
diff --git a/woocommerce/checkout/pricing-table.php b/woocommerce/checkout/pricing-table.php
new file mode 100644 (file)
index 0000000..1c26fa6
--- /dev/null
@@ -0,0 +1,76 @@
+<?php
+/**
+ * Template to display a pricing table in a list
+ *
+ * @package WooCommerce-One-Page-Checkout/Templates
+ * @version 1.0
+ */
+if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
+?>
+
+<div class="opc-pricing-table-wrapper opc_columns_<?php echo count( $products ); ?>">
+<?php foreach( $products as $product ) : ?>
+       <div class="opc-pricing-table-product product-item <?php if ( $product->in_cart ) echo 'selected'; ?>">
+               <div class="opc-pricing-table-product-header">
+                       <h3 class="opc-pricing-table-product-title"><?php echo $product->get_title(); ?></h3>
+                       <div class="opc-pricing-table-product-price">
+                               <p><?php echo $product->get_price_html(); ?></p>
+                       </div>
+                       <div class="product-quantity">
+                               <?php wc_get_template( 'checkout/add-to-cart/opc.php', array( 'product' => $product ), '', PP_One_Page_Checkout::$template_path ); ?>
+                       </div>
+               </div>
+
+               <?php if ( $product->has_attributes() ) : ?>
+                       <!-- Product Attributes -->
+                       <div class="opc-pricing-table-product-attributes">
+
+                               <?php if ( $product->is_type( 'variation' ) ) : ?>
+                                       <?php foreach( $product->get_variation_attributes() as $attribute_title => $attribute_value ) : ?>
+                               <h4 class="attribute_title"><?php echo wc_attribute_label( str_replace( 'attribute_', '', $attribute_title ) ); ?></h4>
+                               <p><?php echo PP_One_Page_Checkout::get_formatted_attribute_value( $attribute_title, $attribute_value, $product->parent->get_attributes() ); ?></p>
+                                       <?php endforeach; ?>
+                               <?php else : ?>
+                                       <?php foreach( $product->get_attributes() as $attribute ) :
+                                                       if ( empty( $attribute['is_visible'] ) || ( $attribute['is_taxonomy'] && ! taxonomy_exists( $attribute['name'] ) ) ) {
+                                                               continue;
+                                                       } ?>
+                               <h4 class="attribute_title"><?php echo wc_attribute_label( $attribute['name'] ); ?></h4>
+                               <p><?php
+                                       if ( $attribute['is_taxonomy'] ) {
+                                               $values = wc_get_product_terms( $product->id, $attribute['name'], array( 'fields' => 'names' ) );
+                                               foreach ( $values as $attribute_value ) {
+                                                       echo apply_filters( 'woocommerce_attribute', wpautop( wptexturize( $attribute_value ) ), $attribute, $values );
+                                               }
+                                       } else {
+                                               // Convert pipes to commas and display values
+                                               $values = array_map( 'trim', explode( WC_DELIMITER, $attribute['value'] ) );
+                                               foreach ( $values as $attribute_value ) {
+                                                       echo apply_filters( 'woocommerce_attribute', wpautop( wptexturize( $attribute_value ) ), $attribute, $values );
+                                               }
+                                       }
+                                       ?>
+                               </p>
+                                       <?php endforeach; ?>
+                               <?php endif; ?>
+                       </div>
+               <?php endif; //$product->has_attributes() ?>
+
+               <?php if ( $product->enable_dimensions_display() && ( $product->has_weight() || $product->has_dimensions() ) ) : ?>
+                       <div class="opc-pricing-table-product-dimensions">
+                       <?php if ( $product->has_weight() ) : ?>
+                               <!-- Product Weight -->
+                               <h4><?php _e( 'Weight', 'wcopc' ) ?></h4>
+                               <p class="product_weight"><?php echo $product->get_weight() . ' ' . esc_attr( get_option( 'woocommerce_weight_unit' ) ); ?></p>
+                       <?php endif; ?>
+                       <?php if ( $product->has_dimensions() ) : ?>
+                       <!-- Product Dimension -->
+                               <h4><?php _e( 'Dimensions', 'wcopc' ) ?></h4>
+                               <p class="product_dimensions"><?php echo $product->get_dimensions(); ?></p>
+                       <?php endif; ?>
+                       </div>
+               <?php endif; // $product->enable_dimensions_display() ?>
+       </div>
+<?php endforeach; // product in product_post?>
+</div>
+<div class="clear"></div>
\ No newline at end of file
diff --git a/woocommerce/checkout/product-list.php b/woocommerce/checkout/product-list.php
new file mode 100644 (file)
index 0000000..01c9623
--- /dev/null
@@ -0,0 +1,37 @@
+<?php
+/**
+ * Template to display product selection fields in a list
+ *
+ * @package WooCommerce-One-Page-Checkout/Templates
+ * @version 1.0
+ */
+
+if ( ! defined( 'ABSPATH' ) ) {
+       exit; // Exit if accessed directly
+}
+
+?>
+<ul id="checkout-products">
+       <?php foreach( $products as $product ) : ?>
+       <li class="product-item <?php if ( $product->in_cart ) echo 'selected'; ?>" >
+               <?php wc_get_template( 'checkout/add-to-cart/radio.php', array( 'product' => $product ), '', PP_One_Page_Checkout::$template_path );; ?>
+               <?php echo $product->get_title(); ?>
+               <?php if ( $product->is_type( 'variation' ) ) : ?>
+                       <?php $attribute_string = sprintf( '&nbsp;(%s)', wc_get_formatted_variation( $product->get_variation_attributes(), true ) ); ?>
+                       <span class="attributes"><?php echo esc_html( apply_filters( 'woocommerce_attribute', $attribute_string, $product->get_variation_attributes(), $product ) ); ?></span>
+               <?php else : ?>
+                       <?php $attributes = $product->get_attributes(); ?>
+                       <?php foreach ( $attributes as $attribute ) : ?>
+                               <?php $attribute_string = sprintf( '&nbsp;(%s)', $product->get_attribute( $attribute['name'] ) ); ?>
+                       <span class="attributes"><?php echo esc_html( apply_filters( 'woocommerce_attribute', $attribute_string, $attribute, $product ) ); ?></span>
+                       <?php endforeach; ?>
+               <?php endif; ?>
+               <span class="dash">&nbsp;&mdash;&nbsp;</span>
+               <?php if ( $product->is_in_stock() ) { ?>
+               <span itemprop="price" class="price"><?php echo $product->get_price_html(); ?></span>
+               <?php } else {
+               wc_get_template( 'checkout/add-to-cart/availability.php', array( 'product' => $product ), '', PP_One_Page_Checkout::$template_path );
+               } ?>
+       </li>
+       <?php endforeach; // end of the loop. ?>
+</ul>
diff --git a/woocommerce/checkout/product-single.php b/woocommerce/checkout/product-single.php
new file mode 100644 (file)
index 0000000..60b7f41
--- /dev/null
@@ -0,0 +1,72 @@
+<?php
+/**
+ * Template to display a single product as per standard WooCommerce Templates
+ *
+ * @package WooCommerce-One-Page-Checkout/Templates
+ * @version 1.0
+ */
+
+if ( ! defined( 'ABSPATH' ) ) {
+       exit; // Exit if accessed directly
+}
+
+global $post, $product;
+
+$the_post_id = $post->ID;
+
+foreach ( $products as $single_product ) :
+
+       $product      = $single_product;
+       $post         = $single_product->post;
+
+       ?>
+       <div class="opc-single-product">
+
+               <div itemscope itemtype="<?php echo woocommerce_get_product_schema(); ?>" id="product-<?php the_ID(); ?>" <?php post_class(); ?>>
+
+                       <?php
+                               /**
+                                * woocommerce_before_single_product_summary hook
+                                *
+                                * @hooked woocommerce_show_product_sale_flash - 10
+                                * @hooked woocommerce_show_product_images - 20
+                                */
+                               do_action( 'woocommerce_before_single_product_summary' );
+                       ?>
+
+                       <div class="summary entry-summary product-item <?php if ( $product->in_cart ) { echo 'selected'; } ?>">
+
+                               <?php
+                                       woocommerce_template_single_title();
+                                       woocommerce_template_single_price();
+                                       woocommerce_template_single_excerpt();
+                               ?>
+
+                               <div class="product-quantity">
+
+                                       <?php
+                                               /**
+                                                * wcopc_single_add_to_cart hook
+                                                *
+                                                * @hooked opc_single_add_to_cart - 10
+                                                */
+                                               do_action( 'wcopc_single_add_to_cart', $the_post_id );
+                                       ?>
+
+                               </div>
+
+                               <?php
+                                       woocommerce_template_single_meta();
+                                       woocommerce_template_single_sharing();
+                               ?>
+
+                       </div><!-- .summary -->
+
+                       <meta itemprop="url" content="<?php the_permalink(); ?>" />
+
+               </div><!-- #product-<?php the_ID(); ?> -->
+
+       </div>
+<?php endforeach; ?>
+
+<?php wp_reset_postdata(); ?>
diff --git a/woocommerce/checkout/product-table.php b/woocommerce/checkout/product-table.php
new file mode 100644 (file)
index 0000000..489d41f
--- /dev/null
@@ -0,0 +1,47 @@
+<?php
+/**
+ * Template to display product selection fields in a table (with thumbnail etc.)
+ *
+ * @package WooCommerce-One-Page-Checkout/Templates
+ * @version 1.0
+ */
+
+if ( ! defined( 'ABSPATH' ) ) {
+       exit; // Exit if accessed directly
+}
+?>
+<table class="shop_table" cellspacing="0">
+       <?php foreach( $products as $product ) : ?>
+
+       <tr class="product-item <?php if ( $product->in_cart ) echo 'selected'; ?>">
+
+               <td class="product-thumbnail">
+                       <a href="<?php echo wp_get_attachment_url( $product->get_image_id() ); ?>" data-rel="prettyPhoto"  itemprop="image" class="woocommerce-main-image zoom">
+                               <?php echo $product->get_image(); ?>
+                       </a>
+               </td>
+
+               <td class="product-name">
+                       <?php echo $product->get_title(); ?>
+                       <?php if ( $product->is_type( 'variation' ) ) : ?>
+                               <?php $attribute_string = sprintf( '&nbsp;(%s)', wc_get_formatted_variation( $product->get_variation_attributes(), true ) ); ?>
+                       <span class="attributes"><?php echo esc_html( apply_filters( 'wcopc_attributes', $attribute_string, $product->get_variation_attributes(), $product ) ); ?></span>
+                       <?php else : ?>
+                               <?php $attributes = $product->get_attributes(); ?>
+                               <?php foreach ( $attributes as $attribute ) : ?>
+                                       <?php $attribute_string = sprintf( '&nbsp;(%s)', $product->get_attribute( $attribute['name'] ) ); ?>
+                       <span class="attributes"><?php echo esc_html( apply_filters( 'wcopc_attributes', $attribute_string, $attribute, $product ) ); ?></span>
+                               <?php endforeach; ?>
+                       <?php endif; ?>
+               </td>
+
+               <td class="product-price">
+                       <span itemprop="price" class="price"><?php echo $product->get_price_html(); ?></span>
+               </td>
+
+               <td class="product-quantity">
+                       <?php wc_get_template( 'checkout/add-to-cart/opc.php', array( 'product' => $product ), '', PP_One_Page_Checkout::$template_path ); ?>
+               </td>
+       </tr>
+       <?php endforeach; // end of the loop. ?>
+</table>
diff --git a/woocommerce/checkout/review-order-opc.php b/woocommerce/checkout/review-order-opc.php
new file mode 100644 (file)
index 0000000..0e9ea86
--- /dev/null
@@ -0,0 +1,129 @@
+<?php
+/**
+ * OPC review order form template with Remove/Quantity columns
+ *
+ * @version 2.3
+ */
+
+if ( ! defined( 'ABSPATH' ) ) {
+       exit; // Exit if accessed directly
+}
+
+?>
+<div class="opc_order_review">
+       <input type="hidden" name="is_opc" value="1" />
+       <table class="shop_table woocommerce-checkout-review-order-table">
+               <thead>
+                       <tr>
+                               <th class="product-name">
+                                       <?php _e( 'Product', 'wcopc' ); ?>
+                                       <div class="product-quantity"><?php _e( 'Quantity', 'wcopc' ); ?></div>
+                               </th>
+                               <th class="product-total"><?php _e( 'Total', 'wcopc' ); ?></th>
+                       </tr>
+               </thead>
+               <tbody>
+                       <?php
+                               do_action( 'woocommerce_review_order_before_cart_contents' );
+
+                               foreach ( WC()->cart->get_cart() as $cart_item_key => $cart_item ) {
+                                       $_product = apply_filters( 'woocommerce_cart_item_product', $cart_item['data'], $cart_item, $cart_item_key );
+
+                                       if ( $_product && $_product->exists() && $cart_item['quantity'] > 0 && apply_filters( 'woocommerce_checkout_cart_item_visible', true, $cart_item, $cart_item_key ) ) {
+                                               ?>
+                                               <tr class="<?php echo esc_attr( apply_filters( 'woocommerce_cart_item_class', 'cart_item opc_cart_item', $cart_item, $cart_item_key ) ); ?>" data-add_to_cart="<?php echo $_product->variation_id ? $_product->variation_id : $_product->id; ?>" data-update_key="<?php echo $cart_item_key; ?>">
+                                                       <td class="product-name">
+                                                               <div class="product-remove" >
+                                                                       <?php echo apply_filters( 'woocommerce_cart_item_remove_link', sprintf( '<a href="%s" class="remove" title="%s">&times;</a>', esc_url( WC()->cart->get_remove_url( $cart_item_key ) ), __( 'Remove this item', 'wcopc' ) ), $cart_item_key ); ?>
+                                                               </div>
+                                                               <div class="product-details" >
+                                                                       <?php echo apply_filters( 'woocommerce_cart_item_name', $_product->get_title(), $cart_item, $cart_item_key ); ?>
+                                                                       <?php echo WC()->cart->get_item_data( $cart_item ); ?>
+                                                               </div>
+                                                               <div class="product-quantity">
+                                                               <?php
+                                                                       if ( $_product->is_sold_individually() ) {
+                                                                               $product_quantity = sprintf( '1 <input type="hidden" name="cart[%s][qty]" value="1" />', $cart_item_key );
+                                                                       } else {
+                                                                               $product_quantity = woocommerce_quantity_input( array(
+                                                                                       'input_name'  => "cart[{$cart_item_key}][qty]",
+                                                                                       'input_value' => $cart_item['quantity'],
+                                                                                       'max_value'   => $_product->backorders_allowed() ? '' : $_product->get_stock_quantity(),
+                                                                                       'min_value'   => '0'
+                                                                               ), $_product, false );
+                                                                       }
+
+                                                                       echo apply_filters( 'woocommerce_cart_item_quantity', $product_quantity, $cart_item_key );
+                                                               ?>
+                                                               </div>
+                                                       </td>
+                                                       <td class="product-total">
+                                                               <?php echo apply_filters( 'woocommerce_cart_item_subtotal', WC()->cart->get_product_subtotal( $_product, $cart_item['quantity'] ), $cart_item, $cart_item_key ); ?>
+                                                       </td>
+                                               </tr>
+                                               <?php
+                                       }
+                               }
+
+                               do_action( 'woocommerce_review_order_after_cart_contents' );
+                       ?>
+               </tbody>
+               <tfoot>
+
+                       <tr class="cart-subtotal">
+                               <th><?php _e( 'Cart Subtotal', 'wcopc' ); ?></th>
+                               <td><?php wc_cart_totals_subtotal_html(); ?></td>
+                       </tr>
+
+                       <?php foreach ( WC()->cart->get_coupons() as $code => $coupon ) : ?>
+                               <tr class="cart-discount coupon-<?php echo esc_attr( $code ); ?>">
+                                       <th><?php wc_cart_totals_coupon_label( $coupon ); ?></th>
+                                       <td><?php wc_cart_totals_coupon_html( $coupon ); ?></td>
+                               </tr>
+                       <?php endforeach; ?>
+
+                       <?php if ( WC()->cart->needs_shipping() && WC()->cart->show_shipping() ) : ?>
+
+                               <?php do_action( 'woocommerce_review_order_before_shipping' ); ?>
+
+                               <?php wc_cart_totals_shipping_html(); ?>
+
+                               <?php do_action( 'woocommerce_review_order_after_shipping' ); ?>
+
+                       <?php endif; ?>
+
+                       <?php foreach ( WC()->cart->get_fees() as $fee ) : ?>
+                               <tr class="fee">
+                                       <th><?php echo esc_html( $fee->name ); ?></th>
+                                       <td><?php wc_cart_totals_fee_html( $fee ); ?></td>
+                               </tr>
+                       <?php endforeach; ?>
+
+                       <?php if ( WC()->cart->tax_display_cart === 'excl' ) : ?>
+                               <?php if ( get_option( 'woocommerce_tax_total_display' ) === 'itemized' ) : ?>
+                                       <?php foreach ( WC()->cart->get_tax_totals() as $code => $tax ) : ?>
+                                               <tr class="tax-rate tax-rate-<?php echo sanitize_title( $code ); ?>">
+                                                       <th><?php echo esc_html( $tax->label ); ?></th>
+                                                       <td><?php echo wp_kses_post( $tax->formatted_amount ); ?></td>
+                                               </tr>
+                                       <?php endforeach; ?>
+                               <?php else : ?>
+                                       <tr class="tax-total">
+                                               <th><?php echo esc_html( WC()->countries->tax_or_vat() ); ?></th>
+                                               <td><?php echo wc_price( WC()->cart->get_taxes_total() ); ?></td>
+                                       </tr>
+                               <?php endif; ?>
+                       <?php endif; ?>
+
+                       <?php do_action( 'woocommerce_review_order_before_order_total' ); ?>
+
+                       <tr class="order-total">
+                               <th><?php _e( 'Order Total', 'wcopc' ); ?></th>
+                               <td><?php wc_cart_totals_order_total_html(); ?></td>
+                       </tr>
+
+                       <?php do_action( 'woocommerce_review_order_after_order_total' ); ?>
+
+               </tfoot>
+       </table>
+</div>
\ No newline at end of file
index 3618534..f044d45 100644 (file)
@@ -6,7 +6,7 @@
  *
  * @author             WooThemes
  * @package    WooCommerce/Templates
- * @version     1.6.4
+ * @version     2.4.0
  */
 
 if ( ! defined( 'ABSPATH' ) ) {
diff --git a/woocommerce/content-single-product.php b/woocommerce/content-single-product.php
new file mode 100644 (file)
index 0000000..511b4eb
--- /dev/null
@@ -0,0 +1,78 @@
+<?php
+/**
+ * The template for displaying product content in the single-product.php template
+ *
+ * Override this template by copying it to yourtheme/woocommerce/content-single-product.php
+ *
+ * @author             WooThemes
+ * @package    WooCommerce/Templates
+ * @version     1.6.4
+ */
+
+if ( ! defined( 'ABSPATH' ) ) {
+       exit; // Exit if accessed directly
+}
+
+?>
+
+<?php
+       /**
+        * woocommerce_before_single_product hook
+        *
+        * @hooked wc_print_notices - 10
+        */
+        do_action( 'woocommerce_before_single_product' );
+
+        if ( post_password_required() ) {
+               echo get_the_password_form();
+               return;
+        }
+?>
+
+<div itemscope itemtype="<?php echo woocommerce_get_product_schema(); ?>" id="product-<?php the_ID(); ?>" <?php post_class(); ?>>
+
+       <?php
+               /**
+                * woocommerce_before_single_product_summary hook
+                *
+                * @hooked woocommerce_show_product_sale_flash - 10
+                * @hooked woocommerce_show_product_images - 20
+                */
+               do_action( 'woocommerce_before_single_product_summary' );
+       ?>
+
+       <div class="summary entry-summary">
+
+               <?php
+                       /**
+                        * woocommerce_single_product_summary hook
+                        *
+                        * @hooked woocommerce_template_single_title - 5
+                        * @hooked woocommerce_template_single_rating - 10
+                        * @hooked woocommerce_template_single_price - 10
+                        * @hooked woocommerce_template_single_excerpt - 20
+                        * @hooked woocommerce_template_single_add_to_cart - 30
+                        * @hooked woocommerce_template_single_meta - 40
+                        * @hooked woocommerce_template_single_sharing - 50
+                        */
+            do_action( 'woocommerce_single_product_summary' );
+               ?>
+
+       </div><!-- .summary -->
+
+       <?php
+               /**
+                * woocommerce_after_single_product_summary hook
+                *
+                * @hooked woocommerce_output_product_data_tabs - 10
+                * @hooked woocommerce_upsell_display - 15
+                * @hooked woocommerce_output_related_products - 20
+                */
+               do_action( 'woocommerce_after_single_product_summary' );
+       ?>
+
+       <meta itemprop="url" content="<?php the_permalink(); ?>" />
+
+</div><!-- #product-<?php the_ID(); ?> -->
+
+<?php do_action( 'woocommerce_after_single_product' ); ?>