PluginProbe
Fluent Booking – The Ultimate Appointments Scheduling, Events Booking, Events Calendar Solution / 2.5.0
Fluent Booking – The Ultimate Appointments Scheduling, Events Booking, Events Calendar Solution v2.5.0
2.5.0 2.4.0 2.3.0 2.2.5 2.2.0 2.1.2 2.1.1 trunk 1.10.0 1.10.01 1.10.02 1.5.0 1.5.01 1.5.02 1.5.1 1.5.10 1.5.20 1.5.21 1.5.22 1.5.23 1.5.24 1.5.25 1.6.0 1.7.0 1.7.1 All 34 releases
← All changes | app/Services/Integrations/FluentCart/CartHelper.php +8 -4 1.10.01 → 2.5.0 View file →
@@ -11,9 +11,9 @@
11 11 public static function getProduct($productId)
12 12 {
13 13 return CartProductVariant::where('id', $productId)
14 14 ->whereHas('product', function ($query) {
15 - $query->where('post_status', 'publish');
15 + $query->whereIn('post_status', ['publish', 'private']);
16 16 })
17 17 ->first();
18 18 }
19 19
@@ -73,9 +73,9 @@
73 73 {
74 74 return \FluentCart\App\Vite::getAssetUrl('images/placeholder.svg');
75 75 }
76 76
77 - public static function getCartProductPrice($paymentSettings, $defaultDuration)
77 + public static function getCartProductPrice($paymentSettings, $defaultDuration, $formatted = true)
78 78 {
79 79 $productId = $paymentSettings['cart_product_id'];
80 80
81 81 if (Arr::get($paymentSettings, 'multi_payment_enabled') == 'yes') {
@@ -84,9 +84,13 @@
84 84
85 85 $price = '';
86 86 $product = self::getProduct($productId);
87 87 if ($product) {
88 - $price = $product->formatted_total;
88 + if ($formatted) {
89 + $price = $product->formatted_total;
90 + } else {
91 + $price = floatval($product->item_price / 100) ?? 0;
92 + }
89 93 }
90 94
91 95 return $price;
92 96 }
@@ -99,9 +103,9 @@
99 103 }
100 104
101 105 $products = CartProductVariant::whereIn('id', array_values($productIds))
102 106 ->whereHas('product', function ($query) {
103 - $query->where('post_status', 'publish');
107 + $query->whereIn('post_status', ['publish', 'private']);
104 108 })
105 109 ->get()
106 110 ->keyBy('id');
107 111