Hotfix: Correcting Wrong Position on Checkout, Correcting Cart Display Pages
This commit is contained in:
@@ -35,20 +35,21 @@ class ListCarts extends ListRecords
|
|||||||
public function getTabs(): array
|
public function getTabs(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'ongoing' => Tab::make('Ongoing')
|
|
||||||
->modifyQueryUsing(fn (Builder $query) => $query->active()->where('updated_at', '>', CartResource::abandonedCutoff())),
|
|
||||||
'abandoned_cart' => Tab::make('Abandoned Cart')
|
'abandoned_cart' => Tab::make('Abandoned Cart')
|
||||||
->modifyQueryUsing(fn (Builder $query) => $query
|
->modifyQueryUsing(fn(Builder $query) => $query
|
||||||
->whereDoesntHave('orders')
|
->whereDoesntHave('orders')
|
||||||
->where('updated_at', '<=', CartResource::abandonedCutoff())),
|
->where('updated_at', '<=', CartResource::abandonedCutoff())),
|
||||||
'abandoned_checkout' => Tab::make('Abandoned Checkout')
|
'abandoned_checkout' => Tab::make('Abandoned Checkout')
|
||||||
->modifyQueryUsing(fn (Builder $query) => $query
|
->modifyQueryUsing(fn(Builder $query) => $query
|
||||||
->whereHas('orders', fn (Builder $query) => $query->whereNull('placed_at'))
|
->whereHas('orders', fn(Builder $query) => $query->whereNull('placed_at'))
|
||||||
->where('updated_at', '<=', CartResource::abandonedCutoff())),
|
->where('updated_at', '<=', CartResource::abandonedCutoff())),
|
||||||
|
|
||||||
|
'ongoing' => Tab::make('Ongoing')
|
||||||
|
->modifyQueryUsing(fn(Builder $query) => $query->active()->where('updated_at', '>', CartResource::abandonedCutoff())),
|
||||||
'completed' => Tab::make('Completed')
|
'completed' => Tab::make('Completed')
|
||||||
->modifyQueryUsing(fn (Builder $query) => $query->whereHas(
|
->modifyQueryUsing(fn(Builder $query) => $query->whereHas(
|
||||||
'orders',
|
'orders',
|
||||||
fn (Builder $query) => $query->whereNotNull('placed_at'),
|
fn(Builder $query) => $query->whereNotNull('placed_at'),
|
||||||
)),
|
)),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,7 +50,6 @@ class CorePlugin implements Plugin
|
|||||||
CartResource::class,
|
CartResource::class,
|
||||||
])
|
])
|
||||||
->plugin(ShippingPlugin::make())
|
->plugin(ShippingPlugin::make())
|
||||||
->plugin(ShippingPlugin::make())
|
|
||||||
->pages([ManagePickupManifests::class]);
|
->pages([ManagePickupManifests::class]);
|
||||||
|
|
||||||
LunarPanel::extensions([
|
LunarPanel::extensions([
|
||||||
|
|||||||
@@ -25,6 +25,23 @@ class ManagePickupManifests extends Page implements HasTable
|
|||||||
|
|
||||||
protected static ?string $navigationLabel = 'Pickup Manifests';
|
protected static ?string $navigationLabel = 'Pickup Manifests';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Without an explicit group, this page had no navigation group at all —
|
||||||
|
* Filament's Panel::getUrl() falls back to "first item in the first
|
||||||
|
* navigation group" when no homeUrl is set (neither Lunar nor CorePlugin
|
||||||
|
* sets one), and an ungrouped page sorted ahead of every one of Lunar's
|
||||||
|
* own grouped resources (Sales, Catalog, etc.), making this page the
|
||||||
|
* panel's de facto home instead of the real Dashboard. Grouping it under
|
||||||
|
* Sales — alongside CartResource, OrderResource — fixes that by letting
|
||||||
|
* a legitimate item sort first again. Sorted last within the group
|
||||||
|
* deliberately (a high explicit navigationSort — Lunar's own
|
||||||
|
* OrderResource uses 1) so this page never competes to be first even as
|
||||||
|
* more Sales-group items are added later.
|
||||||
|
*/
|
||||||
|
protected static ?string $navigationGroup = 'Sales';
|
||||||
|
|
||||||
|
protected static ?int $navigationSort = 100;
|
||||||
|
|
||||||
protected static string $view = 'core::shipping.filament.pages.manage-pickup-manifests';
|
protected static string $view = 'core::shipping.filament.pages.manage-pickup-manifests';
|
||||||
|
|
||||||
public function table(Table $table): Table
|
public function table(Table $table): Table
|
||||||
|
|||||||
Reference in New Issue
Block a user