PluginProbe
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler / 1.6.6
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler v1.6.6
1.6.6 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 All 49 releases
← All changes | app/Hooks/Handlers/MenuHandler.php +35 -4 1.5.3 → 1.6.6 View file →
@@ -19,8 +19,10 @@
19 19 use FluentCart\App\Models\AttributeTerm;
20 20 use FluentCart\App\Models\AttributeGroup;
21 21 use FluentCart\App\Models\ShippingMethod;
22 22 use FluentCart\App\Modules\Tax\TaxModule;
23 +use FluentCart\App\Modules\FluentPlayer\FluentPlayerBridge;
24 +use FluentCart\App\Modules\AdminFooter\AdminFooter;
23 25 use FluentCart\App\Helpers\CurrenciesHelper;
24 26 use FluentCart\App\Services\Filter\TaxFilter;
25 27 use FluentCart\App\Services\Filter\OrderFilter;
26 28 use FluentCart\App\Services\Filter\LicenseFilter;
@@ -26,9 +28,15 @@
26 28 use FluentCart\App\Services\Filter\LicenseFilter;
27 29 use FluentCart\App\Services\Filter\LicenseSiteFilter;
28 30 use FluentCart\App\Services\Filter\ProductFilter;
29 31 use FluentCart\App\Services\Filter\CustomerFilter;
32 +use FluentCart\App\Services\Filter\CouponFilter;
33 +use FluentCart\App\Services\Filter\LogFilter;
34 +use FluentCart\App\Services\Filter\OrderBumpFilter;
35 +use FluentCart\App\Modules\Shipping\Services\Filter\ShippingClassFilter;
36 +use FluentCart\App\Modules\Shipping\Services\Filter\ShippingZoneFilter;
30 37 use FluentCart\App\Modules\Integrations\AddOnModule;
38 +use FluentCart\App\Services\DateTime\DayjsFormatter;
31 39 use FluentCart\App\Services\Translations\TransStrings;
32 40 use FluentCart\App\Services\Permission\PermissionManager;
33 41 use FluentCart\Database\DataBackfills;
34 42 use FluentCart\App\Modules\PaymentMethods\Core\GatewayManager;
@@ -44,8 +52,9 @@
44 52
45 53 if ($page == 'fluent-cart') {
46 54
47 55 \FluentCart\App\Events\FirstTimePluginActivation::handle();
56 + (new AdminFooter())->register();
48 57 add_action('admin_enqueue_scripts', function () {
49 58 Vite::enqueueStyle('fluent_cart_admin_app_css',
50 59 'styles/tailwind/style.css',
51 60 );
@@ -439,9 +448,10 @@
439 448
440 449 do_action('fluent_cart/loading_app', $app);
441 450
442 451 //This should be done before enqueueing the global script.
443 - Vite::enqueueScript($slug . '_admin_app_start', 'admin/bootstrap/app.js', [$slug . '_global_admin_hooks']);
452 + // wp-i18n backs the admin translator (resources/admin/utils/translator/Translator.js).
453 + Vite::enqueueScript($slug . '_admin_app_start', 'admin/bootstrap/app.js', [$slug . '_global_admin_hooks', 'wp-i18n']);
444 454
445 455 //Don't register this script using vite.
446 456 if (!wp_script_is('wp-hooks', 'registered')) {
447 457 $suffix = (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) ? '' : '.min';
@@ -483,10 +493,30 @@
483 493 'license_sites' => ['filters' => Arr::get($filterOptions, 'license_site_filter_options', [])],
484 494 'taxes_table' => ['filters' => Arr::get($filterOptions, 'tax_filter_options', [])],
485 495 'subscriptions' => ['filters' => Arr::get($filterOptions, 'subscription_filter_options', [])],
486 496 'shipping_zone_table' => ['filters' => Arr::get($filterOptions, 'shipping_zone_filter_options', [])],
497 + // The Order Sources report filters orders, so its advanced-filter UI
498 + // reuses the Orders filter vocabulary rather than defining its own.
499 + 'source_report' => ['filters' => Arr::get($filterOptions, 'order_filter_options', [])],
487 500 ];
488 501
502 + // Tables that declare sort options on their filter class but carry no
503 + // filter-options entry above: the Sort popover still needs them, and
504 + // they are what `fluent_cart/{filterName}_table_sorts` feeds.
505 + $sortOnlyTables = [
506 + 'coupon_table' => CouponFilter::class,
507 + 'log_table' => LogFilter::class,
508 + 'order_bump_table' => OrderBumpFilter::class,
509 + 'shipping_class_table' => ShippingClassFilter::class,
510 + 'shipping_zone_table' => ShippingZoneFilter::class,
511 + ];
512 +
513 + foreach ($sortOnlyTables as $tableName => $filterClass) {
514 + if (empty($tableConfig[$tableName]['filters']['sorts'])) {
515 + $tableConfig[$tableName]['filters']['sorts'] = call_user_func([$filterClass, 'getSortOptions']);
516 + }
517 + }
518 +
489 519 $tableConfig = apply_filters('fluent_cart/admin_table_saved_views', $tableConfig, [
490 520 'filterOptions' => $filterOptions
491 521 ]);
492 522
@@ -497,8 +527,9 @@
497 527 $appConfig['version'] = FLUENTCART_VERSION;
498 528 $appConfig['permissions'] = PermissionManager::getUserPermissions();
499 529 $appConfig['isProActive'] = App::isProActive();
500 530 $appConfig['proVersion'] = defined('FLUENTCART_PRO_PLUGIN_VERSION') ? FLUENTCART_PRO_PLUGIN_VERSION : null;
531 + $appConfig['fluentPlayer'] = FluentPlayerBridge::adminAppConfig();
501 532
502 533 $appConfig['logos'] = [
503 534 'dark' => Vite::getAssetUrl('images/logo/logo-full-dark.svg'),
504 535 'light' => Vite::getAssetUrl('images/logo/logo-full.svg'),
@@ -503,9 +534,9 @@
503 534 'dark' => Vite::getAssetUrl('images/logo/logo-full-dark.svg'),
504 535 'light' => Vite::getAssetUrl('images/logo/logo-full.svg'),
505 536 ];
506 537 $appConfig['isModuleTabEnabled'] = $settings->isModuleTabEnabled();
507 - $appConfig['upgrade_url'] = 'https://fluentcart.com/pricing/';
538 + $appConfig['upgrade_url'] = Helper::getUpgradeUrl();
508 539
509 540 $max_upload_size = wp_max_upload_size(); // Returns size in bytes
510 541 $adminLocalizeData = apply_filters('fluent_cart/admin_app_data', [
511 542 'app_config' => $appConfig,
@@ -510,8 +541,9 @@
510 541 $adminLocalizeData = apply_filters('fluent_cart/admin_app_data', [
511 542 'app_config' => $appConfig,
512 543 'slug' => $app->config->get('app.slug'),
513 544 'admin_url' => admin_url('admin.php?page=fluent-cart#/'),
545 + 'wp_admin_url' => rtrim(admin_url(), '/'),
514 546 'frontend_url' => URL::getFrontEndUrl(''),
515 547 'nonce' => wp_create_nonce($slug),
516 548 'rest' => $restVars,
517 549 'brand_logo' => $this->getMenuIcon(),
@@ -536,9 +568,8 @@
536 568 'order_statues' => Status::getOrderStatuses(),
537 569 'editable_order_statues' => Status::getEditableOrderStatuses(),
538 570 'editable_customer_statues' => Status::getEditableCustomerStatuses(),
539 571 'shipping_statuses' => Status::getShippingStatuses(),
540 - 'allow_bulk_payment_status_change' => true,
541 572 // Attribute library powering the Advanced Variation feature.
542 573 'variation_attributes' => AttributeGroup::with(['terms'])->get(),
543 574 'variation_terms' => AttributeTerm::query()->get()->keyBy('id'),
544 575 'product_image_base_uri' => Helper::getProductImageBaseUri(),
@@ -568,9 +599,9 @@
568 599 // POSTs data-backfills/run until done; endpoint requires manage_options
569 600 'has_data_migrations' => $hasDataMigrations,
570 601 'subscription_intervals' => Helper::getAvailableSubscriptionIntervalOptions(),
571 602
572 - 'datei18' => TransStrings::dateTimeStrings(),
603 + 'datei18' => DayjsFormatter::localizedStrings(),
573 604 'el_strings' => TransStrings::elStrings(),
574 605 'wp_locale' => get_locale(),
575 606 'is_full_name_required' => CheckoutFieldsSchema::isFullNameRequired(),
576 607 'business_details' => [