Fix: Resolving box now by instance, not by type. Also, fixing bug where missing shipping driver would break checkout

This commit is contained in:
arvanitakis committed 2026-09-30 17:48:59 +03:00
1 parent cd3245df7b
commit dbea4a8d69
11 files changed
+126 -11

No files matched your search

+11
View File
@@ -2,7 +2,9 @@
namespace Modules\Core\Shipping\Support;
use Lunar\Models\Contracts\Cart as CartContract;
use Lunar\Shipping\Managers\ShippingManager as VendorShippingManager;
use Lunar\Shipping\Resolvers\ShippingRateResolver;
/**
* Drops lunarphp/table-rate-shipping's own generic drivers (free-shipping,
@@ -28,6 +30,15 @@ use Lunar\Shipping\Managers\ShippingManager as VendorShippingManager;
*/
class ShippingManager extends VendorShippingManager
{
/**
* Rates for a cart, leaving out shipping methods whose driver is no
* longer registered (see RegisteredDriverRateResolver).
*/
public function shippingRates(?CartContract $cart = null): ShippingRateResolver
{
return new RegisteredDriverRateResolver($cart);
}
public function getSupportedDrivers(): \Illuminate\Support\Collection
{
return collect($this->customCreators)