public function detailsAction() { $id = $this->request->getParam('id'); $tag = $this->request->getParam('tag'); $this->view->tag = $tag; $product = new DatabaseObject_Products($this->db); $product->load($id); //Zend_Debug::dump($product); //selecting color/image attributes $selectColumnOptions = array('group' => true, 'value' => array('image_attribute_id', 'attribute_name', 'image_name', 'price_adjustment')); $attributeArray = DatabaseObject_Helper_ProductListing::getImageAttribute($this->db, $product->Username, $product->product_type, $id, $selectColumnOptions); $selectColumnOptions = array('group' => false, 'value' => array('image_attribute_id', 'attribute_name', 'image_name', 'price_adjustment')); $imageAttribute = DatabaseObject_Helper_ProductListing::getImageAttribute($this->db, $product->Username, $product->product_type, $id, $selectColumnOptions); $this->view->attributeArray = $attributeArray; $this->view->imageAttribute = $imageAttribute; include 'productConfig.php'; $this->view->productType = $productTypeConfig[$product->product_type]; //Zend_Debug::Dump($productTypeConfig[$product->product_type]); $this->view->product = $product; $shoutboxMessages = DatabaseObject_Helper_Communication::retriveShoutOutForProduct($this->db, $product->getId(), $product->product_type, 'storeSeller'); $this->view->shoutboxMessages = $shoutboxMessages; $this->view->productSellerEmail = DatabaseObject_Helper_ProductPreview::retrieveUserEmailForProduct($this->db, $product->getId(), $product->product_type, 'storeSeller'); $this->view->user = $this->userObject; }
public function purchasedetailsAction() { $id = $this->getRequest()->getParam('number'); $productType = $this->getRequest()->getParam('product'); $referral = $this->getRequest()->getParam('referral'); if (isset($referral)) { $this->view->referral = $referral; } if (in_array($productType, $this->productConfig['productDisplay']['search_table'])) { if ($productType == 'inventory') { $product = DatabaseObject_Helper_ProductDisplay::retrieveProductFromInventoryForPurchaseDetails($this->db, $id); //$this->view->currentHREF=$_SERVER['REQUEST_URI']; if (count($product) == 0) { $this->messenger->addMessage('Wrong selection'); $this->_redirect('/index/error'); } } elseif ($productType == 'products') { $product = DatabaseObject_Helper_ProductDisplay::retrieveProductFromProductsForPurchaseDetails($this->db, $id); if ($product[0]['purchase_type'] != 'Customizable' || count($product) == 0) { $this->messenger->addMessage('Wrong selection'); $this->_redirect('/index/error'); } if ($product[0]['inventory_attribute_table'] == 'shoes') { //if there are no shoe attributes, redirect $measurement = array(); $i = $product['systemColorAndShoesAttributes']['shoes'][0]['min_size']; while ($i < $product['systemColorAndShoesAttributes']['shoes'][0]['max_size'] + 0.5) { $measurement[] = $i; $i = $i + 0.5; } $this->view->measurements = $measurement; $heels = array(); foreach ($product['systemColorAndShoesAttributes']['heels'][0] as $key => $value) { if ($key != 'product_id') { if ($value == 1) { $heels[] = $this->productConfig['attribute_conversion_details']['heel_sizes'][$key]; } } } //Zend_Debug::dump($this->productConfig['attribute_conversion_details']['heel_sizes']); $this->view->heels = $heels; } } $this->view->product = $product; //echo 'here'; Zend_Debug::dump($product); if ($this->getRequest()->isXmlHttpRequest()) { $this->view->layout = 'purchasedetailsAJAX'; } else { $this->view->layout = 'purchasedetails'; } $shoutboxMessages = DatabaseObject_Helper_Communication::retriveShoutOutForProduct($this->db, $product[0]['product_id']); $this->view->shoutboxMessages = $shoutboxMessages; $this->view->detailPartial = '_' . $productType . 'Details.tpl'; } else { $this->_redirect('/index/error'); } //publicShoutbox messages }