Feature: Minor Updates to Order Shipping And Order Statuses
This commit is contained in:
@@ -18,11 +18,41 @@ class ShippingMethodResourceExtension extends ResourceExtension
|
||||
{
|
||||
public function extendForm(Schema $schema): Schema
|
||||
{
|
||||
return $schema->components(
|
||||
$this->replaceChargeByField(
|
||||
return $schema->components([
|
||||
...$this->replaceChargeByField(
|
||||
$this->replaceDriverField($schema->getComponents())
|
||||
)
|
||||
);
|
||||
),
|
||||
$this->fulfillmentTypeSelect(),
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* ShippingMethod.data['fulfillment_type'] — 'carrier' (default) or
|
||||
* 'store_pickup'. Same free-form-`data`-column pattern as charge_by
|
||||
* above, not a migrated column: ShippingMethod is a vendor
|
||||
* (lunarphp/table-rate-shipping) table, and this codebase avoids
|
||||
* forking vendor migrations for a merchant-configurable extra (see
|
||||
* PaymentMethod.data.fee for the same convention on a different
|
||||
* vendor-adjacent model).
|
||||
*
|
||||
* What this actually gates: Modules\Core\Shipping\Extensions\
|
||||
* OrderViewExtension's "Create Shipment" action only makes sense for
|
||||
* a 'carrier' method (it books a real carrier voucher) — a
|
||||
* 'store_pickup' order instead moves through Order.status
|
||||
* 'ready-for-pickup' -> a staff "Mark Picked Up" action, no shipment
|
||||
* ever created. See docs/checkout.md for the full status-flow design.
|
||||
*/
|
||||
private function fulfillmentTypeSelect(): Select
|
||||
{
|
||||
return Select::make('data.fulfillment_type')
|
||||
->label('Fulfillment type')
|
||||
->options([
|
||||
'carrier' => 'Carrier delivery',
|
||||
'store_pickup' => 'Collect in store',
|
||||
])
|
||||
->default('carrier')
|
||||
->required()
|
||||
->helperText('Whether an order using this method is handed to a carrier, or collected by the customer in person.');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user