Jump to content

[SOLVED] Manufacturer name in meta_title - Help!


Rabatkoder

Recommended Posts

/* Manufacturers specifics meta tags */
elseif ($id_manufacturer = self::getValue('id_manufacturer'))
{
$row = Db::getInstance()->getRow('
SELECT `meta_title`, `meta_description`, `meta_keywords`, hl.`name` `manufacturer_name`
FROM `'._DB_PREFIX_.'manufacturer_lang` h
LEFT JOIN `'._DB_PREFIX_.'manufacturer` hl ON (hl.`id_manufacturer` = h.l`id_manufacturer`) 
WHERE hl.id_manufacturer = '.intval($id_manufacturer));
if ($row)
{
   if (empty($row['meta_description']))
   $row['meta_description'] = strip_tags($row['meta_description']);
   $row['meta_title'] = $row['meta_title'];
   return self::completeMetaTags($row, $row['meta_title'].' - '.$row['manufacturer_name']);
}
}



What is wrong with this code?
i'm trying to join ps_manufacturer to display the ps_manufacturer row called "name" :)

Link to comment
Share on other sites

I can see one error. You are missing the AS keyword.

SELECT `meta_title`, `meta_description`, `meta_keywords`, hl.`name` `manufacturer_name`



should be:

SELECT `meta_title`, `meta_description`, `meta_keywords`, hl.`name` AS `manufacturer_name`

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...