Welcome Guest, Not a member yet? Register   Sign In
help with templates
#8

[eluser]zyklon[/eluser]
Check the print:
http://208.109.241.32/~lugnuts/index.php...duct_14/14

The template is:
{specification_categories}
<div class="specs">
<div class="blue_11_bold"><span class="specs_title">{specification_category_name}</span></div>
{subspecifications}
<div class="specs_gray">
<div class="specs_left">{subspecification_name}</div>
<div class="specs_right">{subspecification_value}</div>
</div>
{/subspecifications}
</div>
{/specification_categories}


and the array sent:
Code:
$result = $this->lugnuts->get_product($tableName,$id_product);      
        
          $data["specification_categories"] = array();
          
         foreach($result as $key => $value)
         {
            
             $product_specification_value    =  $value["product_specification_value"];
            
            
        
          
             $result_category_spec = $this->lugnuts->get_products_category_specification_id($tableName,$id_product);
             foreach($result_category_spec as $key_2 => $value_2)
             {
                 $product_specification_category_id = $value_2["product_specification_category_id"];
                 $result_spec_id = $this->lugnuts->get_products_specification_id($tableName,$id_product,$product_specification_category_id);
                 foreach($result_spec_id as $key_4 => $value_4)
                 {
                     $result_spec_id_value = $value_4["product_specification_id"];
                    
                     $specification_category_name_res =  $this->lugnuts->get_category_specification_name($tableNameproducts_specifications_categories,$product_specification_category_id);
                     $specification_category_name = $specification_category_name_res->product_specification_category_name;
                     $data["specification_category_name"] = $specification_category_name;
                     $subspecification_name_result = $this->lugnuts->get_category_subspecification_name($tableNameproducts_specifications_subspecifications,$result_spec_id_value);
                     $subspecification_name = $subspecification_name_result->product_specification;
                                                                                
        $data["specification_categories"][] =  array_merge((array)$data["specification_category_name"],
                                                   array('subspecifications' => array(
                                                                                     array('subspecification_name' => $subspecification_name),
                                                                                     array('subspecification_value' => $product_specification_value)
                                                                                     )
                                                                                     )
                                                                                     );
                 }
                
             }
                
        
         }
            
        
          print_r ($data["specification_categories"]);
                      
                      
        $products_show = $this->parser->parse('site/components/product.html', $data,TRUE);

The template is parsed with the array that is printed,and the result is starting from
Specification 2
As you see is
spec 1 {subspecification_value}
{subspecification_name} spec 1 value

and so on.
The real data that should be shown is:
Specification 2
spec 2-1 spec 2-1 value
spec 2-2 spec 2-2 value
Specification 1
spec 1 spec 1 value
spec 2 spec 2 value
These are the values from database.I highlited them to look clear.
That's all that should be there,not what it is now

The template is parsed but it shows wrong results.It should look like:
http://ip-208-109-241-32.ip.secureserver...etails.php
Specifications Category 1 part.


Messages In This Thread
help with templates - by El Forum - 11-30-2007, 02:07 PM
help with templates - by El Forum - 12-02-2007, 03:45 AM
help with templates - by El Forum - 12-02-2007, 03:58 AM
help with templates - by El Forum - 12-02-2007, 03:24 PM
help with templates - by El Forum - 12-02-2007, 03:35 PM
help with templates - by El Forum - 12-02-2007, 04:09 PM
help with templates - by El Forum - 12-02-2007, 05:08 PM
help with templates - by El Forum - 12-02-2007, 05:15 PM
help with templates - by El Forum - 12-03-2007, 05:13 PM



Theme © iAndrew 2016 - Forum software by © MyBB