Add variations, slider, fix cart ...

This commit is contained in:
Ludovic CANDELLIER
2022-03-21 21:52:12 +01:00
parent d9dba1c515
commit 36a63f3b14
27 changed files with 438 additions and 81 deletions

View File

@@ -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');
}
}

View File

@@ -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)

View File

@@ -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)