Skip to content

Commit f77b709

Browse files
committed
commit
1 parent f7b59fc commit f77b709

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

app/base/traits/CommercePageTrait.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@
1919
use App\Base\Models\Cart;
2020
use App\Base\Models\Order;
2121
use Degami\Basics\Exceptions\BasicException;
22-
use Degami\PHPFormsApi as FAPI;
23-
use DI\DependencyException;
24-
use DI\NotFoundException;
2522
use Symfony\Component\HttpFoundation\Response;
2623
use App\Base\Models\UserSession;
2724
use App\Base\Models\Address;

app/site/graphql/Resolvers/Cart.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,17 @@
2020
use App\Base\Models\CartItem;
2121
use App\Base\Models\CartDiscount;
2222
use App\Base\Models\Website;
23-
use App\Base\Traits\CommercePageTrait;
2423

2524
class Cart implements ResolverInterface
2625
{
2726
public static function resolve(array $args, mixed $source = null): mixed
2827
{
2928
$app = App::getInstance();
3029

30+
if (!$app->getEnv('ENABLE_COMMERCE', false)) {
31+
return null;
32+
}
33+
3134
$currentUser = $app->getAuth()->getCurrentUser();
3235
if (!$currentUser || !$currentUser->getId()) {
3336
return null; // or throw an exception if needed

app/site/graphql/Resolvers/Product.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515

1616
use App\App;
1717
use App\Base\Interfaces\GraphQl\ResolverInterface;
18-
use App\Base\Models\User;
19-
use App\Base\Models\Website;
2018

2119
class Product implements ResolverInterface
2220
{

0 commit comments

Comments
 (0)