<?php
/*
* Copyright Bekanntmacher
*
* @author Simon Wohler <s.wohler@bekanntmacher.ch>
* @license commercial
*/
namespace Bekanntmacher\BoxmakerBundle\Module;
use Bekanntmacher\BoxmakerBundle\Classes\Config;
use Bekanntmacher\BoxmakerBundle\Classes\UserInput;
use Bekanntmacher\BoxmakerBundle\Model\FarbeModel;
use Bekanntmacher\BoxmakerBundle\Model\TypeModel;
use Bekanntmacher\BoxmakerBundle\Model\ConfigModel;
use Bekanntmacher\BoxmakerBundle\Model\WelleModel;
use Bekanntmacher\BoxmakerBundle\Model\TypeOptionModel;
use Mpdf;
use Contao\File;
use Haste\Form\Form;
/**
* Boxmaker Typelist
*/
class HeaderCart extends TypeUtil
{
/**
* @var string Template
*/
protected $strTemplate = 'mod_boxmaker_headercart';
/**
* Display a wildcard in the back end
* @return string
*/
public function generate()
{
// Display a wildcard in the back end
if (TL_MODE === 'BE')
{
$template =new \BackendTemplate('be_wildcard');
$template->wildcard = '### BOXMAKER HEADER CART ###';
$template->title = $this->name;
$template->id = $this->id;
$template->link = $this->name;
$template->href = 'contao/main.php?do=themes&table=tl_module&act=edit&id=' . $this->id;
}
return parent::generate();
}
/**
* Generate the module
*/
protected function compile()
{
// Link zum Warenkorb
$session = \System::getContainer()->get('session');
$objJumpToCart = \PageModel::findByPk($this->boxmaker_jumpToCart);
if($objJumpToCart !== null) {
$this->Template->boxmaker_jumpToCart = $objJumpToCart->getFrontendUrl();
}
$this->Template->cartCount = count((array)$session->get('mybox_cart'));
}
}