In Mage_GoogleShopping, what is the intended way to add more categories?
-
16-10-2019 - |
Question
We are using Mage_GoogleShopping which is a core extension that can be downloaded from MagentoConnect. It has a hard coded list of categories in Mage_GoogleShopping_Helper_Category
.
public function getCategories($addOther = true)
{
$categories = array(
self::CATEGORY_APPAREL, self::CATEGORY_CLOTHING, self::CATEGORY_SHOES, self::CATEGORY_BOOKS,
self::CATEGORY_DVDS, self::CATEGORY_MUSIC, self::CATEGORY_VGAME
);
if ($addOther) {
$categories[] = self::CATEGORY_OTHER;
}
return $categories;
}
Why is that? Of course we could add new categories by rewriting this helper to add own categories - but is this the intended way?
Solution
Google has specific requirements for certain products in certain countries; see http://support.google.com/merchants/bin/answer.py?hl=en&answer=160081:
The 'Google product category' attribute is required in your feed for all products that belong to the following product categories and only in feeds that target the US, UK, Germany, Japan and France:
- Apparel & Accessories > Clothing
- Apparel & Accessories > Shoes
- Apparel & Accessories (Note that submitting this value for clothing and shoes is not acceptable.)
- Media > Books
- Media > DVDs & Videos
- Media > Music
- Software > Video Game Software
The overall taxonomy is specific for Google, and the fully enumerated taxonomy is available from Google: http://www.google.com/basepages/producttype/taxonomy.en-US.txt
Assuming this document can be relied on to be kept up to date, one could of course easily modify this extension through an additional module to provide the full taxonomy if not currently present.