PluginProbe
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler / 1.6.5
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler v1.6.5
1.6.5 1.6.4 1.6.3 1.6.2 1.6.1 1.6.0 1.5.4 1.5.5 1.5.3 1.5.2 1.5.1 1.5.0 1.4.2 1.4.1 1.4.0 1.3.28 1.3.27 1.3.26 1.3.25 1.3.23 1.3.22 1.3.21 1.3.20 1.3.19 trunk All 48 releases
← All changes | app/Services/Renderer/MiniCartRenderer.php +6 -6 1.3.21 → 1.6.5 View file →
@@ -9,16 +9,15 @@
9 9 class MiniCartRenderer
10 10 {
11 11 protected $cartItems;
12 12 protected $itemCount = 0;
13 + protected $countMode = 'distinct_products';
13 14
14 15 public function __construct($cartItems, $config = [])
15 16 {
16 -
17 17 $this->cartItems = $cartItems;
18 18 $this->itemCount = Arr::get($config, 'item_count') ?? count($this->cartItems);
19 -
20 -
19 + $this->countMode = Arr::get($config, 'count_mode', 'distinct_products');
21 20 }
22 21 public function renderMiniCart($atts = [])
23 22 {
24 23 $defaults = [
@@ -32,9 +31,9 @@
32 31 $showTotalPrice = filter_var(Arr::get($atts, 'show_total_price', true), FILTER_VALIDATE_BOOLEAN);
33 32 $iconColor = Arr::get($atts, 'icon_color', '');
34 33 $priceColor = Arr::get($atts, 'price_color', '');
35 34 $productCountColor = Arr::get($atts, 'product_count_color', '');
36 - $buttonClass = Arr::get($atts, 'button_class', '');
35 + $buttonClass = (string) Arr::get($atts, 'button_class', '');
37 36
38 37
39 38 // Build style attribute
40 39 $iconStyle = $iconColor ? 'style="color: ' . esc_attr($iconColor) . ';"' : '';
@@ -43,9 +42,9 @@
43 42
44 43 $isShortcode = Arr::get($atts, 'is_shortcode', false);
45 44 $wrapperAttributes = '';
46 45 if(!$isShortcode){
47 - $wrapperAttributes = get_block_wrapper_attributes();
46 + $wrapperAttributes = RenderHelper::getBlockWrapperAttributes();
48 47 }
49 48
50 49
51 50
@@ -65,9 +64,9 @@
65 64
66 65
67 66 ?>
68 67 <div <?php echo $wrapperAttributes; ?>>
69 - <button class="fct-mini-cart-button <?php echo $buttonClass ?>" data-fluent-cart-cart-expand-button
68 + <button class="fct-mini-cart-button <?php echo esc_attr($buttonClass); ?>" data-fluent-cart-cart-expand-button
70 69 aria-label="<?php esc_attr_e('Open Shopping Cart', 'fluent-cart'); ?>">
71 70 <span class="fct-mini-cart-wrap" <?php echo $iconStyle; ?>>
72 71 <?php $this->renderCartIcon($cartIcon); ?>
73 72
@@ -74,8 +73,9 @@
74 73 <?php if ($showBadge) : ?>
75 74 <span
76 75 class="fct-mini-cart-badge"
77 76 data-cart-badge-count
77 + data-cart-count-mode="<?php echo esc_attr($this->countMode); ?>"
78 78 <?php echo $countStyle; ?>
79 79 >
80 80 <?php
81 81 if ($this->itemCount > 0) {