order_item resource

This commit is contained in:
merdan 2023-01-10 21:38:04 +05:00
parent 371daaf6c0
commit 082c26633f
4 changed files with 18 additions and 5 deletions

View File

@ -102,7 +102,7 @@ class OrderResource extends JsonResource
$methodObject = new $methodClass;
return $methodObject->estimatedDelivery();
return $methodObject->estimatedDelivery($this->created_at);
}
}

View File

@ -26,5 +26,18 @@ return [
'delivery_day_max' => '25',
'outlet_delivery' => '2',
'class' => 'Sarga\Admin\Shipment\Courier',
],
'fly' => [
'code' => 'fly',
'title' => 'Flight',
'description' => 'Flight Shipping',
'active' => false,
'is_calculate_tax' => false,
'weight_price' => '20',
'delivery_day_min' => '20',
'delivery_day_max' => '25',
'outlet_delivery' => '2',
'class' => 'Sarga\Admin\Shipment\Courier',
]
];

View File

@ -62,7 +62,7 @@ class Courier extends AbstractShipping
return $cartShippingRate;
}
public function estimatedDelivery(){
return Carbon::today()->addDays($this->getConfigData('delivery_day_max'))->format('d.m.Y');
public function estimatedDelivery($date){
return $date->addDays($this->getConfigData('delivery_day_max'))->format('d.m.Y');
}
}

View File

@ -62,7 +62,7 @@ class Pickup extends AbstractShipping
return $cartShippingRate;
}
public function estimatedDelivery(){
return Carbon::today()->addDays($this->getConfigData('delivery_day_max'))->format('d.m.Y');
public function estimatedDelivery($date){
return $date->addDays($this->getConfigData('delivery_day_max'))->format('d.m.Y');
}
}