@river: if you want to remove the site name from the code, you can delete this line:
$sitename=JFactory::getApplication()->getCfg('sitename');and change the line where you set te page title to this:
$doc->setTitle($this->element->main->product_name.' - '.$product_category);
@kyratn: using the above code your product is not going to have multiple titles, it will still be one unique title. It would just change over time if you add a new category. So as I explained in my last post your product may show up in search results as
dress "ella" - dresses - mysite, and when you add a new category and a Google crawler comes along it will pick up the new title and your product will then show as
dress "ella" - new - mysite, but that does not mean it has multiple titles.
However, this doesn't matter so much anymore, since it it is in fact quite easy to get all the categories on the product page. I didn't look carefully yesterday, but all the categories of the product can simply be found in
$this->categories, so if you always want the first category, you can just grab it by using for example
reset($this->categories);.
The following should then be exactly what you guys were looking for:
$doc=JFactory::getDocument();
$sitename=JFactory::getApplication()->getCfg('sitename');
//GET THE FIRST CATEGORY OF THE PRODUCT
$product_category = reset($this->categories)->category_name;
//THEN WE CAN SET THE PAGE TITLE AS: PRODUCT NAME - PRODUCT CATEGORY - SITE NAME
if (hikashop_getCID('product_id')!=$this->element->product_id && isset ($this->element->main->product_name))
$doc->setTitle($this->element->main->product_name.' - '.$product_category.' - '.$sitename);
else
$doc->setTitle($this->element->product_name.' - '.$product_category.' - '.$sitename);
Hope that helps. Kind regards,