PluginProbe
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler / 1.6.4
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler v1.6.4
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 1.2.0 All 47 releases
fluent-cart / app / Modules / Integrations / FluentPlugins / FluentSupportWidget.php

FluentSupportWidget.php in FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler 1.6.4, at app/Modules/Integrations/FluentPlugins/FluentSupportWidget.php

59 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace FluentCart\App\Modules\Integrations\FluentPlugins;
3
4 use FluentCart\App\Helpers\Helper;
5 use FluentCart\App\Models\Customer;
6 use FluentCart\App\Models\Order;
7 use FluentCart\App\Services\URL;
8
9 class FluentSupportWidget
10 {
11 public function register()
12 {
13 add_filter('fluent_support/customer_extra_widgets', array($this, 'getPurchaseWidgets'), 10, 2);
14 }
15
16 public function getPurchaseWidgets($widgets, $customer)
17 {
18
19 $customer = Customer::query()->where('email', $customer->email)->first();
20
21 if (!$customer) {
22 return $widgets;
23 }
24
25 $html = (new FluentCRMDeepIntegration())->getStatsHtml($customer);
26
27 if($html) {
28 $css = 'ul.fc_full_listed {
29 border-radius: 4px;
30 list-style: none;
31 margin: 0;
32 padding: 0;
33 }
34
35 ul.fc_full_listed li {
36 border-bottom: 1px solid #ebeef4;
37 display: block;
38 margin: 0;
39 padding: 5px 0;
40 }
41
42 ul.fc_full_listed>li span.fc_list_sub {
43 font-weight: 500;
44 }
45 ul.fc_full_listed>li span.fc_list_value {
46 float: right;
47 }';
48
49 $html .= '<style>'.$css.'</style>';
50 }
51
52 $widgets['fluent_cart_purchases'] = [
53 'header' => __('Purchases', 'fluent-cart'),
54 'body_html' => $html,
55 ];
56 return $widgets;
57 }
58 }
59