sitemap

Enables plugins to add new elements to store's Sitemap file.

Shop-Script

Input (passed by reference)

$route array Current route’s parameters.
… your plugin code …

Output

Array of data for adding new Sitemap file elements. Each array item must contain an associative array with the mandatory 'loc' key and optional keys 'lastmod', 'changefreq', and 'priority'.

Shop-Script

Plugin code example

PHP

public function sitemap(&$route)
{
    $sitemap_data = shopMyPluginHelper::getSitemapData($params);
    return array(
        array(
            'loc' => $sitemap_data['url'],
            'lastmod' => $sitemap_data['update_datetime'],
            'changefreq' => 'weekly',
            'priority' => '0.8',
        ),
    );
}