Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WC Ajax Mini Cart Quantity Buttons #703

Merged
merged 9 commits into from
Feb 29, 2024
13 changes: 9 additions & 4 deletions woocommerce/cart/mini-cart.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
$product_price = apply_filters('woocommerce_cart_item_price', WC()->cart->get_product_price($_product), $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);
?>
<div class="woocommerce-mini-cart-item list-group-item <?php echo esc_attr(apply_filters('woocommerce_mini_cart_item_class', 'mini_cart_item', $cart_item, $cart_item_key)); ?>">
<div class="woocommerce-mini-cart-item list-group-item <?php echo esc_attr(apply_filters('woocommerce_mini_cart_item_class', 'mini_cart_item', $cart_item, $cart_item_key)); ?>" data-bootscore_product_id="<?php echo esc_attr($product_id); ?>" data-key="<?php echo $cart_item_key; ?>">

<div class="row">

Expand All @@ -59,7 +59,7 @@
<?php endif; ?>
</div>

<div class="item-name col-7">
<div class="item-name col-6">
<?php if (empty($product_permalink)) : ?>
<?php echo $product_name; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
?>
Expand All @@ -72,12 +72,12 @@
<div class="item-quantity">
<?php echo wc_get_formatted_cart_item_data($cart_item); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
?>
<?php echo apply_filters('woocommerce_widget_cart_item_quantity', '<span class="quantity">' . sprintf('%s &times; %s', $cart_item['quantity'], $product_price) . '</span>', $cart_item, $cart_item_key); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
<?php echo apply_filters('woocommerce_widget_cart_item_quantity', '<span class="quantity">' . sprintf('<span class="qty_text">%s</span> &times; %s', $cart_item['quantity'], $product_price) . '</span>', $cart_item, $cart_item_key); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
?>
</div>
</div>

<div class="remove col-2 text-end">
<div class="remove col-3 text-end">
<?php echo apply_filters( // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
'woocommerce_cart_item_remove_link',
sprintf(
Expand All @@ -92,6 +92,11 @@
$cart_item_key
);
?>

<div class="bootscore-custom-render-total">
<?php echo $cart_item['line_total'].'.00' . get_woocommerce_currency_symbol(); ?>
</div>

</div>

</div>
Expand Down
Loading