diff --git a/inc/woocommerce.php b/inc/woocommerce.php
index 098a60b..17da035 100644
--- a/inc/woocommerce.php
+++ b/inc/woocommerce.php
@@ -132,3 +132,12 @@ function understrap_wc_form_field_args( $args, $key, $value = null ) {
return $args;
}
+
+/**
+* Change loop add-to-cart button class to Bootstrap
+*/
+add_filter( 'woocommerce_loop_add_to_cart_args', 'understrap_woocommerce_add_to_cart_args', 10, 2 );
+function understrap_woocommerce_add_to_cart_args( $args, $product ) {
+ $args['class'] = str_replace('button','btn btn-outline-primary', 'button');
+ return $args;
+}
diff --git a/woocommerce/cart/cart-empty.php b/woocommerce/cart/cart-empty.php
index 155ae52..fd722cb 100644
--- a/woocommerce/cart/cart-empty.php
+++ b/woocommerce/cart/cart-empty.php
@@ -13,7 +13,7 @@
* @see https://docs.woocommerce.com/document/template-structure/
* @author WooThemes
* @package WooCommerce/Templates
- * @version 3.3.2
+ * @version 3.1.0
*/
if ( ! defined( 'ABSPATH' ) ) {
@@ -30,7 +30,7 @@ do_action( 'woocommerce_cart_is_empty' );
if ( wc_get_page_id( 'shop' ) > 0 ) : ?>
@@ -53,45 +53,42 @@ do_action( 'woocommerce_before_cart' ); ?>
×',
esc_url( wc_get_cart_remove_url( $cart_item_key ) ),
- esc_attr__( 'Remove this item', 'understrap' ),
+ __( 'Remove this item', 'understrap' ),
esc_attr( $product_id ),
esc_attr( $_product->get_sku() )
), $cart_item_key );
?>
|
-
- get_image(), $cart_item, $cart_item_key );
+ | get_image(), $cart_item, $cart_item_key );
- if ( ! $product_permalink ) {
- echo $thumbnail;
- } else {
- printf( '%s', esc_url( $product_permalink ), $thumbnail );
- }
- ?>
- |
+ if ( ! $product_permalink ) {
+ echo $thumbnail;
+ } else {
+ printf( '%s', esc_url( $product_permalink ), $thumbnail );
+ }
+ ?>
-
- get_name(), $cart_item, $cart_item_key ) . ' ';
- } else {
- echo apply_filters( 'woocommerce_cart_item_name', sprintf( '%s', esc_url( $product_permalink ), $_product->get_name() ), $cart_item, $cart_item_key );
- }
+ | get_name(), $cart_item, $cart_item_key ) . ' ';
+ } else {
+ echo apply_filters( 'woocommerce_cart_item_name', sprintf( '%s', esc_url( $product_permalink ), $_product->get_name() ), $cart_item, $cart_item_key );
+ }
- // Meta data
- echo wc_get_formatted_cart_item_data( $cart_item );
+ // Meta data.
+ echo wc_get_formatted_cart_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' ) . ' ';
- }
- ?>
- |
+ // Backorder notification.
+ if ( $_product->backorders_require_notification() && $_product->is_on_backorder( $cart_item['quantity'] ) ) {
+ echo '' . esc_html__( 'Available on backorder', 'understrap' ) . '
';
+ }
+ ?>
?>
|
-
- 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->get_max_purchase_quantity(),
- 'min_value' => '0',
- ), $_product, false );
- }
+ | 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->get_max_purchase_quantity(),
+ 'min_value' => '0',
+ 'product_name' => $_product->get_name(),
+ ), $_product, false );
+ }
- echo apply_filters( 'woocommerce_cart_item_quantity', $product_quantity, $cart_item_key, $cart_item );
- ?>
- |
+ echo apply_filters( 'woocommerce_cart_item_quantity', $product_quantity, $cart_item_key, $cart_item );
+ ?>
-
+
-
+
@@ -156,12 +152,12 @@ do_action( 'woocommerce_before_cart' ); ?>
diff --git a/woocommerce/cart/mini-cart.php b/woocommerce/cart/mini-cart.php
index 4134062..1dc5561 100644
--- a/woocommerce/cart/mini-cart.php
+++ b/woocommerce/cart/mini-cart.php
@@ -15,7 +15,7 @@
* @see https://docs.woocommerce.com/document/template-structure/
* @author WooThemes
* @package WooCommerce/Templates
- * @version 3.3.2
+ * @version 3.3.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
@@ -43,7 +43,7 @@ do_action( 'woocommerce_before_mini_cart' ); ?>
×',
- esc_url( WC()->cart->get_remove_url( $cart_item_key ) ),
+ esc_url( wc_get_cart_remove_url( $cart_item_key ) ),
__( 'Remove this item', 'understrap' ),
esc_attr( $product_id ),
esc_attr( $cart_item_key ),
@@ -57,7 +57,7 @@ do_action( 'woocommerce_before_mini_cart' ); ?>
- cart->get_item_data( $cart_item ); ?>
+
' . sprintf( '%s × %s', $cart_item['quantity'], $product_price ) . '', $cart_item, $cart_item_key ); ?>
diff --git a/woocommerce/cart/proceed-to-checkout-button.php b/woocommerce/cart/proceed-to-checkout-button.php
index 510437c..344bf7d 100644
--- a/woocommerce/cart/proceed-to-checkout-button.php
+++ b/woocommerce/cart/proceed-to-checkout-button.php
@@ -15,14 +15,14 @@
* @see https://docs.woocommerce.com/document/template-structure/
* @author WooThemes
* @package WooCommerce/Templates
- * @version 3.3.2
+ * @version 2.4.0
*/
if ( ! defined( 'ABSPATH' ) ) {
- exit; // Exit if accessed directly
+ exit; // Exit if accessed directly.
}
?>
-
-
+
+
diff --git a/woocommerce/checkout/form-checkout.php b/woocommerce/checkout/form-checkout.php
index 80a9608..7081da9 100644
--- a/woocommerce/checkout/form-checkout.php
+++ b/woocommerce/checkout/form-checkout.php
@@ -13,7 +13,7 @@
* @see https://docs.woocommerce.com/document/template-structure/
* @author WooThemes
* @package WooCommerce/Templates
- * @version 3.3.2
+ * @version 2.3.0
*/
if ( ! defined( 'ABSPATH' ) ) {
@@ -24,8 +24,8 @@ wc_print_notices();
do_action( 'woocommerce_before_checkout_form', $checkout );
-// If checkout registration is disabled and not logged in, the user cannot checkout.
-if ( ! $checkout->enable_signup && ! $checkout->enable_guest_checkout && ! is_user_logged_in() ) {
+// If checkout registration is disabled and not logged in, the user cannot checkout
+if ( ! $checkout->is_registration_enabled() && $checkout->is_registration_required() && ! is_user_logged_in() ) {
echo apply_filters( 'woocommerce_checkout_must_be_logged_in_message', __( 'You must be logged in to checkout.', 'understrap' ) );
return;
}
@@ -34,7 +34,7 @@ if ( ! $checkout->enable_signup && ! $checkout->enable_guest_checkout && ! is_us
|