Mod: META tags for manufacturer pages

The unofficial CS Mod Team is glad to bring yet another release. :stuck_out_tongue_winking_eye:



Tested and developed on 1.3.4-sp2, might work for 1.3.3 also.



The problem:

By default you cannot edit META description and keywords for manufacturer pages, and CS-Cart uses the defaults which will put your manufacturer pages in the “omitted results” on for example Google. Now one would want to have custom META tags.



The solution:



Run this SQL query in your favorite SQL program:


ALTER TABLE cscart_manufacturer_descriptions ADD meta_keywords varchar(255);
ALTER TABLE cscart_manufacturer_descriptions ADD meta_description varchar(255);




Edit addons/manufacturers/func.php:



Search for "$manufacturer = db_get_row(“SELECT $db_tables[manufacturers]”

COMMENT OUT that line for backup purposes:

Example:

```php

// Original: $manufacturer = db_get_row("SELECT $db_tables[manufacturers] …

```



Add below the commented line:

```php

$manufacturer = db_get_row(“SELECT $db_tables[manufacturers].manufacturer_id, $db_tables[manufacturers].avail, $db_tables[manufacturers].url, $db_tables[manufacturer_descriptions].manufacturer, $db_tables[manufacturer_descriptions].meta_keywords, $db_tables[manufacturer_descriptions].meta_description, $db_tables[manufacturers].position, $db_tables[common_images_links].image_id, $db_tables[common_images_links].pair_id, $db_tables[manufacturer_descriptions].description, $db_tables[manufacturer_descriptions].page_title FROM $db_tables[manufacturers] LEFT JOIN $db_tables[manufacturer_descriptions] ON $db_tables[manufacturer_descriptions].manufacturer_id=$db_tables[manufacturers].manufacturer_id AND $db_tables[manufacturer_descriptions].lang_code=‘$lang_code’ LEFT JOIN $db_tables[common_images_links] ON $db_tables[common_images_links].object_table=‘manufacturers’ AND $db_tables[common_images_links].object_id=$db_tables[manufacturers].manufacturer_id WHERE $db_tables[manufacturers].manufacturer_id=‘$manufacturer_id’ $avail_condition GROUP BY $db_tables[manufacturers].manufacturer_id ORDER BY $db_tables[manufacturers].position”);

```





Edit addons/manufacturers/include/customer/manufacturers.php:



Find:


$smarty->assign('products', $products);




Add below:


// Manufacturer META mod
if (!empty($manufacturer['meta_description']) || !empty($manufacturer['meta_keywords'])) {
$smarty->assign('meta_description' ,$manufacturer['meta_description']);
$smarty->assign('meta_keywords' ,$manufacturer['meta_keywords']);
}






Edit template skins/YOUR_SKIN_NAME/admin/addons/manufacturers/manufacturer_details.tpl:



Find:

```php



```

Add below:
```php
{** START MANUFACTURER META MOD **}

{$lang.meta_description}:


{$manufacturer.meta_description|escape:html}



{$lang.meta_keywords}:


{$manufacturer.meta_keywords|escape:html}

{** END MANUFACTURER META MOD **}
```


Now go and edit your META tags in the manufacturer details page and see your search engine rankings improve. ;)

[quote name=‘Zyles’]

Edit template admin/addons/manufacturers/manufacturer_details.tpl:

[/QUOTE]



If you do not have a default admin folder in your skin such as “brickwork_dark_steel”

ie

/skins/default blue/admin/addons/manufacturers/manufacturer_details.tpl



Enter your admin skin which is “default blue” usually

enter the admin folder and change the following accordingly to Zyles directions.

Works like a charm. Thanks for your share and this very useful mod.

I tried this mod and unfortunatly couldn’t get it to work and was hoping that someone could help me. I think I followed the instructions to the “t”, but I end up getting the manufacturer page with my meta description and keywords that I have set for the site and I am not able to change anything having to do with the manufacturer at all. I hope you guys can help and I appreciate your time.



Brandon

Double check that you did everything properly. Make sure you did run the SQL queries.



Try empty your cache on both client and cart.



Need example urls, or errors to try and solve problems if this does not work. Most likely you have missed something.

I figured out my problem. I didn’t realize what meta keywords and meta description are and so I put in my keywords and description into those fields as well as where they are supposed to go. Once I changed the language setting back to where they are supposed to be everything worked great. Thank you for your help and I am sure I will make great use of this.



Brandon

Well, thats great. :wink: