Add variations, slider, fix cart ...
This commit is contained in:
@@ -20,7 +20,6 @@ class Categories
|
||||
{
|
||||
$categories = self::getCategoryTreeVisibles()->toArray();
|
||||
return $categories ? self::getChildren($categories[0]['children'], $withFolder) : [];
|
||||
return $categories ? self::getChildren($categories[0]['children'], $withFolder) : [];
|
||||
}
|
||||
|
||||
public static function getTree($withFolder = false)
|
||||
@@ -111,7 +110,7 @@ class Categories
|
||||
|
||||
public static function getModel()
|
||||
{
|
||||
// return Category::class;
|
||||
return app('rinvex.categories.category');
|
||||
return app(Category::class);
|
||||
// return app('rinvex.categories.category');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
namespace App\Repositories\Core\User;
|
||||
|
||||
use App\Repositories\Core\Auth\Users;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use \Cart;
|
||||
|
||||
class ShopCart
|
||||
@@ -19,9 +20,8 @@ class ShopCart
|
||||
|
||||
public static function clear()
|
||||
{
|
||||
Cart::session(1)->clear();
|
||||
return Cart::clear();
|
||||
// return self::get()->clear();
|
||||
Cart::clear();
|
||||
return Cart::session(Auth::id())->clear();
|
||||
}
|
||||
|
||||
public static function has($id)
|
||||
|
||||
@@ -16,11 +16,11 @@ class ShopCartStorage
|
||||
|
||||
public function get($key)
|
||||
{
|
||||
if ($this->has($key)) {
|
||||
return new CartCollection(CartStorage::find($key)->cart_data);
|
||||
} else {
|
||||
if (!$this->has($key)) {
|
||||
return [];
|
||||
}
|
||||
return new CartCollection(CartStorage::find($key)->cart_data);
|
||||
|
||||
}
|
||||
|
||||
public function put($key, $value)
|
||||
|
||||
Reference in New Issue
Block a user