# Cronjob mit Smarty Modifier

**URL:** https://forum.shopware.com/t/cronjob-mit-smarty-modifier/61550
**Category:** Programmierung
**Created:** [5. September 2019 um 06:24 UTC](https://forum.shopware.com/t/cronjob-mit-smarty-modifier/61550 "2019-09-05T06:24:30Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![ActionSports](https://avatars.discourse-cdn.com/v4/letter/a/ee7513/32.png) [@ActionSports](https://forum.shopware.com/u/ActionSports)
#### Post date: [5. September 2019 um 06:24 UTC](https://forum.shopware.com/t/cronjob-mit-smarty-modifier/61550/1 "2019-09-05T06:24:30Z")

</div>

Hallo Zusammen,

ich habe für den Produktexport ein Smarty Plugin registriert. Das funktioniert im Direktaufruf (Live-Modus) gut, aber als Cronjob bekomme ich die Fehlermeldung der Modifier sei nicht bekannt. Zunächst registriere ich mich für folgende Events (einmal Cron, einmal Direktaufruf).

```
$this->subscribeEvent('Enlight_Controller_Action_Backend_Export_Index', 'onProductFeed');
$this->subscribeEvent('Shopware_CronJob_ProductExport', 'onProductFeed');

```

Dann wird folgende Funktion ausgeführt:

```
public function onProductFeed(Enlight_Event_EventArgs $args)
{
    $modifierPath = __DIR__. '/Resources/views/_private/smarty/';
    Shopware()->Template()->addPluginsDir($modifierPath);
}

```

Das ist soweit ja eine simple Smarty Modifier Implementierung, aber wie kann ich erreichen, dass diese auch im Cronjob berücksichtigt wird?
