Skip to content

Commit

Permalink
Merge pull request #12 from vrielsa/issue/11-smarty-not-found
Browse files Browse the repository at this point in the history
Issue/11 smarty not found
  • Loading branch information
KienerNL authored Sep 29, 2019
2 parents ad0b00c + 810c3b2 commit 7bd3a92
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions MollieShopware.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

namespace MollieShopware;

use Smarty;

use Enlight_Event_EventArgs;

use MollieShopware\Models\Transaction;
Expand Down Expand Up @@ -281,12 +279,15 @@ protected function getPaymentOptions()
// path to template dir for extra payment-mean options
$paymentTemplateDir = __DIR__ . '/Resources/views/frontend/plugins/payment';

/** @var \Enlight_Template_Manager $templateManager */
$templateManager = $this->container->get('template');
$templateManager->addTemplateDir(__DIR__ . '/Resources/views');

foreach ($methods as $key => $method) {
$name = 'mollie_' . $method->id;

$smarty = new Smarty;
$smarty->assign('method', $method);
$smarty->assign('router', Shopware()->Router());
$templateManager->assign('method', $method);
$templateManager->assign('router', Shopware()->Router());

// template path
$adTemplate = $paymentTemplateDir . '/methods/' . strtolower($method->id) . '.tpl';
Expand All @@ -296,7 +297,7 @@ protected function getPaymentOptions()
$adTemplate = $paymentTemplateDir . '/methods/main.tpl';
}

$additionalDescription = $smarty->fetch('file:' . $adTemplate);
$additionalDescription = $templateManager->fetch('file:' . $adTemplate);

$option = [
'name' => $name,
Expand Down

0 comments on commit 7bd3a92

Please sign in to comment.