public function updateinventoryquantityAction() { $inventory = $this->request->getParam('quantity'); foreach ($inventory as $key => $value) { DatabaseObject_Helper_ManageInventory::updateInventoryQuantity($this->db, 'product_inventories', $key, $this->signedInUserSessionInfoHolder->generalInfo->userID, $value); } $this->messenger->addMessage('Inventory quantities had been updated'); $this->_redirect($_SERVER['HTTP_REFERER']); //Zend_Debug::dump($inventory); }
public function retrieveCompareChartProductsForDisplay($db, $compareChart) { $products = array(); if (isset($compareChart['products']) && count($compareChart['products']) > 0) { $select = $db->select(); $select->from(array('p' => 'products'), '*'); $select->where('product_id IN (?)', $compareChart['products']); $select->order('last_status_change DESC'); $select->where("p.status='Listed'"); $select->join(array('u' => 'users'), 'u.userID=p.uploader_id'); $tempProduct = $db->fetchAll($select); foreach ($tempProduct as $k => $value) { $products[] = $value; } } if (isset($compareChart['inventory']) && count($compareChart['inventory']) > 0) { $select2 = $db->select(); $select2->from(array('p' => 'products'), '*')->join(array('i' => 'product_inventories'), 'p.product_id = i.product_id')->order('last_status_change DESC')->where('i.product_inventory_id in (?)', $compareChart['inventory'])->where("p.status='Listed'"); $select2->join(array('u' => 'users'), 'u.userID=p.uploader_id'); $tempInventory = $db->fetchAll($select2); foreach ($tempInventory as $k => $value) { $products[] = $value; } } foreach ($products as $k => $value) { if ($value['purchase_type'] == 'Buy_now' && isset($value['product_inventory_id'])) { $tempProduct = DatabaseObject_Helper_ManageInventory::loadBasicInventory($db, $value['product_id']); foreach ($tempProduct[0] as $KEY => $VALUE) { $products[$k][$KEY] = $VALUE; } $products[$k]['inventoryProfile'] = DatabaseObject_Helper_ManageInventory::loadInventoryProfileDetail($db, 'product_inventory_profile', $value['product_inventory_id']); $products[$k]['inventoryImages'] = DatabaseObject_Helper_ImageUpload::loadImagesForItem($db, 'product_inventory_images', $value['product_inventory_id']); } $select2 = $db->select(); $select2->from(array('images' => 'product_images'), '*')->where('images.Product_id = ?', $value['product_id']); //echo $select2; $products[$k]['images'] = $db->fetchAll($select2); if (isset($value['product_inventory_id']) && $value['purchase_type'] == 'Customizable') { $products[$k]['inventoryProfile'] = DatabaseObject_Helper_ManageInventory::loadInventoryProfileDetail($db, 'product_inventory_profile', $value['product_inventory_id']); $products[$k]['inventoryImages'] = DatabaseObject_Helper_ImageUpload::loadImagesForItem($db, 'product_inventory_images', $value['product_inventory_id']); } } return $products; }