Ejemplo n.º 1
0
 /**
  * This function is used to get   the attribute list
  * 
  * 
  * @return string
  */
 function attributeList()
 {
     $sqlVari = "SELECT product_id,has_variation\n\t\tFROM products_table  WHERE product_id =" . (int) $_GET['prodid'] . " ";
     $queryVari = new Bin_Query();
     $queryVari->executeQuery($sqlVari);
     $has_variation = $queryVari->records[0]['has_variation'];
     if ($has_variation == '0') {
         $sqlfeature = "SELECT product_id,sku,brand,weight,dimension,model\n\t\t\t\tFROM products_table  WHERE product_id =" . (int) $_GET['prodid'] . " ";
         $queryfeature = new Bin_Query();
         $queryfeature->executeQuery($sqlfeature);
         $recordsfeature = $queryfeature->records;
         $sql = "SELECT attrib_name, attrib_value \n\t\t\t\tFROM `attribute_value_table` av, attribute_table at\n\t\t\t\tWHERE av.attrib_id = at.attrib_id AND av.attrib_value_id IN (SELECT attrib_value_id \n\t\t\t\tFROM product_attrib_values_table\n\t\t\t\tWHERE product_id =" . (int) $_GET['prodid'] . ')';
         $query = new Bin_Query();
         $query->executeQuery($sql);
         return Display_DProductDetail::attributeList($query->records, $recordsfeature);
     }
     if ($has_variation == '1') {
         $sqlfeature = "SELECT *\n\t\t\t\tFROM product_variation_table  WHERE product_id =" . (int) $_GET['prodid'] . " ";
         $queryfeature = new Bin_Query();
         $queryfeature->executeQuery($sqlfeature);
         $recordsfeature = $queryfeature->records;
         $sql = "SELECT attrib_name, attrib_value \n\t\t\t\tFROM `attribute_value_table` av, attribute_table at\n\t\t\t\tWHERE av.attrib_id = at.attrib_id AND av.attrib_value_id IN (SELECT attrib_value_id \n\t\t\t\tFROM product_attrib_values_table\n\t\t\t\tWHERE product_id =" . (int) $_GET['prodid'] . ')';
         $query = new Bin_Query();
         $query->executeQuery($sql);
         return Display_DProductDetail::attributeList($query->records, $recordsfeature);
     } else {
         return Display_DProductDetail::attributeList($flag = 0, $recordsfeature);
     }
 }
Ejemplo n.º 2
0
 /**
  * Function gets the attribute list for the selected product
  * 
  * 
  * @return string
  */
 function attributeList()
 {
     $sql = "SELECT attrib_name, attrib_value \n\t\tFROM `attribute_value_table` av, attribute_table at\n\t\tWHERE av.attrib_id = at.attrib_id AND av.attrib_value_id IN (SELECT attrib_value_id \n\t\tFROM product_attrib_values_table\n\t\tWHERE product_id =" . (int) $_GET['prodid'] . ')';
     $query = new Bin_Query();
     if ($query->executeQuery($sql)) {
         return Display_DProductDetail::attributeList($query->records);
     } else {
         //return "Not  Found";
     }
 }