diff --git a/core/classes/Item.php b/core/classes/Item.php index 5f31d2831dc76f0aa9a2da96695f94f24a72f244..31baac6848dc5f14ea708d52c21438571b3d0d61 100644 --- a/core/classes/Item.php +++ b/core/classes/Item.php @@ -1,6 +1,6 @@ <?php class Item{ - private $name; + private $label; private $price; private $css; private $type; @@ -13,15 +13,15 @@ public function __construct($item){ }else{ $this->id=$item; } - $query = Connexion::pdo()->prepare("SELECT * FROM site_itemsAssoc WHERE name=?"); + $query = Connexion::pdo()->prepare("SELECT * FROM site_itemsAssoc WHERE label=?"); $query->execute(array($this->id)); $result= $query->fetch(PDO::FETCH_ASSOC); - $this->name = $result['name']; + $this->label = $result['label']; $this->css = $result['css']; } - public function getName(){ - return $this->name; + public function getLabel(){ + return $this->label; } public function getPrice(){ diff --git a/core/classes/Shop.php b/core/classes/Shop.php index bf3f262a67d74769265bed9565052e1d2f6b30ff..2443376cda9f9342343a2affecb24d28d6764484 100644 --- a/core/classes/Shop.php +++ b/core/classes/Shop.php @@ -13,7 +13,6 @@ public static function getAllProducts(){ $return = array(); foreach($itemsConfig as $itemConfig){ $item = yaml_parse($itemConfig['itemConfig']); - print_r($items); $itemAleadyEntered = false; foreach($return as $checkItem){ diff --git a/pages/client/shops.php b/pages/client/shops.php index fb6e3a8bc461523230c05e638329fb0240f4fcdd..f0d2d6dcd67b0ccbed095f7d2ecb31d713232c88 100644 --- a/pages/client/shops.php +++ b/pages/client/shops.php @@ -35,7 +35,7 @@ <?php $items = Shop::getAllProducts(); foreach($items as $item) { - echo '<option value="'.$item->getId().'">'.$item->getName().'</option>'; + echo '<option value="'.$item->getId().'">'.$item->getLabel().'</option>'; } ?> </select>