| 1 |
<?php |
| 2 |
|
| 3 |
namespace FluentCart\App\Modules\Integrations; |
| 4 |
|
| 5 |
use FluentCart\Framework\Support\Arr; |
| 6 |
use FluentCart\App\Vite; |
| 7 |
|
| 8 |
|
| 9 |
class AddOnModule |
| 10 |
{ |
| 11 |
/** |
| 12 |
* Show the add-ons list. |
| 13 |
*/ |
| 14 |
public static function showAddOns(): array |
| 15 |
{ |
| 16 |
$addOns = apply_filters('fluent_cart/integration/order_integrations', []); |
| 17 |
|
| 18 |
return [ |
| 19 |
'addOns' => $addOns |
| 20 |
]; |
| 21 |
} |
| 22 |
|
| 23 |
public function updateAddOnsStatus($request): array |
| 24 |
{ |
| 25 |
$addons = wp_unslash(Arr::get($request, 'addons')); |
| 26 |
fluent_cart_update_option('fluent_cart_global_integrations', $addons); |
| 27 |
|
| 28 |
return [ |
| 29 |
'message' => __('Status successfully updated', 'fluent-cart') |
| 30 |
]; |
| 31 |
} |
| 32 |
|
| 33 |
|
| 34 |
public static function getPremiumAddOns(): array |
| 35 |
{ |
| 36 |
return []; |
| 37 |
} |
| 38 |
|
| 39 |
public static function getFluentCrm(): array |
| 40 |
{ |
| 41 |
return [ |
| 42 |
'fluent-crm' => [ |
| 43 |
'title' => __('Fluent CRM', 'fluent-cart'), |
| 44 |
'description' => __('Connect FluentCRM with FluentCart and subscribe a contact when a form is submitted', 'fluent-cart'), |
| 45 |
'logo' => Vite::getAssetUrl('images/integrations/fluentcrm.svg'), |
| 46 |
'enabled' => 'yes', |
| 47 |
'purchase_url' => 'https://wordpress.org/plugins/fluent-crm/', |
| 48 |
'category' => 'crm', |
| 49 |
'btnTxt' => __('Install & Activate', 'fluent-cart') |
| 50 |
] |
| 51 |
]; |
| 52 |
} |
| 53 |
|
| 54 |
// public static function isModuleEnabled($module = 'slack') |
| 55 |
// { |
| 56 |
// $globalModules = fct_get_option('fluent_cart_global_integrations'); |
| 57 |
// return $globalModules && isset($globalModules[$module]) && $globalModules[$module] == 'yes'; |
| 58 |
// } |
| 59 |
|
| 60 |
public static function getFluentSupport() |
| 61 |
{ |
| 62 |
return []; |
| 63 |
} |
| 64 |
} |
| 65 |
|