PluginProbe
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler / 1.7.0
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler v1.7.0
1.7.0 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 All 50 releases
← All changes | app/Hooks/Handlers/MenuHandler.php +40 -4 1.5.3 → 1.7.0 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,16 @@
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\Services\Filter\ReviewFilter;
36 +use FluentCart\App\Modules\Shipping\Services\Filter\ShippingClassFilter;
37 +use FluentCart\App\Modules\Shipping\Services\Filter\ShippingZoneFilter;
30 38 use FluentCart\App\Modules\Integrations\AddOnModule;
39 +use FluentCart\App\Services\DateTime\DayjsFormatter;
31 40 use FluentCart\App\Services\Translations\TransStrings;
32 41 use FluentCart\App\Services\Permission\PermissionManager;
33 42 use FluentCart\Database\DataBackfills;
34 43 use FluentCart\App\Modules\PaymentMethods\Core\GatewayManager;
@@ -44,8 +53,9 @@
44 53
45 54 if ($page == 'fluent-cart') {
46 55
47 56 \FluentCart\App\Events\FirstTimePluginActivation::handle();
57 + (new AdminFooter())->register();
48 58 add_action('admin_enqueue_scripts', function () {
49 59 Vite::enqueueStyle('fluent_cart_admin_app_css',
50 60 'styles/tailwind/style.css',
51 61 );
@@ -79,8 +89,9 @@
79 89 $targetKeys = [
80 90 'checkout_page_id' => __('Checkout Page', 'fluent-cart'),
81 91 'cart_page_id' => __('Cart Page', 'fluent-cart'),
82 92 'receipt_page_id' => __('Receipt Page', 'fluent-cart'),
93 + 'order_review_page_id' => __('Order Review Page', 'fluent-cart'),
83 94 'shop_page_id' => __('Shop Page', 'fluent-cart'),
84 95 'customer_profile_page_id' => __('Customer Profile Page', 'fluent-cart'),
85 96 ];
86 97
@@ -439,9 +450,10 @@
439 450
440 451 do_action('fluent_cart/loading_app', $app);
441 452
442 453 //This should be done before enqueueing the global script.
443 - Vite::enqueueScript($slug . '_admin_app_start', 'admin/bootstrap/app.js', [$slug . '_global_admin_hooks']);
454 + // wp-i18n backs the admin translator (resources/admin/utils/translator/Translator.js).
455 + Vite::enqueueScript($slug . '_admin_app_start', 'admin/bootstrap/app.js', [$slug . '_global_admin_hooks', 'wp-i18n']);
444 456
445 457 //Don't register this script using vite.
446 458 if (!wp_script_is('wp-hooks', 'registered')) {
447 459 $suffix = (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) ? '' : '.min';
@@ -470,8 +482,9 @@
470 482 'product_filter_options' => ProductFilter::getTableFilterOptions(),
471 483 'license_filter_options' => LicenseFilter::getTableFilterOptions(),
472 484 'license_site_filter_options' => LicenseSiteFilter::getTableFilterOptions(),
473 485 'tax_filter_options' => TaxFilter::getTableFilterOptions(),
486 + 'review_filter_options' => ReviewFilter::getTableFilterOptions(),
474 487 ];
475 488 $filterOptions = apply_filters('fluent_cart/admin_filter_options', $filterOptions, []);
476 489
477 490 // Structured table config keyed by table name (used by Table.js base class)
@@ -483,10 +496,31 @@
483 496 'license_sites' => ['filters' => Arr::get($filterOptions, 'license_site_filter_options', [])],
484 497 'taxes_table' => ['filters' => Arr::get($filterOptions, 'tax_filter_options', [])],
485 498 'subscriptions' => ['filters' => Arr::get($filterOptions, 'subscription_filter_options', [])],
486 499 'shipping_zone_table' => ['filters' => Arr::get($filterOptions, 'shipping_zone_filter_options', [])],
500 + 'review_table' => ['filters' => Arr::get($filterOptions, 'review_filter_options', [])],
501 + // The Order Sources report filters orders, so its advanced-filter UI
502 + // reuses the Orders filter vocabulary rather than defining its own.
503 + 'source_report' => ['filters' => Arr::get($filterOptions, 'order_filter_options', [])],
487 504 ];
488 505
506 + // Tables that declare sort options on their filter class but carry no
507 + // filter-options entry above: the Sort popover still needs them, and
508 + // they are what `fluent_cart/{filterName}_table_sorts` feeds.
509 + $sortOnlyTables = [
510 + 'coupon_table' => CouponFilter::class,
511 + 'log_table' => LogFilter::class,
512 + 'order_bump_table' => OrderBumpFilter::class,
513 + 'shipping_class_table' => ShippingClassFilter::class,
514 + 'shipping_zone_table' => ShippingZoneFilter::class,
515 + ];
516 +
517 + foreach ($sortOnlyTables as $tableName => $filterClass) {
518 + if (empty($tableConfig[$tableName]['filters']['sorts'])) {
519 + $tableConfig[$tableName]['filters']['sorts'] = call_user_func([$filterClass, 'getSortOptions']);
520 + }
521 + }
522 +
489 523 $tableConfig = apply_filters('fluent_cart/admin_table_saved_views', $tableConfig, [
490 524 'filterOptions' => $filterOptions
491 525 ]);
492 526
@@ -497,8 +531,9 @@
497 531 $appConfig['version'] = FLUENTCART_VERSION;
498 532 $appConfig['permissions'] = PermissionManager::getUserPermissions();
499 533 $appConfig['isProActive'] = App::isProActive();
500 534 $appConfig['proVersion'] = defined('FLUENTCART_PRO_PLUGIN_VERSION') ? FLUENTCART_PRO_PLUGIN_VERSION : null;
535 + $appConfig['fluentPlayer'] = FluentPlayerBridge::adminAppConfig();
501 536
502 537 $appConfig['logos'] = [
503 538 'dark' => Vite::getAssetUrl('images/logo/logo-full-dark.svg'),
504 539 'light' => Vite::getAssetUrl('images/logo/logo-full.svg'),
@@ -503,9 +538,9 @@
503 538 'dark' => Vite::getAssetUrl('images/logo/logo-full-dark.svg'),
504 539 'light' => Vite::getAssetUrl('images/logo/logo-full.svg'),
505 540 ];
506 541 $appConfig['isModuleTabEnabled'] = $settings->isModuleTabEnabled();
507 - $appConfig['upgrade_url'] = 'https://fluentcart.com/pricing/';
542 + $appConfig['upgrade_url'] = Helper::getUpgradeUrl();
508 543
509 544 $max_upload_size = wp_max_upload_size(); // Returns size in bytes
510 545 $adminLocalizeData = apply_filters('fluent_cart/admin_app_data', [
511 546 'app_config' => $appConfig,
@@ -510,8 +545,9 @@
510 545 $adminLocalizeData = apply_filters('fluent_cart/admin_app_data', [
511 546 'app_config' => $appConfig,
512 547 'slug' => $app->config->get('app.slug'),
513 548 'admin_url' => admin_url('admin.php?page=fluent-cart#/'),
549 + 'wp_admin_url' => rtrim(admin_url(), '/'),
514 550 'frontend_url' => URL::getFrontEndUrl(''),
515 551 'nonce' => wp_create_nonce($slug),
516 552 'rest' => $restVars,
517 553 'brand_logo' => $this->getMenuIcon(),
@@ -536,9 +572,8 @@
536 572 'order_statues' => Status::getOrderStatuses(),
537 573 'editable_order_statues' => Status::getEditableOrderStatuses(),
538 574 'editable_customer_statues' => Status::getEditableCustomerStatuses(),
539 575 'shipping_statuses' => Status::getShippingStatuses(),
540 - 'allow_bulk_payment_status_change' => true,
541 576 // Attribute library powering the Advanced Variation feature.
542 577 'variation_attributes' => AttributeGroup::with(['terms'])->get(),
543 578 'variation_terms' => AttributeTerm::query()->get()->keyBy('id'),
544 579 'product_image_base_uri' => Helper::getProductImageBaseUri(),
@@ -561,8 +596,9 @@
561 596 'is_tax_enabled' => TaxModule::isTaxEnabled(),
562 597 'eu_vat_county_options' => TaxModule::euVatCountyOptions(),
563 598 'country_tax_titles' => TaxModule::taxTitleLists(),
564 599 'site_url' => site_url(),
600 + 'store_logo' => (new \FluentCart\Api\StoreSettings())->get('store_logo.url', ''),
565 601 'modules_settings' => ModuleSettings::getAllSettings(),
566 602 'purchase_fluent_cart_link' => 'https://fluentcart.com/',
567 603 'admin_notices' => apply_filters('fluent_cart/admin_notices', []),
568 604 // POSTs data-backfills/run until done; endpoint requires manage_options
@@ -568,9 +604,9 @@
568 604 // POSTs data-backfills/run until done; endpoint requires manage_options
569 605 'has_data_migrations' => $hasDataMigrations,
570 606 'subscription_intervals' => Helper::getAvailableSubscriptionIntervalOptions(),
571 607
572 - 'datei18' => TransStrings::dateTimeStrings(),
608 + 'datei18' => DayjsFormatter::localizedStrings(),
573 609 'el_strings' => TransStrings::elStrings(),
574 610 'wp_locale' => get_locale(),
575 611 'is_full_name_required' => CheckoutFieldsSchema::isFullNameRequired(),
576 612 'business_details' => [