Author Topic: Shortcut for entering Meta-Information  (Read 510 times)

schefzig

  • Beginner
  • *
  • Posts: 3
Shortcut for entering Meta-Information
« on: May 29, 2012, 06:25:57 AM »
Hi there,

After migrating from V1, I wanted to find an easy way to enter Meta-Data. The goal was to enter meta-data at category-level and to automatically take those to the products.
Since I could not find anything similar within this forum, I started experimenting a bit with meta-information and I want to share my solution.

\components\com_virtuemart\views\productdetails\view.html.php
Starting at line 261, I added an "else" to the Keys and Description

Code: [Select]
if ($product->metadesc) {
    $document->setDescription($product->metadesc);
}
else
{
$document->setDescription($category->metadesc);
}
if ($product->metakey) {
    $document->setMetaData('keywords', $product->metakey);
}
else
{ $document->setMetaData('keywords', ($category->metakey) . ", " . $product->product_name);
}

If there are no metadata at product-level, it now takes the category-description as well as the category-keys + the product name.

Problem solved! For me, that's way better than taking the meta-data from the main-site!

Cheers

Schefzig

VirtueMart Forum

Shortcut for entering Meta-Information
« on: May 29, 2012, 06:25:57 AM »