2023-06-11 12:14:03 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Modules\Cart\Facades;
|
|
|
|
|
2023-12-03 14:07:47 +00:00
|
|
|
use Modules\Support\Money;
|
|
|
|
use Illuminate\Http\Request;
|
|
|
|
use Modules\Cart\CartCoupon;
|
|
|
|
use Modules\Shipping\Method;
|
|
|
|
use Modules\Coupon\Entities\Coupon;
|
|
|
|
use Modules\Cart\CartShippingMethod;
|
|
|
|
use Darryldecode\Cart\CartCollection;
|
2023-06-11 12:14:03 +00:00
|
|
|
use Illuminate\Support\Facades\Facade;
|
2023-12-03 14:07:47 +00:00
|
|
|
use Illuminate\Database\Eloquent\Collection;
|
|
|
|
use Darryldecode\Cart\CartConditionCollection;
|
|
|
|
use Illuminate\Support\Collection as SupportCollection;
|
2023-06-11 12:14:03 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @method static \Modules\Cart\Cart instance()
|
|
|
|
* @method static void clear()
|
2023-12-03 14:07:47 +00:00
|
|
|
* @method static void store(int $productId, int $variantId, int $qty, array $options = [], array $variations = [])
|
2023-06-11 12:14:03 +00:00
|
|
|
* @method static void updateQuantity(string $id, int $qty)
|
2023-12-03 14:07:47 +00:00
|
|
|
* @method static CartCollection items()
|
2023-06-11 12:14:03 +00:00
|
|
|
* @method static int addedQty(int $productId)
|
2023-12-03 14:07:47 +00:00
|
|
|
* @method static crossSellProducts()
|
|
|
|
* @method static Collection getAllProducts()
|
2023-06-11 12:14:03 +00:00
|
|
|
* @method static void reduceStock()
|
|
|
|
* @method static void restoreStock()
|
|
|
|
* @method static int quantity()
|
|
|
|
* @method static bool hasAvailableShippingMethod()
|
2023-12-03 14:07:47 +00:00
|
|
|
* @method static SupportCollection availableShippingMethods()
|
2023-06-11 12:14:03 +00:00
|
|
|
* @method static bool hasShippingMethod()
|
2023-12-03 14:07:47 +00:00
|
|
|
* @method static CartShippingMethod shippingMethod()
|
|
|
|
* @method static Money shippingCost()
|
|
|
|
* @method static Money addShippingMethod(Method $shippingMethod)
|
2023-06-11 12:14:03 +00:00
|
|
|
* @method static void removeShippingMethod()
|
|
|
|
* @method static bool hasCoupon()
|
|
|
|
* @method static bool couponAlreadyApplied()
|
2023-12-03 14:07:47 +00:00
|
|
|
* @method static CartCoupon coupon()
|
|
|
|
* @method static Money discount()
|
|
|
|
* @method static void applyCoupon(Coupon $coupon)
|
2023-06-11 12:14:03 +00:00
|
|
|
* @method static void removeCoupon()
|
|
|
|
* @method static void hasTax()
|
2023-12-03 14:07:47 +00:00
|
|
|
* @method static CartConditionCollection taxes()
|
|
|
|
* @method static Money tax()
|
|
|
|
* @method static void addTaxes(Request $request)
|
2023-06-11 12:14:03 +00:00
|
|
|
* @method static void removeTaxes()
|
2023-12-03 14:07:47 +00:00
|
|
|
* @method static Money subTotal()
|
|
|
|
* @method static Money total()
|
2023-06-11 12:14:03 +00:00
|
|
|
* @method static array toArray()
|
|
|
|
* @method static array jsonSerialize()
|
2023-12-03 14:07:47 +00:00
|
|
|
* @method static bool remove(string $cartItemId)
|
|
|
|
* @method static bool allItemsAreVirtual()
|
2023-06-11 12:14:03 +00:00
|
|
|
*
|
|
|
|
* @see \Modules\Cart\Cart
|
|
|
|
*/
|
|
|
|
class Cart extends Facade
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Get the registered name of the component.
|
|
|
|
*
|
|
|
|
* @return string
|
|
|
|
*/
|
2023-12-03 14:07:47 +00:00
|
|
|
protected static function getFacadeAccessor(): string
|
2023-06-11 12:14:03 +00:00
|
|
|
{
|
|
|
|
return \Modules\Cart\Cart::class;
|
|
|
|
}
|
|
|
|
}
|