Rabatkoder Posted January 12, 2011 Share Posted January 12, 2011 /* 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 More sharing options...
rocky Posted January 13, 2011 Share Posted January 13, 2011 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 More sharing options...
Rabatkoder Posted January 13, 2011 Author Share Posted January 13, 2011 Yes. Thanks But it still not works Link to comment Share on other sites More sharing options...
rocky Posted January 14, 2011 Share Posted January 14, 2011 Another error I noticed: LEFT JOIN `'._DB_PREFIX_.'manufacturer` hl ON (hl.`id_manufacturer` = h.l`id_manufacturer`) should be: LEFT JOIN `'._DB_PREFIX_.'manufacturer` hl ON (hl.`id_manufacturer` = h.`id_manufacturer`) Link to comment Share on other sites More sharing options...
Rabatkoder Posted January 14, 2011 Author Share Posted January 14, 2011 thank you, thank you, thank you... THANK Y O U ! ! !It finally works Now i can call the manufacturer name as the $defaultValueThis should be std. in Prestashop ;-) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now