From 7112e3265de774ccd7decb3ed2c1c73908288dee Mon Sep 17 00:00:00 2001
From: SofianeLasri <alasri250@gmail.com>
Date: Fri, 14 Jan 2022 17:16:11 +0100
Subject: [PATCH] bugfix

---
 core/classes/Shop.php | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/core/classes/Shop.php b/core/classes/Shop.php
index 2007a800..1107786c 100644
--- a/core/classes/Shop.php
+++ b/core/classes/Shop.php
@@ -3,17 +3,24 @@ class Shop{
     public static function getAllProducts(){
         $itemConfig = Connexion::pdo()->query("SELECT itemConfig FROM qs_shops")->fetchColumn();
         $items = yaml_parse($itemConfig);
+
+        /*
+        item:
+            ==: org.bukkit.inventory.ItemStack
+            v: 2865
+            type: WHEAT
+        */
         
         $return = array();
         foreach($items as $item){
             $itemAleadyEntered = false;
             foreach($return as $checkItem){
-                if($item == $checkItem->getId()){
+                if($item->item->type == $checkItem->getId()){
                     $itemAleadyEntered = true;
                 }
             }
             if(!$itemAleadyEntered){
-                $return[] = new Item($item);
+                $return[] = new Item($item->item->type);
             }
         }
         return $return;
-- 
GitLab