-- HikaShop version -- : 2.3.2
-- Joomla version -- : 3.3.3
-- Browser(s) name and version -- : IE 11
Hello, there.
Good afternoon!
I am trying to retrieve the Item ID for a given Category ID. Is there any update since the discussion on
www.hikashop.com/forum/4-how-to/15169-get-the-itemid.html
? I.e. is there now a Hikashop function that I can call? If so, please could you provide the name of the class and method?
If not, please could you confirm that the best code to use will be the one that Nicolas stated in the discussion (see the link above)? I.e. the code is:
~~~~~~ START OF CODE ~~~~~~
function getItemidFromCategory($category_id){
$config =& hikashop::config();
foreach($config->values as $key => $value){
if(preg_match('#menu_([0-9]+)#',$key,$match)){
if(is_string($value->config_value)) $value->config_value = unserialize(base64_decode($value->config_value));
if($value->config_value == $category_id ){
return $match[1];
}
}
}
return false;
}
~~~~~~~ END OF CODE ~~~~~~~
Thanks.
Take care!