title: Prestashop: Get id of parent category
body: <p>I've faced the problem while coding my very first prestashop template. So what I want to do is to get the list of all sub categories which are under the same parent category. So running foreach loop I need to send parent category id. 
  In the internet there's not so much information about prestas' coding, modules or stuff, but I found two possible solutions. 
  One was:  <code>{$product-&gt;id_category_default}</code>  but that works only inside a product page (?) Maybe I'm wrong and it's possible to get a solution with this?
  Another way sounds bit desperate: <code>{$cookie-&gt;last_visited_category}</code>
  problem with this one, that it works only if you come from parent category directly, but fails when followed by direct link or any other way. 
  Also I was thinking of writing php function, which sends MySQL query and returns parent category id, but is this optimal way to do? Also I haven't tried writing my own php functions in smarty, seems it woks in some different way than just calling function. </p>
  
  <p>So to conclude, do anyone knows how to get parent category id without separate php function and if it's so desperate, where and how to define your own php functions for smarty and how to call them.</p>
  
  <p>I'm working with prestashop 1.4.</p>
  
  <p>Thank you for your attention.</p>