order_item resource
This commit is contained in:
parent
371daaf6c0
commit
082c26633f
|
|
@ -102,7 +102,7 @@ class OrderResource extends JsonResource
|
||||||
|
|
||||||
$methodObject = new $methodClass;
|
$methodObject = new $methodClass;
|
||||||
|
|
||||||
return $methodObject->estimatedDelivery();
|
return $methodObject->estimatedDelivery($this->created_at);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -26,5 +26,18 @@ return [
|
||||||
'delivery_day_max' => '25',
|
'delivery_day_max' => '25',
|
||||||
'outlet_delivery' => '2',
|
'outlet_delivery' => '2',
|
||||||
'class' => 'Sarga\Admin\Shipment\Courier',
|
'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',
|
||||||
]
|
]
|
||||||
];
|
];
|
||||||
|
|
|
||||||
|
|
@ -62,7 +62,7 @@ class Courier extends AbstractShipping
|
||||||
return $cartShippingRate;
|
return $cartShippingRate;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function estimatedDelivery(){
|
public function estimatedDelivery($date){
|
||||||
return Carbon::today()->addDays($this->getConfigData('delivery_day_max'))->format('d.m.Y');
|
return $date->addDays($this->getConfigData('delivery_day_max'))->format('d.m.Y');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -62,7 +62,7 @@ class Pickup extends AbstractShipping
|
||||||
return $cartShippingRate;
|
return $cartShippingRate;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function estimatedDelivery(){
|
public function estimatedDelivery($date){
|
||||||
return Carbon::today()->addDays($this->getConfigData('delivery_day_max'))->format('d.m.Y');
|
return $date->addDays($this->getConfigData('delivery_day_max'))->format('d.m.Y');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue