# Calling Shopware()-&gt;Router()-&gt;Assemble() from a cron

**URL:** <https://forum.shopware.com/t/calling-shopware-gt-router-gt-assemble-from-a-cron/19718>\
**Category:** Shopware 3.5\
**Tags:** general\
**Created:** [11. April 2014 um 15:46 UTC](https://forum.shopware.com/t/calling-shopware-gt-router-gt-assemble-from-a-cron/19718 "2014-04-11T15:46:38Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jbailey](https://avatars.discourse-cdn.com/v4/letter/j/b5a626/32.png) [@jbailey](https://forum.shopware.com/u/jbailey)\
**Post date:** [11. April 2014 um 15:46 UTC](https://forum.shopware.com/t/calling-shopware-gt-router-gt-assemble-from-a-cron/19718/1 "2014-04-11T15:46:38Z")

</div>

If I call Shopware()-\>Router()-\>Assemble() from a cron I am getting no rewrite and the host is missing, i.e. passing Shopware()-\>Front()-\>Router()-\>assemble(array( ‘controller’ =\> ‘blog’, ‘Category’ =\> 376, ‘action’ =\> ‘detail’, ‘blogArticle’ =\> 3, ‘module’ =\> ‘frontend’ )); gives http:///blog/detail/Category/376/blogArticle/3 from the cron event, can anyone tell me how to fix this?

---

<div class="post-metadata">

**Author:** ![jbailey](https://avatars.discourse-cdn.com/v4/letter/j/b5a626/32.png) [@jbailey](https://forum.shopware.com/u/jbailey)\
**Post date:** [15. April 2014 um 20:39 UTC](https://forum.shopware.com/t/calling-shopware-gt-router-gt-assemble-from-a-cron/19718/2 "2014-04-15T20:39:07Z")

</div>

Ok so I found out why I need to register the shop resources by putting `Shopware()-\>Bootstrap()-\>registerResource('shop', $shop);` where $shop is a reference to a shop However once the router has a shop, it will ignore any other shop resources you overwrite it with. This is from onFilterUrl in the router bootstrap ` if ($this-\>shop === null && $params['module'] == 'frontend') { $this-\>initShopConfig(); }` I don’t want to edit the bootstrap, is there a way to make a plugin that will call initShopConfig()? It is a protected function within the core bootstrap (Shopware\_Plugins\_Core\_Router\_Bootstrap).

---

<div class="post-metadata">

**Author:** ![Martin\_Weinmayr](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/martin_weinmayr/32/13016_2.png) [@Martin\_Weinmayr](https://forum.shopware.com/u/Martin_Weinmayr)\
**Post date:** [15. April 2014 um 20:51 UTC](https://forum.shopware.com/t/calling-shopware-gt-router-gt-assemble-from-a-cron/19718/3 "2014-04-15T20:51:26Z")

</div>

What is the goal of your cronjob? If you like to get a seo URL there are some other ways to get this work. Best Reagards Martin

---

<div class="post-metadata">

**Author:** ![jbailey](https://avatars.discourse-cdn.com/v4/letter/j/b5a626/32.png) [@jbailey](https://forum.shopware.com/u/jbailey)\
**Post date:** [15. April 2014 um 22:19 UTC](https://forum.shopware.com/t/calling-shopware-gt-router-gt-assemble-from-a-cron/19718/4 "2014-04-15T22:19:03Z")

</div>

I am making a plugin that generates a different site map, the site map is indexed and has certain settings, I need to call assemble on different shops to get their urls 🙂

---

<div class="post-metadata">

**Author:** ![jbailey](https://avatars.discourse-cdn.com/v4/letter/j/b5a626/32.png) [@jbailey](https://forum.shopware.com/u/jbailey)\
**Post date:** [16. April 2014 um 12:44 UTC](https://forum.shopware.com/t/calling-shopware-gt-router-gt-assemble-from-a-cron/19718/5 "2014-04-16T12:44:09Z")

</div>

Sorry you say there are other ways? I misread this 🙂 What are they? Thanks for your help

---

<div class="post-metadata">

**Author:** ![jbailey](https://avatars.discourse-cdn.com/v4/letter/j/b5a626/32.png) [@jbailey](https://forum.shopware.com/u/jbailey)\
**Post date:** [22. April 2014 um 12:33 UTC](https://forum.shopware.com/t/calling-shopware-gt-router-gt-assemble-from-a-cron/19718/6 "2014-04-22T12:33:12Z")

</div>

Anyone able to tell me how?
