From 20f32ca24165ee6b2cf9708db5ef29ff8ee590a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Holger=20Ko=CC=88nemann?= Date: Sat, 11 Feb 2017 10:44:17 +0100 Subject: [PATCH] keeping custom woo commerce overwrites --- woocommerce/archive-product.php | 108 ++++++++++++ woocommerce/cart/cart-empty.php | 39 ++++ woocommerce/cart/cart.php | 166 ++++++++++++++++++ woocommerce/cart/mini-cart.php | 91 ++++++++++ .../cart/proceed-to-checkout-button.php | 28 +++ woocommerce/checkout/form-checkout.php | 67 +++++++ woocommerce/checkout/form-coupon.php | 44 +++++ woocommerce/checkout/form-pay.php | 98 +++++++++++ woocommerce/checkout/payment.php | 60 +++++++ woocommerce/global/form-login.php | 62 +++++++ woocommerce/global/quantity-input.php | 25 +++ woocommerce/global/wrapper-end.php | 23 +++ woocommerce/global/wrapper-start.php | 31 ++++ woocommerce/loop/add-to-cart.php | 35 ++++ woocommerce/loop/orderby.php | 45 +++++ woocommerce/myaccount/downloads.php | 104 +++++++++++ woocommerce/myaccount/form-edit-account.php | 73 ++++++++ woocommerce/myaccount/form-edit-address.php | 55 ++++++ woocommerce/myaccount/form-login.php | 124 +++++++++++++ woocommerce/myaccount/form-lost-password.php | 45 +++++ woocommerce/myaccount/form-reset-password.php | 52 ++++++ woocommerce/myaccount/my-orders.php | 105 +++++++++++ woocommerce/myaccount/navigation.php | 35 ++++ woocommerce/myaccount/orders.php | 125 +++++++++++++ .../single-product/add-to-cart/simple.php | 65 +++++++ .../single-product/product-thumbnails.php | 71 ++++++++ woocommerce/single-product/rating.php | 45 +++++ woocommerce/single-product/review-rating.php | 32 ++++ .../single-product/short-description.php | 32 ++++ 29 files changed, 1885 insertions(+) create mode 100644 woocommerce/archive-product.php create mode 100644 woocommerce/cart/cart-empty.php create mode 100644 woocommerce/cart/cart.php create mode 100644 woocommerce/cart/mini-cart.php create mode 100644 woocommerce/cart/proceed-to-checkout-button.php create mode 100644 woocommerce/checkout/form-checkout.php create mode 100644 woocommerce/checkout/form-coupon.php create mode 100644 woocommerce/checkout/form-pay.php create mode 100644 woocommerce/checkout/payment.php create mode 100644 woocommerce/global/form-login.php create mode 100644 woocommerce/global/quantity-input.php create mode 100644 woocommerce/global/wrapper-end.php create mode 100644 woocommerce/global/wrapper-start.php create mode 100644 woocommerce/loop/add-to-cart.php create mode 100644 woocommerce/loop/orderby.php create mode 100644 woocommerce/myaccount/downloads.php create mode 100644 woocommerce/myaccount/form-edit-account.php create mode 100644 woocommerce/myaccount/form-edit-address.php create mode 100644 woocommerce/myaccount/form-login.php create mode 100644 woocommerce/myaccount/form-lost-password.php create mode 100644 woocommerce/myaccount/form-reset-password.php create mode 100644 woocommerce/myaccount/my-orders.php create mode 100644 woocommerce/myaccount/navigation.php create mode 100644 woocommerce/myaccount/orders.php create mode 100644 woocommerce/single-product/add-to-cart/simple.php create mode 100644 woocommerce/single-product/product-thumbnails.php create mode 100644 woocommerce/single-product/rating.php create mode 100644 woocommerce/single-product/review-rating.php create mode 100644 woocommerce/single-product/short-description.php diff --git a/woocommerce/archive-product.php b/woocommerce/archive-product.php new file mode 100644 index 0000000..6d74fb4 --- /dev/null +++ b/woocommerce/archive-product.php @@ -0,0 +1,108 @@ + + + + + + +

+ + + + + + + + + + + + + + + + + + + + + + + + woocommerce_product_loop_start( false ), 'after' => woocommerce_product_loop_end( false ) ) ) ) : ?> + + + + + + + + + + diff --git a/woocommerce/cart/cart-empty.php b/woocommerce/cart/cart-empty.php new file mode 100644 index 0000000..1f495be --- /dev/null +++ b/woocommerce/cart/cart-empty.php @@ -0,0 +1,39 @@ + + +

+ +

+ + + + 0 ) : ?> +

+ + + +

+ diff --git a/woocommerce/cart/cart.php b/woocommerce/cart/cart.php new file mode 100644 index 0000000..dbc0fca --- /dev/null +++ b/woocommerce/cart/cart.php @@ -0,0 +1,166 @@ + + +
+ + + + + + + + + + + + + + + + + + cart->get_cart() as $cart_item_key => $cart_item ) { + $_product = apply_filters( 'woocommerce_cart_item_product', $cart_item['data'], $cart_item, $cart_item_key ); + $product_id = apply_filters( 'woocommerce_cart_item_product_id', $cart_item['product_id'], $cart_item, $cart_item_key ); + + if ( $_product && $_product->exists() && $cart_item['quantity'] > 0 && apply_filters( 'woocommerce_cart_item_visible', true, $cart_item, $cart_item_key ) ) { + $product_permalink = apply_filters( 'woocommerce_cart_item_permalink', $_product->is_visible() ? $_product->get_permalink( $cart_item ) : '', $cart_item, $cart_item_key ); + ?> + + + + + + + + + + + + + + + + + + + + + +
  
+ ×', + esc_url( WC()->cart->get_remove_url( $cart_item_key ) ), + __( 'Remove this item', 'understrap' ), + esc_attr( $product_id ), + esc_attr( $_product->get_sku() ) + ), $cart_item_key ); + ?> + + get_image(), $cart_item, $cart_item_key ); + + if ( ! $product_permalink ) { + echo $thumbnail; + } else { + printf( '%s', esc_url( $product_permalink ), $thumbnail ); + } + ?> + + get_title(), $cart_item, $cart_item_key ) . ' '; + } else { + echo apply_filters( 'woocommerce_cart_item_name', sprintf( '%s', esc_url( $product_permalink ), $_product->get_title() ), $cart_item, $cart_item_key ); + } + + // Meta data. + echo WC()->cart->get_item_data( $cart_item ); + + // Backorder notification. + if ( $_product->backorders_require_notification() && $_product->is_on_backorder( $cart_item['quantity'] ) ) { + echo '

' . esc_html__( 'Available on backorder', 'understrap' ) . '

'; + } + ?> +
+ cart->get_product_price( $_product ), $cart_item, $cart_item_key ); + ?> + + is_sold_individually() ) { + $product_quantity = sprintf( '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, $cart_item ); + ?> + + cart->get_product_subtotal( $_product, $cart_item['quantity'] ), $cart_item, $cart_item_key ); + ?> +
+ + +
+ + + + +
+ + + + + + + +
+ + + +
+ +
+ + + +
+ + diff --git a/woocommerce/cart/mini-cart.php b/woocommerce/cart/mini-cart.php new file mode 100644 index 0000000..bc8bf13 --- /dev/null +++ b/woocommerce/cart/mini-cart.php @@ -0,0 +1,91 @@ + + + + + + +cart->is_empty() ) : ?> + +

: cart->get_cart_subtotal(); ?>

+ + + +

+ + +

+ + + + diff --git a/woocommerce/cart/proceed-to-checkout-button.php b/woocommerce/cart/proceed-to-checkout-button.php new file mode 100644 index 0000000..a8065b7 --- /dev/null +++ b/woocommerce/cart/proceed-to-checkout-button.php @@ -0,0 +1,28 @@ + + + + + diff --git a/woocommerce/checkout/form-checkout.php b/woocommerce/checkout/form-checkout.php new file mode 100644 index 0000000..f14569f --- /dev/null +++ b/woocommerce/checkout/form-checkout.php @@ -0,0 +1,67 @@ +enable_signup && ! $checkout->enable_guest_checkout && ! is_user_logged_in() ) { + echo apply_filters( 'woocommerce_checkout_must_be_logged_in_message', __( 'You must be logged in to checkout.', 'understrap' ) ); + return; +} + +?> + +
+ + checkout_fields ) > 0 ) : ?> + + + +
+
+ +
+ +
+ +
+
+ + + + + +

+ + + +
+ +
+ + + +
+ + diff --git a/woocommerce/checkout/form-coupon.php b/woocommerce/checkout/form-coupon.php new file mode 100644 index 0000000..492153a --- /dev/null +++ b/woocommerce/checkout/form-coupon.php @@ -0,0 +1,44 @@ +cart->applied_coupons ) ) { + $info_message = apply_filters( 'woocommerce_checkout_coupon_message', __( 'Have a coupon?', 'understrap' ) . ' ' . __( 'Click here to enter your code', 'understrap' ) . '' ); + wc_print_notice( $info_message, 'notice' ); +} +?> + + diff --git a/woocommerce/checkout/form-pay.php b/woocommerce/checkout/form-pay.php new file mode 100644 index 0000000..344f374 --- /dev/null +++ b/woocommerce/checkout/form-pay.php @@ -0,0 +1,98 @@ + +
+ + + + + + + + + + + get_items() ) > 0 ) : ?> + get_items() as $item_id => $item ) : ?> + + + + + + + + + + + get_order_item_totals() ) : ?> + + + + + + + + +
+ display_item_meta( $item ); + do_action( 'woocommerce_order_item_meta_end', $item_id, $item, $order ); + ?> + ' . sprintf( '× %s', esc_html( $item['qty'] ) ) . '', $item ); ?>get_formatted_line_subtotal( $item ); ?>
+ +
+ needs_payment() ) : ?> +
    + $gateway ) ); + } + } else { + echo '
  • ' . apply_filters( 'woocommerce_no_available_payment_methods_message', __( 'Sorry, it seems that there are no available payment methods for your location. Please contact us if you require assistance or wish to make alternate arrangements.', 'understrap' ) ) . '
  • '; + } + ?> +
+ +
+ + + + + + + ' ); ?> + + + + +
+
+
diff --git a/woocommerce/checkout/payment.php b/woocommerce/checkout/payment.php new file mode 100644 index 0000000..7689671 --- /dev/null +++ b/woocommerce/checkout/payment.php @@ -0,0 +1,60 @@ + +
+ cart->needs_payment() ) : ?> + + +
+ + + + + + + ' ); ?> + + + + +
+
+ +
> + + + + + +

+ + +

+

+ + +

+
+ + + +

+ + + + +

+

+ +

+ +
+ + + +
diff --git a/woocommerce/global/quantity-input.php b/woocommerce/global/quantity-input.php new file mode 100644 index 0000000..29c0b19 --- /dev/null +++ b/woocommerce/global/quantity-input.php @@ -0,0 +1,25 @@ + +
+ +
diff --git a/woocommerce/global/wrapper-end.php b/woocommerce/global/wrapper-end.php new file mode 100644 index 0000000..d788f46 --- /dev/null +++ b/woocommerce/global/wrapper-end.php @@ -0,0 +1,23 @@ + + diff --git a/woocommerce/global/wrapper-start.php b/woocommerce/global/wrapper-start.php new file mode 100644 index 0000000..cb8a5ff --- /dev/null +++ b/woocommerce/global/wrapper-start.php @@ -0,0 +1,31 @@ +
'; +} else { + echo '
'; +} diff --git a/woocommerce/loop/add-to-cart.php b/woocommerce/loop/add-to-cart.php new file mode 100644 index 0000000..a6f9900 --- /dev/null +++ b/woocommerce/loop/add-to-cart.php @@ -0,0 +1,35 @@ +%s', + esc_url( $product->add_to_cart_url() ), + esc_attr( isset( $quantity ) ? $quantity : 1 ), + esc_attr( $product->id ), + esc_attr( $product->get_sku() ), + // TODO: load add to cart button class from customizer? +// esc_attr( isset( $class ) ? $class : 'button' ), + esc_html( $product->add_to_cart_text() ) + ), + $product ); diff --git a/woocommerce/loop/orderby.php b/woocommerce/loop/orderby.php new file mode 100644 index 0000000..0edd386 --- /dev/null +++ b/woocommerce/loop/orderby.php @@ -0,0 +1,45 @@ + +
+ + $val ) { + if ( 'orderby' === $key || 'submit' === $key ) { + continue; + } + if ( is_array( $val ) ) { + foreach( $val as $innerVal ) { + echo ''; + } + } else { + echo ''; + } + } + ?> +
diff --git a/woocommerce/myaccount/downloads.php b/woocommerce/myaccount/downloads.php new file mode 100644 index 0000000..6bfe3cf --- /dev/null +++ b/woocommerce/myaccount/downloads.php @@ -0,0 +1,104 @@ +customer->get_downloadable_products(); +$has_downloads = (bool) $downloads; + +do_action( 'woocommerce_before_account_downloads', $has_downloads ); ?> + + + + + + + + + $column_name ) : ?> + + + + + + + $column_name ) : ?> + + + + +
+ + + + + + + + + + + + + + + + + + + + array( + 'url' => $download['download_url'], + 'name' => __( 'Download', 'understrap' ) + ) + ); + + if ( $actions = apply_filters( 'woocommerce_account_download_actions', $actions, $download ) ) { + foreach ( $actions as $key => $action ) { + echo '' . esc_html( $action['name'] ) . ''; + } + } + ?> + + +
+ + + + +
+ + + + +
+ + + diff --git a/woocommerce/myaccount/form-edit-account.php b/woocommerce/myaccount/form-edit-account.php new file mode 100644 index 0000000..bf29b67 --- /dev/null +++ b/woocommerce/myaccount/form-edit-account.php @@ -0,0 +1,73 @@ + + + + + diff --git a/woocommerce/myaccount/form-edit-address.php b/woocommerce/myaccount/form-edit-address.php new file mode 100644 index 0000000..e1314f4 --- /dev/null +++ b/woocommerce/myaccount/form-edit-address.php @@ -0,0 +1,55 @@ + + + + + + +
+ +

+ + + + $field ) : ?> + + + + + + + +

+ + + +

+ +
+ + + + diff --git a/woocommerce/myaccount/form-login.php b/woocommerce/myaccount/form-login.php new file mode 100644 index 0000000..3e841da --- /dev/null +++ b/woocommerce/myaccount/form-login.php @@ -0,0 +1,124 @@ + + + + + + + + +
+ +
+ + + +

+ + + + + +
+ +
+ +

+ +
+ + + + + +

+ + +

+ + + +

+ + +

+ + + +

+ + +

+ + + + +
+ + + + +

+ + +

+ + + +
+ +
+ +
+ + + diff --git a/woocommerce/myaccount/form-lost-password.php b/woocommerce/myaccount/form-lost-password.php new file mode 100644 index 0000000..961d6c9 --- /dev/null +++ b/woocommerce/myaccount/form-lost-password.php @@ -0,0 +1,45 @@ + + +
+ +

+ +

+ + +

+ +
+ + + +

+ + +

+ + + +
diff --git a/woocommerce/myaccount/form-reset-password.php b/woocommerce/myaccount/form-reset-password.php new file mode 100644 index 0000000..878f0d6 --- /dev/null +++ b/woocommerce/myaccount/form-reset-password.php @@ -0,0 +1,52 @@ + + +
+ +

+ +

+ + +

+

+ + +

+ + + + +
+ + + +

+ + +

+ + + +
diff --git a/woocommerce/myaccount/my-orders.php b/woocommerce/myaccount/my-orders.php new file mode 100644 index 0000000..b49c50e --- /dev/null +++ b/woocommerce/myaccount/my-orders.php @@ -0,0 +1,105 @@ + __( 'Order', 'understrap' ), + 'order-date' => __( 'Date', 'understrap' ), + 'order-status' => __( 'Status', 'understrap' ), + 'order-total' => __( 'Total', 'understrap' ), + 'order-actions' => ' ', +) ); + +$customer_orders = get_posts( apply_filters( 'woocommerce_my_account_my_orders_query', array( + 'numberposts' => $order_count, + 'meta_key' => '_customer_user', + 'meta_value' => get_current_user_id(), + 'post_type' => wc_get_order_types( 'view-orders' ), + 'post_status' => array_keys( wc_get_order_statuses() ) +) ) ); + +if ( $customer_orders ) : ?> + +

+ + + + + + $column_name ) : ?> + + + + + + + get_item_count(); + ?> + + $column_name ) : ?> + + + + + + + diff --git a/woocommerce/myaccount/navigation.php b/woocommerce/myaccount/navigation.php new file mode 100644 index 0000000..edb1a7d --- /dev/null +++ b/woocommerce/myaccount/navigation.php @@ -0,0 +1,35 @@ + + + + + diff --git a/woocommerce/myaccount/orders.php b/woocommerce/myaccount/orders.php new file mode 100644 index 0000000..b9196dd --- /dev/null +++ b/woocommerce/myaccount/orders.php @@ -0,0 +1,125 @@ + + + + + + + + $column_name ) : ?> + + + + + + + orders as $customer_order ) : + $order = wc_get_order( $customer_order ); + $item_count = $order->get_item_count(); + ?> + + $column_name ) : ?> + + + + + + + + + + max_num_pages ) : ?> +
+ + + + + max_num_pages ) ) : ?> + + +
+ + + +
+ + + + +
+ + + diff --git a/woocommerce/single-product/add-to-cart/simple.php b/woocommerce/single-product/add-to-cart/simple.php new file mode 100644 index 0000000..0e56dd2 --- /dev/null +++ b/woocommerce/single-product/add-to-cart/simple.php @@ -0,0 +1,65 @@ +is_purchasable() ) { + return; +} + +?> + +get_availability(); + $availability_html = empty( $availability['availability'] ) ? '' : '

' . esc_html( $availability['availability'] ) . '

'; + + echo apply_filters( 'woocommerce_stock_html', $availability_html, $availability['availability'], $product ); +?> + +is_in_stock() ) : ?> + + + +
+ + + is_sold_individually() ) { + woocommerce_quantity_input( array( + 'min_value' => apply_filters( 'woocommerce_quantity_input_min', 1, $product ), + 'max_value' => apply_filters( 'woocommerce_quantity_input_max', $product->backorders_allowed() ? '' : $product->get_stock_quantity(), $product ), + 'input_value' => ( isset( $_POST['quantity'] ) ? wc_stock_amount( $_POST['quantity'] ) : 1 ) + ) ); + } + ?> + + + + + + +
+ + + + diff --git a/woocommerce/single-product/product-thumbnails.php b/woocommerce/single-product/product-thumbnails.php new file mode 100644 index 0000000..4d944a3 --- /dev/null +++ b/woocommerce/single-product/product-thumbnails.php @@ -0,0 +1,71 @@ +get_gallery_attachment_ids(); + +if ( $attachment_ids ) { + $loop = 0; + $columns = apply_filters( 'woocommerce_product_thumbnails_columns', 3 ); + ?> +
%s', + esc_url( $props['url'] ), + esc_attr( $image_class ), + esc_attr( $props['caption'] ), + wp_get_attachment_image( $attachment_id, apply_filters( 'single_product_small_thumbnail_size', 'shop_thumbnail' ), 0, $props ) + ), + $attachment_id, + $post->ID, + esc_attr( $image_class ) + ); + + $loop++; + } + + ?>
+ get_rating_count(); +$review_count = $product->get_review_count(); +$average = $product->get_average_rating(); + +if ( $rating_count > 0 ) : ?> + +
+
+ + ', '' ); ?> + ' . $rating_count . '' ); ?> + +
+ (' . $review_count . '' ); ?>) +
+ + diff --git a/woocommerce/single-product/review-rating.php b/woocommerce/single-product/review-rating.php new file mode 100644 index 0000000..5b15957 --- /dev/null +++ b/woocommerce/single-product/review-rating.php @@ -0,0 +1,32 @@ +comment_ID, 'rating', true ) ); + +if ( $rating && get_option( 'woocommerce_enable_review_rating' ) === 'yes' ) { ?> + +
+ +
+ +post_excerpt ) { + return; +} + +?> +
+ post_excerpt ) ?> +