This commit is contained in:
Thomas Peterson 2025-10-24 10:22:54 +02:00
parent fbd0cbf43e
commit 3f14580904
7 changed files with 620 additions and 367 deletions

View File

@ -178,9 +178,13 @@ class Preview extends AbstractController
} }
if ($element->getType() == ElementType::Image && $formData[$element->getId()]['value'] instanceof Media) { if ($element->getType() == ElementType::Image && $formData[$element->getId()]['value'] instanceof Media) {
if ($element->getImage()->aspectRatio == null) {
$formData[$element->getId()]['value'] = $formData[$element->getId()]['value'];
} else {
$formData[$element->getId()]['value'] = $formData[$element->getId()]['value']->getVariant($element->getImage()->aspectRatio); $formData[$element->getId()]['value'] = $formData[$element->getId()]['value']->getVariant($element->getImage()->aspectRatio);
} }
} }
}
$this->mpdf->setData($formData); $this->mpdf->setData($formData);
$this->mpdf->generate($type == 2); $this->mpdf->generate($type == 2);

View File

@ -165,8 +165,12 @@ class Save extends AbstractController
if ($elm = $data->getElement($element, $contact)) { if ($elm = $data->getElement($element, $contact)) {
if ($element->getType() == ElementType::Image && $elm['value'] != '') { if ($element->getType() == ElementType::Image && $elm['value'] != '') {
$media = $this->mediaManager->getModelByUuid($elm['value']); $media = $this->mediaManager->getModelByUuid($elm['value']);
if ($element->getImage()->aspectRatio == null) {
$formData[$element->getId()] = ['value' => $media, 'enable' => (bool) $elm['enable']];
} else {
$elmMedia = $media->getVariant($element->getImage()->aspectRatio); $elmMedia = $media->getVariant($element->getImage()->aspectRatio);
$formData[$element->getId()] = ['value' => $elmMedia, 'enable' => (bool) $elm['enable']]; $formData[$element->getId()] = ['value' => $elmMedia, 'enable' => (bool) $elm['enable']];
}
} else { } else {
$formData[$element->getId()] = ['value' => $elm['value'], 'enable' => (bool) $elm['enable']]; $formData[$element->getId()] = ['value' => $elm['value'], 'enable' => (bool) $elm['enable']];
} }

View File

@ -6,7 +6,6 @@ use Doctrine\ODM\MongoDB\DocumentManager;
use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityManagerInterface;
use Lexik\Bundle\JWTAuthenticationBundle\Services\JWTTokenManagerInterface; use Lexik\Bundle\JWTAuthenticationBundle\Services\JWTTokenManagerInterface;
use OpenApi\Attributes\Response; use OpenApi\Attributes\Response;
use PSC\Shop\MediaBundle\Service\MediaManager;
use Plugin\Custom\PSC\CollectLayouter\Dto\Preview\Input; use Plugin\Custom\PSC\CollectLayouter\Dto\Preview\Input;
use Plugin\Custom\PSC\CollectLayouter\Helper\MPDF; use Plugin\Custom\PSC\CollectLayouter\Helper\MPDF;
use Plugin\Custom\PSC\CollectLayouter\Model\Element; use Plugin\Custom\PSC\CollectLayouter\Model\Element;
@ -16,6 +15,7 @@ use Plugin\Custom\PSC\CollectLayouter\Model\Setting;
use PSC\Shop\ContactBundle\Repository\ContactRepository; use PSC\Shop\ContactBundle\Repository\ContactRepository;
use PSC\Shop\ContactBundle\Transformer\Model\Contact; use PSC\Shop\ContactBundle\Transformer\Model\Contact;
use PSC\Shop\EntityBundle\Entity\Product; use PSC\Shop\EntityBundle\Entity\Product;
use PSC\Shop\MediaBundle\Service\MediaManager;
use Ramsey\Uuid\Uuid; use Ramsey\Uuid\Uuid;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
@ -27,31 +27,35 @@ use Symfony\Component\Serializer\SerializerInterface;
class DesignerController extends AbstractController class DesignerController extends AbstractController
{ {
public function __construct( public function __construct(
readonly private Contact $contactTransformer, private readonly Contact $contactTransformer,
readonly private MPDF $mpdf, private readonly MPDF $mpdf,
readonly private EntityManagerInterface $entityManager, private readonly EntityManagerInterface $entityManager,
readonly private DocumentManager $documentManager, private readonly DocumentManager $documentManager,
readonly private SerializerInterface $serializer, private readonly SerializerInterface $serializer,
readonly private RequestStack $requestStack, private readonly RequestStack $requestStack,
readonly private MediaManager $mediaManager private readonly MediaManager $mediaManager,
) {}
#[Template]
#[Route('/start/{productUuid}/{contactUuid}', name: 'plugin_custom_psc_collectlayouter_start', defaults: [
'contactUuid' => '',
])]
public function start(
ContactRepository $contactRepository,
\PSC\Shop\ContactBundle\Transformer\Model\Contact $contactTransformer,
JWTTokenManagerInterface $JWTTokenManager,
string $productUuid,
string $contactUuid = '',
) { ) {
}
#[Template()]
#[Route('/start/{productUuid}/{contactUuid}', name: 'plugin_custom_psc_collectlayouter_start', defaults: ['contactUuid' => ''])]
public function start(ContactRepository $contactRepository, \PSC\Shop\ContactBundle\Transformer\Model\Contact $contactTransformer, JWTTokenManagerInterface $JWTTokenManager, string $productUuid, string $contactUuid = "")
{
/** @var \Plugin\Custom\PSC\Pitchprint\Controller\Frontend\Product $product */ /** @var \Plugin\Custom\PSC\Pitchprint\Controller\Frontend\Product $product */
$product = $this->entityManager $product = $this->entityManager
->getRepository('PSC\Shop\EntityBundle\Entity\Product') ->getRepository('PSC\Shop\EntityBundle\Entity\Product')
->findOneBy(array('uuid' => $productUuid)); ->findOneBy(['uuid' => $productUuid]);
/** @var \PSC\Shop\EntityBundle\Document\Product $productDoc */ /** @var \PSC\Shop\EntityBundle\Document\Product $productDoc */
$productDoc = $this->documentManager $productDoc = $this->documentManager
->getRepository('PSC\Shop\EntityBundle\Document\Product') ->getRepository('PSC\Shop\EntityBundle\Document\Product')
->findOneBy(array('uid' => (string)$product->getUid())); ->findOneBy(['uid' => (string) $product->getUid()]);
$token = null; $token = null;
if ($contactUuid) { if ($contactUuid) {
@ -59,36 +63,52 @@ class DesignerController extends AbstractController
$token = $JWTTokenManager->create($user); $token = $JWTTokenManager->create($user);
} }
/** @var Setting $settings */ /** @var Setting $settings */
$settings = $this->serializer->deserialize($productDoc->getPluginSettingModule('collectlayouter', 'config') ?? '{}', Setting::class, 'json'); $settings = $this->serializer->deserialize(
$productDoc->getPluginSettingModule('collectlayouter', 'config') ?? '{}',
Setting::class,
'json',
);
return [ return [
'product' => $product, 'product' => $product,
'productDoc' => $productDoc, 'productDoc' => $productDoc,
'contactUuid' => $contactUuid, 'contactUuid' => $contactUuid,
'settings' => $settings, 'settings' => $settings,
'jwt' => $token ?: '' 'jwt' => $token ?: '',
]; ];
} }
#[Template()] #[Template]
#[Route('/startcollect/{productUuid}/{mode}/{contactUuid}', name: 'plugin_custom_psc_collectlayouter_collect', defaults: ['contactUuid' => '', 'mode' => 1])] #[Route(
public function collect(ContactRepository $contactRepository, \PSC\Shop\ContactBundle\Transformer\Model\Contact $contactTransformer, JWTTokenManagerInterface $JWTTokenManager, string $productUuid, string $contactUuid = "", int $mode = 1) '/startcollect/{productUuid}/{mode}/{contactUuid}',
{ name: 'plugin_custom_psc_collectlayouter_collect',
defaults: ['contactUuid' => '', 'mode' => 1],
)]
public function collect(
ContactRepository $contactRepository,
\PSC\Shop\ContactBundle\Transformer\Model\Contact $contactTransformer,
JWTTokenManagerInterface $JWTTokenManager,
string $productUuid,
string $contactUuid = '',
int $mode = 1,
) {
/** @var \Plugin\Custom\PSC\Pitchprint\Controller\Frontend\Product $product */ /** @var \Plugin\Custom\PSC\Pitchprint\Controller\Frontend\Product $product */
$product = $this->entityManager $product = $this->entityManager
->getRepository('PSC\Shop\EntityBundle\Entity\Product') ->getRepository('PSC\Shop\EntityBundle\Entity\Product')
->findOneBy(array('uuid' => $productUuid)); ->findOneBy(['uuid' => $productUuid]);
/** @var \PSC\Shop\EntityBundle\Document\Product $productDoc */ /** @var \PSC\Shop\EntityBundle\Document\Product $productDoc */
$productDoc = $this->documentManager $productDoc = $this->documentManager
->getRepository('PSC\Shop\EntityBundle\Document\Product') ->getRepository('PSC\Shop\EntityBundle\Document\Product')
->findOneBy(array('uid' => (string)$product->getUid())); ->findOneBy(['uid' => (string) $product->getUid()]);
$token = $JWTTokenManager->create($this->getUser()); $token = $JWTTokenManager->create($this->getUser());
/** @var Setting $settings */ /** @var Setting $settings */
$settings = $this->serializer->deserialize($productDoc->getPluginSettingModule('collectlayouter', 'config') ?? '{}', Setting::class, 'json'); $settings = $this->serializer->deserialize(
$productDoc->getPluginSettingModule('collectlayouter', 'config') ?? '{}',
Setting::class,
'json',
);
return [ return [
'product' => $product, 'product' => $product,
'productDoc' => $productDoc, 'productDoc' => $productDoc,
@ -96,31 +116,40 @@ class DesignerController extends AbstractController
'settings' => $settings, 'settings' => $settings,
'jwt' => $token ?: '', 'jwt' => $token ?: '',
'layouterUuid' => Uuid::uuid4(), 'layouterUuid' => Uuid::uuid4(),
'mode' => $mode 'mode' => $mode,
]; ];
} }
#[Template()] #[Template]
#[Route('/loadcollect/{productId}/{layouterId}', name: 'plugin_custom_psc_collectlayouter_loadcollect', defaults: ['contactUuid' => ''])] #[Route('/loadcollect/{productId}/{layouterId}', name: 'plugin_custom_psc_collectlayouter_loadcollect', defaults: [
public function loadCollect(ContactRepository $contactRepository, \PSC\Shop\ContactBundle\Transformer\Model\Contact $contactTransformer, JWTTokenManagerInterface $JWTTokenManager, string $productId, string $layouterId) 'contactUuid' => '',
{ ])]
public function loadCollect(
ContactRepository $contactRepository,
\PSC\Shop\ContactBundle\Transformer\Model\Contact $contactTransformer,
JWTTokenManagerInterface $JWTTokenManager,
string $productId,
string $layouterId,
) {
/** @var \Plugin\Custom\PSC\Pitchprint\Controller\Frontend\Product $product */ /** @var \Plugin\Custom\PSC\Pitchprint\Controller\Frontend\Product $product */
$product = $this->entityManager $product = $this->entityManager
->getRepository('PSC\Shop\EntityBundle\Entity\Product') ->getRepository('PSC\Shop\EntityBundle\Entity\Product')
->findOneBy(array('uuid' => $productId)); ->findOneBy(['uuid' => $productId]);
/** @var \PSC\Shop\EntityBundle\Document\Product $productDoc */ /** @var \PSC\Shop\EntityBundle\Document\Product $productDoc */
$productDoc = $this->documentManager $productDoc = $this->documentManager
->getRepository('PSC\Shop\EntityBundle\Document\Product') ->getRepository('PSC\Shop\EntityBundle\Document\Product')
->findOneBy(array('uid' => (string)$product->getUid())); ->findOneBy(['uid' => (string) $product->getUid()]);
/** @var Setting $settings */ /** @var Setting $settings */
$settings = $this->serializer->deserialize($productDoc->getPluginSettingModule('collectlayouter', 'config') ?? '{}', Setting::class, 'json'); $settings = $this->serializer->deserialize(
$productDoc->getPluginSettingModule('collectlayouter', 'config') ?? '{}',
Setting::class,
'json',
);
$layoutDesignData = $this->entityManager $layoutDesignData = $this->entityManager
->getRepository('PSC\Shop\EntityBundle\Entity\Layoutdesigndata')->findOneBy(array('uuid' => $layouterId)); ->getRepository('PSC\Shop\EntityBundle\Entity\Layoutdesigndata')
->findOneBy(['uuid' => $layouterId]);
$token = $JWTTokenManager->create($this->getUser()); $token = $JWTTokenManager->create($this->getUser());
@ -131,31 +160,41 @@ class DesignerController extends AbstractController
'settings' => $settings, 'settings' => $settings,
'jwt' => $token ?: '', 'jwt' => $token ?: '',
'layouterId' => $layouterId, 'layouterId' => $layouterId,
'data' => $layoutDesignData->getDesign()['data'] 'data' => $layoutDesignData->getDesign()['data'],
]; ];
} }
#[Template()] #[Template]
#[Route('/load/{productId}/{layouterId}/{contactUuid}', name: 'plugin_custom_psc_collectlayouter_load', defaults: ['contactUuid' => ''])] #[Route('/load/{productId}/{layouterId}/{contactUuid}', name: 'plugin_custom_psc_collectlayouter_load', defaults: [
public function load(ContactRepository $contactRepository, \PSC\Shop\ContactBundle\Transformer\Model\Contact $contactTransformer, JWTTokenManagerInterface $JWTTokenManager, string $productId, string $layouterId, string $contactUuid = "") 'contactUuid' => '',
{ ])]
public function load(
ContactRepository $contactRepository,
\PSC\Shop\ContactBundle\Transformer\Model\Contact $contactTransformer,
JWTTokenManagerInterface $JWTTokenManager,
string $productId,
string $layouterId,
string $contactUuid = '',
) {
/** @var \Plugin\Custom\PSC\Pitchprint\Controller\Frontend\Product $product */ /** @var \Plugin\Custom\PSC\Pitchprint\Controller\Frontend\Product $product */
$product = $this->entityManager $product = $this->entityManager
->getRepository('PSC\Shop\EntityBundle\Entity\Product') ->getRepository('PSC\Shop\EntityBundle\Entity\Product')
->findOneBy(array('uuid' => $productId)); ->findOneBy(['uuid' => $productId]);
/** @var \PSC\Shop\EntityBundle\Document\Product $productDoc */ /** @var \PSC\Shop\EntityBundle\Document\Product $productDoc */
$productDoc = $this->documentManager $productDoc = $this->documentManager
->getRepository('PSC\Shop\EntityBundle\Document\Product') ->getRepository('PSC\Shop\EntityBundle\Document\Product')
->findOneBy(array('uid' => (string)$product->getUid())); ->findOneBy(['uid' => (string) $product->getUid()]);
/** @var Setting $settings */ /** @var Setting $settings */
$settings = $this->serializer->deserialize($productDoc->getPluginSettingModule('collectlayouter', 'config') ?? '{}', Setting::class, 'json'); $settings = $this->serializer->deserialize(
$productDoc->getPluginSettingModule('collectlayouter', 'config') ?? '{}',
Setting::class,
'json',
);
$layoutDesignData = $this->entityManager $layoutDesignData = $this->entityManager
->getRepository('PSC\Shop\EntityBundle\Entity\Layoutdesigndata')->findOneBy(array('uuid' => $layouterId)); ->getRepository('PSC\Shop\EntityBundle\Entity\Layoutdesigndata')
->findOneBy(['uuid' => $layouterId]);
$token = null; $token = null;
if ($contactUuid) { if ($contactUuid) {
@ -170,7 +209,7 @@ class DesignerController extends AbstractController
'settings' => $settings, 'settings' => $settings,
'jwt' => $token ?: '', 'jwt' => $token ?: '',
'layouterId' => $layouterId, 'layouterId' => $layouterId,
'data' => $layoutDesignData->getDesign()['data'] 'data' => $layoutDesignData->getDesign()['data'],
]; ];
} }
@ -178,32 +217,50 @@ class DesignerController extends AbstractController
public function preview(string $uuid, string $contact, int $type = 1): Response public function preview(string $uuid, string $contact, int $type = 1): Response
{ {
$product = $this->entityManager->getRepository(Product::class)->findOneBy(['uuid' => $uuid]); $product = $this->entityManager->getRepository(Product::class)->findOneBy(['uuid' => $uuid]);
$contactEntity = $this->entityManager->getRepository(\PSC\Shop\EntityBundle\Entity\Contact::class)->findOneBy(['uuid' => $contact]); $contactEntity = $this->entityManager
->getRepository(\PSC\Shop\EntityBundle\Entity\Contact::class)
$productDoc = $this->documentManager->getRepository(\PSC\Shop\EntityBundle\Document\Product::class)->findOneBy(['uid' => $product->getUID()]); ->findOneBy(['uuid' => $contact]);
$setting = $this->serializer->deserialize($productDoc->getPluginSettingModule('collectlayouter', 'config') ?? '{}', Setting::class, 'json');
$productDoc = $this->documentManager
->getRepository(\PSC\Shop\EntityBundle\Document\Product::class)
->findOneBy(['uid' => $product->getUID()]);
$setting = $this->serializer->deserialize(
$productDoc->getPluginSettingModule('collectlayouter', 'config') ?? '{}',
Setting::class,
'json',
);
$contact = new \PSC\Shop\ContactBundle\Model\Contact(); $contact = new \PSC\Shop\ContactBundle\Model\Contact();
$this->contactTransformer->fromDb($contact, $contactEntity); $this->contactTransformer->fromDb($contact, $contactEntity);
$this->mpdf->setSetting($setting); $this->mpdf->setSetting($setting);
$data = $this->serializer->deserialize($this->requestStack->getSession()->get('collectLayouterData', '{}'), Input::class, 'json'); $data = $this->serializer->deserialize(
$this->requestStack->getSession()->get('collectLayouterData', '{}'),
Input::class,
'json',
);
$formData = []; $formData = [];
/** @var Element $element */ /** @var Element $element */
foreach ($setting->getCustomerForm() as $element) { foreach ($setting->getCustomerForm() as $element) {
$value = match ($element->getBinding()) { $value = match ($element->getBinding()) {
ElementBinding::none => $element->getDefaultForTypePreview(), ElementBinding::none => $element->getDefaultForTypePreview(),
ElementBinding::StreetHouseNumber => ['street' => $contact->getLayouterData()->getStreet() ?? $element->getDefault1(), 'houseNumber' => $contact->getLayouterData()->getHouseNumber() ?? $element->getDefault2()], ElementBinding::StreetHouseNumber => [
ElementBinding::ZipCity => ['zip' => $contact->getLayouterData()->getZip() ?? $element->getDefault1(), 'city' => $contact->getLayouterData()->getCity() ?? $element->getDefault2()], 'street' => $contact->getLayouterData()->getStreet() ?? $element->getDefault1(),
'houseNumber' => $contact->getLayouterData()->getHouseNumber() ?? $element->getDefault2(),
],
ElementBinding::ZipCity => [
'zip' => $contact->getLayouterData()->getZip() ?? $element->getDefault1(),
'city' => $contact->getLayouterData()->getCity() ?? $element->getDefault2(),
],
ElementBinding::Firstname => $contact->getLayouterData()->getFirstname() ?? $element->getDefault1(), ElementBinding::Firstname => $contact->getLayouterData()->getFirstname() ?? $element->getDefault1(),
ElementBinding::Lastname => $contact->getLayouterData()->getLastname() ?? $element->getDefault1(), ElementBinding::Lastname => $contact->getLayouterData()->getLastname() ?? $element->getDefault1(),
ElementBinding::Mobile => [ ElementBinding::Mobile => [
'areacode' => $contact->getLayouterData()->getMobileAreaCode() ?? $element->getDefault1(), 'areacode' => $contact->getLayouterData()->getMobileAreaCode() ?? $element->getDefault1(),
'appendix' => $contact->getLayouterData()->getMobileAppendix() ?? $element->getDefault2(), 'appendix' => $contact->getLayouterData()->getMobileAppendix() ?? $element->getDefault2(),
'number' => $contact->getLayouterData()->getMobile() ?? $element->getDefault3(), 'number' => $contact->getLayouterData()->getMobile() ?? $element->getDefault3(),
'prefix' => $contact->getLayouterData()->getMobilePrefix() ?? $element->getDefault4()], 'prefix' => $contact->getLayouterData()->getMobilePrefix() ?? $element->getDefault4(),
],
ElementBinding::UsernameLogin => $contact->getEmail() ?? $element->getDefault1(), ElementBinding::UsernameLogin => $contact->getEmail() ?? $element->getDefault1(),
ElementBinding::Company => $contact->getLayouterData()->getCompany() ?? $element->getDefault1(), ElementBinding::Company => $contact->getLayouterData()->getCompany() ?? $element->getDefault1(),
ElementBinding::Company2 => $contact->getLayouterData()->getCompany2() ?? $element->getDefault1(), ElementBinding::Company2 => $contact->getLayouterData()->getCompany2() ?? $element->getDefault1(),
@ -215,12 +272,14 @@ class DesignerController extends AbstractController
'areacode' => $contact->getLayouterData()->getPhoneAreaCode() ?? $element->getDefault1(), 'areacode' => $contact->getLayouterData()->getPhoneAreaCode() ?? $element->getDefault1(),
'appendix' => $contact->getLayouterData()->getPhoneAppendix() ?? $element->getDefault2(), 'appendix' => $contact->getLayouterData()->getPhoneAppendix() ?? $element->getDefault2(),
'number' => $contact->getLayouterData()->getPhone() ?? $element->getDefault3(), 'number' => $contact->getLayouterData()->getPhone() ?? $element->getDefault3(),
'prefix' => $contact->getLayouterData()->getPhonePrefix() ?? $element->getDefault4()], 'prefix' => $contact->getLayouterData()->getPhonePrefix() ?? $element->getDefault4(),
],
ElementBinding::Fax => [ ElementBinding::Fax => [
'areacode' => $contact->getLayouterData()->getFaxAreaCode() ?? $element->getDefault1(), 'areacode' => $contact->getLayouterData()->getFaxAreaCode() ?? $element->getDefault1(),
'appendix' => $contact->getLayouterData()->getFaxPrefix() ?? $element->getDefault2(), 'appendix' => $contact->getLayouterData()->getFaxPrefix() ?? $element->getDefault2(),
'number' => $contact->getLayouterData()->getFax() ?? $element->getDefault3(), 'number' => $contact->getLayouterData()->getFax() ?? $element->getDefault3(),
'prefix' => $contact->getLayouterData()->getFaxAppendix() ?? $element->getDefault4()], 'prefix' => $contact->getLayouterData()->getFaxAppendix() ?? $element->getDefault4(),
],
ElementBinding::Abteilung => $contact->getLayouterData()->getAbteilung() ?? $element->getDefault1(), ElementBinding::Abteilung => $contact->getLayouterData()->getAbteilung() ?? $element->getDefault1(),
ElementBinding::Custom1 => $contact->getCustom1() ?? $element->getDefault1(), ElementBinding::Custom1 => $contact->getCustom1() ?? $element->getDefault1(),
ElementBinding::Custom2 => $contact->getCustom2() ?? $element->getDefault1(), ElementBinding::Custom2 => $contact->getCustom2() ?? $element->getDefault1(),
@ -247,8 +306,12 @@ class DesignerController extends AbstractController
ElementBinding::Custom23 => $contact->getCustom23() ?? $element->getDefault1(), ElementBinding::Custom23 => $contact->getCustom23() ?? $element->getDefault1(),
ElementBinding::Custom24 => $contact->getCustom24() ?? $element->getDefault1(), ElementBinding::Custom24 => $contact->getCustom24() ?? $element->getDefault1(),
ElementBinding::LayouterMail => $contact->getLayouterData()->getEmail() ?? $element->getDefault1(), ElementBinding::LayouterMail => $contact->getLayouterData()->getEmail() ?? $element->getDefault1(),
ElementBinding::LayouterCountryName => $contact->getLayouterData()->getCountryName() ?? $element->getDefault1(), ElementBinding::LayouterCountryName => $contact
ElementBinding::LayouterCountryCode => $contact->getLayouterData()->getCountryCode() ?? $element->getDefault1(), ->getLayouterData()
->getCountryName() ?? $element->getDefault1(),
ElementBinding::LayouterCountryCode => $contact
->getLayouterData()
->getCountryCode() ?? $element->getDefault1(),
ElementBinding::Birthday => $contact->getLayouterData()->getBirthday() ?? $element->getDefault1(), ElementBinding::Birthday => $contact->getLayouterData()->getBirthday() ?? $element->getDefault1(),
ElementBinding::Homepages => $contact->getLayouterData()->getHomepage() ?? $element->getDefault1(), ElementBinding::Homepages => $contact->getLayouterData()->getHomepage() ?? $element->getDefault1(),
ElementBinding::Salutation => $contact->getLayouterData()->getSalutation() ?? $element->getDefault1(), ElementBinding::Salutation => $contact->getLayouterData()->getSalutation() ?? $element->getDefault1(),
@ -261,17 +324,23 @@ class DesignerController extends AbstractController
}; };
if ($elm = $data->getElement($element, $contact)) { if ($elm = $data->getElement($element, $contact)) {
if ($element->getType() == ElementType::Image && $elm['value'] != "") { if ($element->getType() == ElementType::Image && $elm['value'] != '') {
$media = $this->mediaManager->getModelByUuid($elm['value']); $media = $this->mediaManager->getModelByUuid($elm['value']);
if ($element->getImage()->aspectRatio == null) {
$formData[$element->getId()] = ['value' => $media, 'enable' => (bool) $elm['enable']];
} else {
$elmMedia = $media->getVariant($element->getImage()->aspectRatio); $elmMedia = $media->getVariant($element->getImage()->aspectRatio);
$formData[$element->getId()] = ['value' => $elmMedia, 'enable' => (bool) $elm['enable']]; $formData[$element->getId()] = ['value' => $elmMedia, 'enable' => (bool) $elm['enable']];
}
} else { } else {
$formData[$element->getId()] = ['value' => $elm['value'], 'enable' => $elm['enable']]; $formData[$element->getId()] = ['value' => $elm['value'], 'enable' => $elm['enable']];
} }
} else { } else {
$formData[$element->getId()] = ['value' => $value, 'enable' => $element->getOptional() ? $element->getOptionalDefault() : true]; $formData[$element->getId()] = [
'value' => $value,
'enable' => $element->getOptional() ? $element->getOptionalDefault() : true,
];
} }
} }
$this->mpdf->setData($formData); $this->mpdf->setData($formData);
@ -279,7 +348,6 @@ class DesignerController extends AbstractController
$outfilename = $this->mpdf->getPdfFile(); $outfilename = $this->mpdf->getPdfFile();
$response = new \Symfony\Component\HttpFoundation\Response(); $response = new \Symfony\Component\HttpFoundation\Response();
$filename = ''; $filename = '';
if (isset($formData['firstname'])) { if (isset($formData['firstname'])) {
$filename = $formData['firstname']['value'] . '_'; $filename = $formData['firstname']['value'] . '_';

View File

@ -5,15 +5,14 @@ namespace Plugin\System\PSC\Bootstrap4\Form\Field;
use DirectoryIterator; use DirectoryIterator;
use PSC\Shop\EntityBundle\Entity\Shop; use PSC\Shop\EntityBundle\Entity\Shop;
use PSC\System\PluginBundle\Form\Interfaces\Field; use PSC\System\PluginBundle\Form\Interfaces\Field;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Form\Extension\Core\Type\HiddenType; use Symfony\Component\Form\Extension\Core\Type\HiddenType;
use Symfony\Component\Form\Extension\Core\Type\TextareaType; use Symfony\Component\Form\Extension\Core\Type\TextareaType;
use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Form\FormEvent; use Symfony\Component\Form\FormEvent;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
class Formulare extends AbstractController implements Field class Formulare extends AbstractController implements Field
{ {
private $options; private $options;
public function getTemplate() public function getTemplate()
@ -31,13 +30,11 @@ class Formulare extends AbstractController implements Field
*/ */
public function formPreSubmit(FormEvent $event) public function formPreSubmit(FormEvent $event)
{ {
} }
public function buildForm(FormBuilderInterface $builder, array $options) public function buildForm(FormBuilderInterface $builder, array $options)
{ {
$txt = ""; $txt = '';
$this->options = $options; $this->options = $options;
/** @var Shop $shopEntity */ /** @var Shop $shopEntity */
@ -45,89 +42,118 @@ class Formulare extends AbstractController implements Field
$tempLayouts = []; $tempLayouts = [];
if ($shopEntity->isCustomTemplates() == 1) { if ($shopEntity->isCustomTemplates() == 1) {
foreach (new DirectoryIterator('/data/www/old/application/design/vorlagen') as $file) { foreach (new DirectoryIterator('/data/www/old/application/design/vorlagen') as $file) {
if ($file == '.' || $file == '..' || $file == 'config' || $file == '.svn' || $file == 'datapacks' || $file == '.DS_Store') { if (
$file == '.' ||
$file == '..' ||
$file == 'config' ||
$file == '.svn' ||
$file == 'datapacks' ||
$file == '.DS_Store'
) {
continue; continue;
} }
$tempLayouts[$file->getFileName()] = $file->getFileName(); $tempLayouts[$file->getFileName()] = $file->getFileName();
} }
} else { } else {
if (file_exists('/data/www/old/application/design/clients/' . $shopEntity->getUID())) { if (file_exists('/data/www/old/application/design/clients/' . $shopEntity->getUID())) {
foreach (new DirectoryIterator('/data/www/old/application/design/clients/' . $shopEntity->getUID()) as $file) { foreach (new DirectoryIterator('/data/www/old/application/design/clients/' .
if ($file == '.' || $file == '..' || $file == 'config' || $file == '.svn' || $file == 'datapacks' || $file == '.DS_Store') { $shopEntity->getUID()) as $file) {
if (
$file == '.' ||
$file == '..' ||
$file == 'config' ||
$file == '.svn' ||
$file == 'datapacks' ||
$file == '.DS_Store'
) {
continue; continue;
} }
$tempLayouts[$file->getFileName()] = $file->getFileName(); $tempLayouts[$file->getFileName()] = $file->getFileName();
} }
} }
} }
if(isset($_POST["settings"]["bootstrap4Images"]["layout"])) { if (isset($_POST['settings']['bootstrap4Images']['layout'])) {
header('location: /apps/backend/theme/settings'); header('location: /apps/backend/theme/settings');
//die(); //die();
} else { } else {
//copy("/data/www/old/public/styles/vorlagen/" . $shopEntity->getLayout() . "/bootstrap/css/style.css","/data/www/old/public/styles/vorlagen/" . $shopEntity->getLayout() . "/bootstrap/css/style_bakup.css"); $filenamelogin =
$filenamelogin = "/data/www/old/application/design/vorlagen/" . $shopEntity->getLayout() . "/config/user/login.ini"; '/data/www/old/application/design/vorlagen/' . $shopEntity->getLayout() . '/config/user/login.ini';
if (file_exists($filenamelogin)) {
$handlelogin = fopen($filenamelogin, 'r'); $handlelogin = fopen($filenamelogin, 'r');
$txtlogin = fread($handlelogin, filesize($filenamelogin)); $txtlogin = fread($handlelogin, filesize($filenamelogin));
fclose($handlelogin); fclose($handlelogin);
} else {
$txtlogin = '';
}
$filenameregister = "/data/www/old/application/design/vorlagen/" . $shopEntity->getLayout() . "/config/user/registercontact.ini"; $filenameregister =
'/data/www/old/application/design/vorlagen/' .
$shopEntity->getLayout() .
'/config/user/registercontact.ini';
$handleregister = fopen($filenameregister, 'r'); $handleregister = fopen($filenameregister, 'r');
$txtregister = fread($handleregister, filesize($filenameregister)); $txtregister = fread($handleregister, filesize($filenameregister));
fclose($handleregister); fclose($handleregister);
$filenamepass = "/data/www/old/application/design/vorlagen/" . $shopEntity->getLayout() . "/config/user/resetpassword.ini"; $filenamepass =
'/data/www/old/application/design/vorlagen/' .
$shopEntity->getLayout() .
'/config/user/resetpassword.ini';
$handlepass = fopen($filenamepass, 'r'); $handlepass = fopen($filenamepass, 'r');
$txtpass = fread($handlepass, filesize($filenamepass)); $txtpass = fread($handlepass, filesize($filenamepass));
fclose($handlepass); fclose($handlepass);
$filenameaddress = "/data/www/old/application/design/vorlagen/" . $shopEntity->getLayout() . "/config/user/updatecontact.ini"; $filenameaddress =
'/data/www/old/application/design/vorlagen/' .
$shopEntity->getLayout() .
'/config/user/updatecontact.ini';
$handleaddress = fopen($filenameaddress, 'r'); $handleaddress = fopen($filenameaddress, 'r');
$txtaddress = fread($handleaddress, filesize($filenameaddress)); $txtaddress = fread($handleaddress, filesize($filenameaddress));
fclose($handleaddress); fclose($handleaddress);
$filenameaddaddress = "/data/www/old/application/design/vorlagen/" . $shopEntity->getLayout() . "/config/user/address.ini"; $filenameaddaddress =
'/data/www/old/application/design/vorlagen/' . $shopEntity->getLayout() . '/config/user/address.ini';
$handleaddaddress = fopen($filenameaddaddress, 'r'); $handleaddaddress = fopen($filenameaddaddress, 'r');
$txtaddaddress = fread($handleaddaddress, filesize($filenameaddaddress)); $txtaddaddress = fread($handleaddaddress, filesize($filenameaddaddress));
fclose($handleaddaddress); fclose($handleaddaddress);
} }
$builder $builder
->add('formularelogin', TextareaType::class, array( ->add('formularelogin', TextareaType::class, [
'label' => 'login ini', 'label' => 'login ini',
'data' => $txtlogin, 'data' => $txtlogin,
'required' => false, 'required' => false,
'attr' => array('rows' => 50, 'onclick' => "onchangeformulare('formularelogin');") 'attr' => ['rows' => 50, 'onclick' => "onchangeformulare('formularelogin');"],
)) ])
->add('formulareloginedit', HiddenType::class, array('required' => false, 'data' => 0)) ->add('formulareloginedit', HiddenType::class, ['required' => false, 'data' => 0])
->add('formulareregister', TextareaType::class, array( ->add('formulareregister', TextareaType::class, [
'label' => 'registercontact ini', 'label' => 'registercontact ini',
'data' => $txtregister, 'data' => $txtregister,
'required' => false, 'required' => false,
'attr' => array('rows' => 50, 'onclick' => "onchangeformulare('formulareregister');") 'attr' => ['rows' => 50, 'onclick' => "onchangeformulare('formulareregister');"],
)) ])
->add('formulareregisteredit', HiddenType::class, array('required' => false, 'data' => 0)) ->add('formulareregisteredit', HiddenType::class, ['required' => false, 'data' => 0])
->add('formularepass', TextareaType::class, array( ->add('formularepass', TextareaType::class, [
'label' => 'resetpassword ini', 'label' => 'resetpassword ini',
'data' => $txtpass, 'data' => $txtpass,
'required' => false, 'required' => false,
'attr' => array('rows' => 50, 'onclick' => "onchangeformulare('formularepass');") 'attr' => ['rows' => 50, 'onclick' => "onchangeformulare('formularepass');"],
)) ])
->add('formularepassedit', HiddenType::class, array('required' => false, 'data' => 0)) ->add('formularepassedit', HiddenType::class, ['required' => false, 'data' => 0])
->add('formulareaddress', TextareaType::class, array( ->add('formulareaddress', TextareaType::class, [
'label' => 'updatecontact ini', 'label' => 'updatecontact ini',
'data' => $txtaddress, 'data' => $txtaddress,
'required' => false, 'required' => false,
'attr' => array('rows' => 50, 'onclick' => "onchangeformulare('formulareaddress');") 'attr' => ['rows' => 50, 'onclick' => "onchangeformulare('formulareaddress');"],
)) ])
->add('formulareaddressedit', HiddenType::class, array('required' => false, 'data' => 0)) ->add('formulareaddressedit', HiddenType::class, ['required' => false, 'data' => 0])
->add('formulareaddaddress', TextareaType::class, array( ->add('formulareaddaddress', TextareaType::class, [
'label' => 'Address ini', 'label' => 'Address ini',
'data' => $txtaddaddress, 'data' => $txtaddaddress,
'required' => false, 'required' => false,
'attr' => array('rows' => 50, 'onclick' => "onchangeformulare('formulareaddaddress');") 'attr' => ['rows' => 50, 'onclick' => "onchangeformulare('formulareaddaddress');"],
)) ])
->add('formulareaddaddressedit', HiddenType::class, array('required' => false, 'data' => 0)) ->add('formulareaddaddressedit', HiddenType::class, ['required' => false, 'data' => 0]);
;
return $builder; return $builder;
} }
@ -142,7 +168,11 @@ if(isset($_POST["settings"]["bootstrap4Images"]["layout"])) {
/** @var Shop $shopEntity */ /** @var Shop $shopEntity */
$shopEntity = $this->options['shopEntity']; $shopEntity = $this->options['shopEntity'];
$layoutSettings = json_decode($shopEntity->getLayoutSettings(), true); $layoutSettings = json_decode($shopEntity->getLayoutSettings(), true);
$event->getForm()->get('bootstrap4General')->get('displayArticleCount')->setData($shopEntity->getDisplayArticleCount()); $event
->getForm()
->get('bootstrap4General')
->get('displayArticleCount')
->setData($shopEntity->getDisplayArticleCount());
$event->getForm()->get('bootstrap4General')->get('basketField1')->setData($shopEntity->getBasketfield1()); $event->getForm()->get('bootstrap4General')->get('basketField1')->setData($shopEntity->getBasketfield1());
$event->getForm()->get('bootstrap4General')->get('basketField2')->setData($shopEntity->getBasketfield2()); $event->getForm()->get('bootstrap4General')->get('basketField2')->setData($shopEntity->getBasketfield2());
$event->getForm()->get('bootstrap4General')->get('basketPosField1')->setData($shopEntity->getBasketposfield1()); $event->getForm()->get('bootstrap4General')->get('basketPosField1')->setData($shopEntity->getBasketposfield1());
@ -151,51 +181,88 @@ if(isset($_POST["settings"]["bootstrap4Images"]["layout"])) {
$event->getForm()->get('bootstrap4General')->get('displayDelivery')->setData($shopEntity->getDisplayDelivery()); $event->getForm()->get('bootstrap4General')->get('displayDelivery')->setData($shopEntity->getDisplayDelivery());
$event->getForm()->get('bootstrap4General')->get('layout')->setData($shopEntity->getLayout()); $event->getForm()->get('bootstrap4General')->get('layout')->setData($shopEntity->getLayout());
$event->getForm()->get('bootstrap4General')->get('customTemplates')->setData($shopEntity->isCustomTemplates()); $event->getForm()->get('bootstrap4General')->get('customTemplates')->setData($shopEntity->isCustomTemplates());
$event->getForm()->get('bootstrap4General')->get('googleanalyticscode')->setData($shopEntity->getGoogleanalyticscode()); $event
->getForm()
->get('bootstrap4General')
->get('googleanalyticscode')
->setData($shopEntity->getGoogleanalyticscode());
$event->getForm()->get('bootstrap4General')->get('defaultFunc')->setData($shopEntity->getDefaultFunc()); $event->getForm()->get('bootstrap4General')->get('defaultFunc')->setData($shopEntity->getDefaultFunc());
$event->getForm()->get('bootstrap4General')->get('defaultParam')->setData($shopEntity->getDefaultParam()); $event->getForm()->get('bootstrap4General')->get('defaultParam')->setData($shopEntity->getDefaultParam());
$event->getForm()->get('bootstrap4General')->get('templateDisplayProductsCrossselling')->setData($shopEntity->isTemplateDisplayProductsCrossselling()); $event
$event->getForm()->get('bootstrap4General')->get('templateDisplayUserApproval')->setData($shopEntity->isTemplateDisplayUserApproval()); ->getForm()
->get('bootstrap4General')
->get('templateDisplayProductsCrossselling')
->setData($shopEntity->isTemplateDisplayProductsCrossselling());
$event
->getForm()
->get('bootstrap4General')
->get('templateDisplayUserApproval')
->setData($shopEntity->isTemplateDisplayUserApproval());
} }
public function formPostSubmit(FormEvent $event) public function formPostSubmit(FormEvent $event)
{ {
/** @var Shop $shopEntity */ /** @var Shop $shopEntity */
$shopEntity = $this->options['shopEntity']; $shopEntity = $this->options['shopEntity'];
if($event->getForm()->get('bootstrap4Style')->get('write')->getData() == "1") { if ($event->getForm()->get('bootstrap4Style')->get('write')->getData() == '1') {
if($event->getForm()->get('bootstrap4Formulare')->get('formulareloginedit')->getData() == "1") { if ($event->getForm()->get('bootstrap4Formulare')->get('formulareloginedit')->getData() == '1') {
$filenamelogin = "/data/www/old/application/design/vorlagen/" . $_POST["settings"]["bootstrap4General"]["layout"] . "/config/user/login.ini"; $filenamelogin =
'/data/www/old/application/design/vorlagen/' .
$_POST['settings']['bootstrap4General']['layout'] .
'/config/user/login.ini';
$handlelogin = fopen($filenamelogin, 'w'); $handlelogin = fopen($filenamelogin, 'w');
fputs($handlelogin, $event->getForm()->get('bootstrap4Formulare')->get('formularelogin')->getData()); \fwrite($handlelogin, $event->getForm()->get('bootstrap4Formulare')->get('formularelogin')->getData());
fclose($handlelogin); fclose($handlelogin);
} }
if($event->getForm()->get('bootstrap4Formulare')->get('formulareregisteredit')->getData() == "1") { if ($event->getForm()->get('bootstrap4Formulare')->get('formulareregisteredit')->getData() == '1') {
$filenameregister = "/data/www/old/application/design/vorlagen/" . $_POST["settings"]["bootstrap4General"]["layout"] . "/config/user/registercontact.ini"; $filenameregister =
'/data/www/old/application/design/vorlagen/' .
$_POST['settings']['bootstrap4General']['layout'] .
'/config/user/registercontact.ini';
$handleregister = fopen($filenameregister, 'w'); $handleregister = fopen($filenameregister, 'w');
fputs($handleregister, $event->getForm()->get('bootstrap4Formulare')->get('formulareregister')->getData()); \fwrite(
$handleregister,
$event->getForm()->get('bootstrap4Formulare')->get('formulareregister')->getData(),
);
fclose($handleregister); fclose($handleregister);
} }
if($event->getForm()->get('bootstrap4Formulare')->get('formularepassedit')->getData() == "1") { if ($event->getForm()->get('bootstrap4Formulare')->get('formularepassedit')->getData() == '1') {
$filenamepass = "/data/www/old/application/design/vorlagen/" . $_POST["settings"]["bootstrap4General"]["layout"] . "/config/user/resetpassword.ini"; $filenamepass =
'/data/www/old/application/design/vorlagen/' .
$_POST['settings']['bootstrap4General']['layout'] .
'/config/user/resetpassword.ini';
$handlepass = fopen($filenamepass, 'w'); $handlepass = fopen($filenamepass, 'w');
fputs($handlepass, $event->getForm()->get('bootstrap4Formulare')->get('formularepass')->getData()); \fwrite($handlepass, $event->getForm()->get('bootstrap4Formulare')->get('formularepass')->getData());
fclose($handlepass); fclose($handlepass);
} }
if($event->getForm()->get('bootstrap4Formulare')->get('formulareaddressedit')->getData() == "1") { if ($event->getForm()->get('bootstrap4Formulare')->get('formulareaddressedit')->getData() == '1') {
$filenameaddress = "/data/www/old/application/design/vorlagen/" . $_POST["settings"]["bootstrap4General"]["layout"] . "/config/user/updatecontact.ini"; $filenameaddress =
'/data/www/old/application/design/vorlagen/' .
$_POST['settings']['bootstrap4General']['layout'] .
'/config/user/updatecontact.ini';
$handleaddress = fopen($filenameaddress, 'w'); $handleaddress = fopen($filenameaddress, 'w');
fputs($handleaddress, $event->getForm()->get('bootstrap4Formulare')->get('formulareaddress')->getData()); \fwrite(
$handleaddress,
$event->getForm()->get('bootstrap4Formulare')->get('formulareaddress')->getData(),
);
fclose($handleaddress); fclose($handleaddress);
} }
if($event->getForm()->get('bootstrap4Formulare')->get('formulareaddaddressedit')->getData() == "1") { if ($event->getForm()->get('bootstrap4Formulare')->get('formulareaddaddressedit')->getData() == '1') {
$filenameaddaddress = "/data/www/old/application/design/vorlagen/" . $_POST["settings"]["bootstrap4General"]["layout"] . "/config/user/address.ini"; $filenameaddaddress =
'/data/www/old/application/design/vorlagen/' .
$_POST['settings']['bootstrap4General']['layout'] .
'/config/user/address.ini';
$handleaddaddress = fopen($filenameaddaddress, 'w'); $handleaddaddress = fopen($filenameaddaddress, 'w');
fputs($handleaddaddress, $event->getForm()->get('bootstrap4Formulare')->get('formulareaddaddress')->getData()); \fwrite(
$handleaddaddress,
$event->getForm()->get('bootstrap4Formulare')->get('formulareaddaddress')->getData(),
);
fclose($handleaddaddress); fclose($handleaddaddress);
} }
} }
$shopEntity->setDisplayArticleCount($event->getForm()->get('bootstrap4General')->get('displayArticleCount')->getData()); $shopEntity->setDisplayArticleCount(
$event->getForm()->get('bootstrap4General')->get('displayArticleCount')->getData(),
);
$shopEntity->setBasketfield1($event->getForm()->get('bootstrap4General')->get('basketField1')->getData()); $shopEntity->setBasketfield1($event->getForm()->get('bootstrap4General')->get('basketField1')->getData());
$shopEntity->setBasketfield2($event->getForm()->get('bootstrap4General')->get('basketField2')->getData()); $shopEntity->setBasketfield2($event->getForm()->get('bootstrap4General')->get('basketField2')->getData());
$shopEntity->setBasketposfield1($event->getForm()->get('bootstrap4General')->get('basketPosField1')->getData()); $shopEntity->setBasketposfield1($event->getForm()->get('bootstrap4General')->get('basketPosField1')->getData());
@ -204,15 +271,21 @@ if(isset($_POST["settings"]["bootstrap4Images"]["layout"])) {
$shopEntity->setDisplayDelivery($event->getForm()->get('bootstrap4General')->get('displayDelivery')->getData()); $shopEntity->setDisplayDelivery($event->getForm()->get('bootstrap4General')->get('displayDelivery')->getData());
$shopEntity->setCustomTemplates($event->getForm()->get('bootstrap4General')->get('customTemplates')->getData()); $shopEntity->setCustomTemplates($event->getForm()->get('bootstrap4General')->get('customTemplates')->getData());
$shopEntity->setLayout($event->getForm()->get('bootstrap4General')->get('layout')->getData()); $shopEntity->setLayout($event->getForm()->get('bootstrap4General')->get('layout')->getData());
$shopEntity->setGoogleanalyticscode($event->getForm()->get('bootstrap4General')->get('googleanalyticscode')->getData()); $shopEntity->setGoogleanalyticscode(
$event->getForm()->get('bootstrap4General')->get('googleanalyticscode')->getData(),
);
$shopEntity->setDefaultFunc($event->getForm()->get('bootstrap4General')->get('defaultFunc')->getData()); $shopEntity->setDefaultFunc($event->getForm()->get('bootstrap4General')->get('defaultFunc')->getData());
$shopEntity->setDefaultParam($event->getForm()->get('bootstrap4General')->get('defaultParam')->getData()); $shopEntity->setDefaultParam($event->getForm()->get('bootstrap4General')->get('defaultParam')->getData());
$shopEntity->setTemplateDisplayProductsCrossselling($event->getForm()->get('bootstrap4General')->get('templateDisplayProductsCrossselling')->getData()); $shopEntity->setTemplateDisplayProductsCrossselling(
$shopEntity->setTemplateDisplayUserApproval($event->getForm()->get('bootstrap4General')->get('templateDisplayUserApproval')->getData()); $event->getForm()->get('bootstrap4General')->get('templateDisplayProductsCrossselling')->getData(),
);
$shopEntity->setTemplateDisplayUserApproval(
$event->getForm()->get('bootstrap4General')->get('templateDisplayUserApproval')->getData(),
);
} }
public function formPreSetData(FormEvent $event) public function formPreSetData(FormEvent $event)
{ {
}
}
}
}

View File

@ -5,15 +5,14 @@ namespace Plugin\System\PSC\Bootstrap4\Form\Field;
use DirectoryIterator; use DirectoryIterator;
use PSC\Shop\EntityBundle\Entity\Shop; use PSC\Shop\EntityBundle\Entity\Shop;
use PSC\System\PluginBundle\Form\Interfaces\Field; use PSC\System\PluginBundle\Form\Interfaces\Field;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Form\Extension\Core\Type\HiddenType; use Symfony\Component\Form\Extension\Core\Type\HiddenType;
use Symfony\Component\Form\Extension\Core\Type\TextareaType; use Symfony\Component\Form\Extension\Core\Type\TextareaType;
use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Form\FormEvent; use Symfony\Component\Form\FormEvent;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
class Images extends AbstractController implements Field class Images extends AbstractController implements Field
{ {
private $options; private $options;
public function getTemplate() public function getTemplate()
@ -31,13 +30,11 @@ class Images extends AbstractController implements Field
*/ */
public function formPreSubmit(FormEvent $event) public function formPreSubmit(FormEvent $event)
{ {
} }
public function buildForm(FormBuilderInterface $builder, array $options) public function buildForm(FormBuilderInterface $builder, array $options)
{ {
$txt = ""; $txt = '';
$this->options = $options; $this->options = $options;
/** @var Shop $shopEntity */ /** @var Shop $shopEntity */
@ -45,41 +42,54 @@ class Images extends AbstractController implements Field
$tempLayouts = []; $tempLayouts = [];
if ($shopEntity->isCustomTemplates() == 1) { if ($shopEntity->isCustomTemplates() == 1) {
foreach (new DirectoryIterator('/data/www/old/application/design/vorlagen') as $file) { foreach (new DirectoryIterator('/data/www/old/application/design/vorlagen') as $file) {
if ($file == '.' || $file == '..' || $file == 'config' || $file == '.svn' || $file == 'datapacks' || $file == '.DS_Store') { if (
$file == '.' ||
$file == '..' ||
$file == 'config' ||
$file == '.svn' ||
$file == 'datapacks' ||
$file == '.DS_Store'
) {
continue; continue;
} }
$tempLayouts[$file->getFileName()] = $file->getFileName(); $tempLayouts[$file->getFileName()] = $file->getFileName();
} }
} else { } else {
if (file_exists('/data/www/old/application/design/clients/' . $shopEntity->getUID())) { if (file_exists('/data/www/old/application/design/clients/' . $shopEntity->getUID())) {
foreach (new DirectoryIterator('/data/www/old/application/design/clients/' . $shopEntity->getUID()) as $file) { foreach (new DirectoryIterator('/data/www/old/application/design/clients/' .
if ($file == '.' || $file == '..' || $file == 'config' || $file == '.svn' || $file == 'datapacks' || $file == '.DS_Store') { $shopEntity->getUID()) as $file) {
if (
$file == '.' ||
$file == '..' ||
$file == 'config' ||
$file == '.svn' ||
$file == 'datapacks' ||
$file == '.DS_Store'
) {
continue; continue;
} }
$tempLayouts[$file->getFileName()] = $file->getFileName(); $tempLayouts[$file->getFileName()] = $file->getFileName();
} }
} }
} }
if(isset($_POST["settings"]["bootstrap4Images"]["layout"])) { if (isset($_POST['settings']['bootstrap4Images']['layout'])) {
header('location: /apps/backend/theme/settings'); header('location: /apps/backend/theme/settings');
//die();
} else { } else {
//copy("/data/www/old/public/styles/vorlagen/" . $shopEntity->getLayout() . "/bootstrap/css/style.css","/data/www/old/public/styles/vorlagen/" . $shopEntity->getLayout() . "/bootstrap/css/style_bakup.css"); $filename = '/data/www/old/application/design/vorlagen/' . $shopEntity->getLayout() . '/config/images.ini';
$filename = "/data/www/old/application/design/vorlagen/" . $shopEntity->getLayout() . "/config/images.ini"; $txt = '';
if (file_exists($filename)) {
$handle = fopen($filename, 'r'); $handle = fopen($filename, 'r');
$txt = fread($handle, filesize($filename)); $txt = fread($handle, filesize($filename));
fclose($handle); fclose($handle);
} }
}
$builder $builder->add('imagesini', TextareaType::class, [
->add('imagesini', TextareaType::class, array(
'label' => 'Images ini', 'label' => 'Images ini',
'data' => $txt, 'data' => $txt,
'required' => false, 'required' => false,
'attr' => array('rows' => 50, 'onclick' => "onchangeimages('imagesini');") 'attr' => ['rows' => 50, 'onclick' => "onchangeimages('imagesini');"],
)) ])->add('imagesiniedit', HiddenType::class, ['required' => false, 'data' => 0]);
->add('imagesiniedit', HiddenType::class, array('required' => false, 'data' => 0))
;
return $builder; return $builder;
} }
@ -94,7 +104,11 @@ if(isset($_POST["settings"]["bootstrap4Images"]["layout"])) {
/** @var Shop $shopEntity */ /** @var Shop $shopEntity */
$shopEntity = $this->options['shopEntity']; $shopEntity = $this->options['shopEntity'];
$layoutSettings = json_decode($shopEntity->getLayoutSettings(), true); $layoutSettings = json_decode($shopEntity->getLayoutSettings(), true);
$event->getForm()->get('bootstrap4General')->get('displayArticleCount')->setData($shopEntity->getDisplayArticleCount()); $event
->getForm()
->get('bootstrap4General')
->get('displayArticleCount')
->setData($shopEntity->getDisplayArticleCount());
$event->getForm()->get('bootstrap4General')->get('basketField1')->setData($shopEntity->getBasketfield1()); $event->getForm()->get('bootstrap4General')->get('basketField1')->setData($shopEntity->getBasketfield1());
$event->getForm()->get('bootstrap4General')->get('basketField2')->setData($shopEntity->getBasketfield2()); $event->getForm()->get('bootstrap4General')->get('basketField2')->setData($shopEntity->getBasketfield2());
$event->getForm()->get('bootstrap4General')->get('basketPosField1')->setData($shopEntity->getBasketposfield1()); $event->getForm()->get('bootstrap4General')->get('basketPosField1')->setData($shopEntity->getBasketposfield1());
@ -103,27 +117,43 @@ if(isset($_POST["settings"]["bootstrap4Images"]["layout"])) {
$event->getForm()->get('bootstrap4General')->get('displayDelivery')->setData($shopEntity->getDisplayDelivery()); $event->getForm()->get('bootstrap4General')->get('displayDelivery')->setData($shopEntity->getDisplayDelivery());
$event->getForm()->get('bootstrap4General')->get('layout')->setData($shopEntity->getLayout()); $event->getForm()->get('bootstrap4General')->get('layout')->setData($shopEntity->getLayout());
$event->getForm()->get('bootstrap4General')->get('customTemplates')->setData($shopEntity->isCustomTemplates()); $event->getForm()->get('bootstrap4General')->get('customTemplates')->setData($shopEntity->isCustomTemplates());
$event->getForm()->get('bootstrap4General')->get('googleanalyticscode')->setData($shopEntity->getGoogleanalyticscode()); $event
->getForm()
->get('bootstrap4General')
->get('googleanalyticscode')
->setData($shopEntity->getGoogleanalyticscode());
$event->getForm()->get('bootstrap4General')->get('defaultFunc')->setData($shopEntity->getDefaultFunc()); $event->getForm()->get('bootstrap4General')->get('defaultFunc')->setData($shopEntity->getDefaultFunc());
$event->getForm()->get('bootstrap4General')->get('defaultParam')->setData($shopEntity->getDefaultParam()); $event->getForm()->get('bootstrap4General')->get('defaultParam')->setData($shopEntity->getDefaultParam());
$event->getForm()->get('bootstrap4General')->get('templateDisplayProductsCrossselling')->setData($shopEntity->isTemplateDisplayProductsCrossselling()); $event
$event->getForm()->get('bootstrap4General')->get('templateDisplayUserApproval')->setData($shopEntity->isTemplateDisplayUserApproval()); ->getForm()
->get('bootstrap4General')
->get('templateDisplayProductsCrossselling')
->setData($shopEntity->isTemplateDisplayProductsCrossselling());
$event
->getForm()
->get('bootstrap4General')
->get('templateDisplayUserApproval')
->setData($shopEntity->isTemplateDisplayUserApproval());
} }
public function formPostSubmit(FormEvent $event) public function formPostSubmit(FormEvent $event)
{ {
/** @var Shop $shopEntity */ /** @var Shop $shopEntity */
$shopEntity = $this->options['shopEntity']; $shopEntity = $this->options['shopEntity'];
if($event->getForm()->get('bootstrap4Style')->get('write')->getData() == "1") { if ($event->getForm()->get('bootstrap4Style')->get('write')->getData() == '1') {
if($event->getForm()->get('bootstrap4Images')->get('imagesiniedit')->getData() == "1") { if ($event->getForm()->get('bootstrap4Images')->get('imagesiniedit')->getData() == '1') {
$filename = "/data/www/old/application/design/vorlagen/" . $_POST["settings"]["bootstrap4General"]["layout"] . "/config/images.ini"; $filename =
'/data/www/old/application/design/vorlagen/' .
$_POST['settings']['bootstrap4General']['layout'] .
'/config/images.ini';
$handle = fopen($filename, 'w'); $handle = fopen($filename, 'w');
fputs($handle, $event->getForm()->get('bootstrap4Images')->get('imagesini')->getData()); \fwrite($handle, $event->getForm()->get('bootstrap4Images')->get('imagesini')->getData());
fclose($handle); fclose($handle);
} }
} }
$shopEntity->setDisplayArticleCount($event->getForm()->get('bootstrap4General')->get('displayArticleCount')->getData()); $shopEntity->setDisplayArticleCount(
$event->getForm()->get('bootstrap4General')->get('displayArticleCount')->getData(),
);
$shopEntity->setBasketfield1($event->getForm()->get('bootstrap4General')->get('basketField1')->getData()); $shopEntity->setBasketfield1($event->getForm()->get('bootstrap4General')->get('basketField1')->getData());
$shopEntity->setBasketfield2($event->getForm()->get('bootstrap4General')->get('basketField2')->getData()); $shopEntity->setBasketfield2($event->getForm()->get('bootstrap4General')->get('basketField2')->getData());
$shopEntity->setBasketposfield1($event->getForm()->get('bootstrap4General')->get('basketPosField1')->getData()); $shopEntity->setBasketposfield1($event->getForm()->get('bootstrap4General')->get('basketPosField1')->getData());
@ -132,15 +162,21 @@ if(isset($_POST["settings"]["bootstrap4Images"]["layout"])) {
$shopEntity->setDisplayDelivery($event->getForm()->get('bootstrap4General')->get('displayDelivery')->getData()); $shopEntity->setDisplayDelivery($event->getForm()->get('bootstrap4General')->get('displayDelivery')->getData());
$shopEntity->setCustomTemplates($event->getForm()->get('bootstrap4General')->get('customTemplates')->getData()); $shopEntity->setCustomTemplates($event->getForm()->get('bootstrap4General')->get('customTemplates')->getData());
$shopEntity->setLayout($event->getForm()->get('bootstrap4General')->get('layout')->getData()); $shopEntity->setLayout($event->getForm()->get('bootstrap4General')->get('layout')->getData());
$shopEntity->setGoogleanalyticscode($event->getForm()->get('bootstrap4General')->get('googleanalyticscode')->getData()); $shopEntity->setGoogleanalyticscode(
$event->getForm()->get('bootstrap4General')->get('googleanalyticscode')->getData(),
);
$shopEntity->setDefaultFunc($event->getForm()->get('bootstrap4General')->get('defaultFunc')->getData()); $shopEntity->setDefaultFunc($event->getForm()->get('bootstrap4General')->get('defaultFunc')->getData());
$shopEntity->setDefaultParam($event->getForm()->get('bootstrap4General')->get('defaultParam')->getData()); $shopEntity->setDefaultParam($event->getForm()->get('bootstrap4General')->get('defaultParam')->getData());
$shopEntity->setTemplateDisplayProductsCrossselling($event->getForm()->get('bootstrap4General')->get('templateDisplayProductsCrossselling')->getData()); $shopEntity->setTemplateDisplayProductsCrossselling(
$shopEntity->setTemplateDisplayUserApproval($event->getForm()->get('bootstrap4General')->get('templateDisplayUserApproval')->getData()); $event->getForm()->get('bootstrap4General')->get('templateDisplayProductsCrossselling')->getData(),
);
$shopEntity->setTemplateDisplayUserApproval(
$event->getForm()->get('bootstrap4General')->get('templateDisplayUserApproval')->getData(),
);
} }
public function formPreSetData(FormEvent $event) public function formPreSetData(FormEvent $event)
{ {
}
}
}
}

View File

@ -2682,7 +2682,6 @@ class BasketController extends TP_Controller_Action
)); ));
if ( if (
count($creditSystemArticleGroupId) == 0 && count($creditSystemArticleId) == 0 ||
in_array($article->id, $creditSystemArticleId) || in_array($article->id, $creditSystemArticleId) ||
count(array_intersect($articleGroups, $creditSystemArticleGroupId)) > 0 count(array_intersect($articleGroups, $creditSystemArticleGroupId)) > 0
) { ) {
@ -2880,7 +2879,7 @@ class BasketController extends TP_Controller_Action
if ($versand > 0 || $versandpos > 0) { if ($versand > 0 || $versandpos > 0) {
$versand = $versand + $versandpos; $versand = $versand + $versandpos;
} }
if ($creditSystemRest > 0 && $creditSystemShipping) { if (false && $creditSystemRest > 0 && $creditSystemShipping) {
$mwert = $mwert =
$mwert + round(($versand / 100) * ((float) str_replace('%', '', $shippingtype['mwert'])), 2); $mwert + round(($versand / 100) * ((float) str_replace('%', '', $shippingtype['mwert'])), 2);
if ( if (
@ -3028,7 +3027,7 @@ class BasketController extends TP_Controller_Action
$versand = $versand + $versandpos; $versand = $versand + $versandpos;
} }
if ($creditSystemRest > 0 && $creditSystemShipping) { if (false && $creditSystemRest > 0 && $creditSystemShipping) {
$mwert = $mwert =
$mwert + round(($versand / 100) * ((float) str_replace('%', '', $shippingtype['mwert'])), 2); $mwert + round(($versand / 100) * ((float) str_replace('%', '', $shippingtype['mwert'])), 2);
if ( if (
@ -3239,7 +3238,7 @@ class BasketController extends TP_Controller_Action
$this->view->paymentwert = $paymenttype['wert']; $this->view->paymentwert = $paymenttype['wert'];
} }
} }
if ($creditSystemRest > 0 && $creditSystemPayment) { if (false && $creditSystemRest > 0 && $creditSystemPayment) {
$mwert = $mwert + round(($this->view->paymentwert / 100) * $paymenttype['mwert'], 2); $mwert = $mwert + round(($this->view->paymentwert / 100) * $paymenttype['mwert'], 2);
if ($creditSystemRest > round(($this->view->paymentwert / 100) * $paymenttype['mwert'], 2)) { if ($creditSystemRest > round(($this->view->paymentwert / 100) * $paymenttype['mwert'], 2)) {
$basket->setGutscheinAbzug( $basket->setGutscheinAbzug(
@ -3294,15 +3293,18 @@ class BasketController extends TP_Controller_Action
$this->view->articles = $temp; $this->view->articles = $temp;
$this->_helper->layout->setLayout('default'); $this->_helper->layout->setLayout('default');
$summenUeberAlleSteuersaetze = $mwertalle;
$tmpMwertAlle = []; $tmpMwertAlle = [];
foreach ($mwertalle as $key => $wert) { foreach ($mwertalle as $key => $wert) {
$tmpMwertAlle[$key] = round(($wert / 100) * ((float) $key), 2); $tmpMwertAlle[$key] = round(($wert / 100) * ((float) $key), 2);
} }
$mwertalle = $tmpMwertAlle; $mwertalle = $tmpMwertAlle;
foreach ($basket->getGutscheinAbzugMwSt() as $key => $value) { var_dump($summenUeberAlleSteuersaetze);
$mwertalle[$key] = $mwertalle[$key] - $value; $voucherMwert = [];
foreach ($summenUeberAlleSteuersaetzer as $key => $value) {
} }
$this->view->productbruttogutschein = 0; $this->view->productbruttogutschein = 0;
if (count($this->view->articles) == 0) { if (count($this->view->articles) == 0) {
$this->view->netto = 0; $this->view->netto = 0;
@ -3337,6 +3339,7 @@ class BasketController extends TP_Controller_Action
$this->view->paymentwertbrutto, $this->view->paymentwertbrutto,
$this->view->versandbrutto, $this->view->versandbrutto,
$mwertalle, $mwertalle,
$voucherMwert,
); );
} }

View File

@ -1,4 +1,5 @@
<?php <?php
class TP_Basket class TP_Basket
{ {
/** /**
@ -17,7 +18,6 @@ class TP_Basket
public function setTempProduct($article, $options, $netto) public function setTempProduct($article, $options, $netto)
{ {
if ($this->_Warenkorb->isLocked()) { if ($this->_Warenkorb->isLocked()) {
$this->_Warenkorb->unLock(); $this->_Warenkorb->unLock();
} }
@ -28,9 +28,9 @@ class TP_Basket
$this->_Warenkorb->LastTempProductId = $article->uuid; $this->_Warenkorb->LastTempProductId = $article->uuid;
$this->_Warenkorb->lock(); $this->_Warenkorb->lock();
} }
public function clearTempProduct() public function clearTempProduct()
{ {
if ($this->_Warenkorb->isLocked()) { if ($this->_Warenkorb->isLocked()) {
$this->_Warenkorb->unLock(); $this->_Warenkorb->unLock();
} }
@ -39,7 +39,6 @@ class TP_Basket
$this->_Warenkorb->lock(); $this->_Warenkorb->lock();
} }
public static function getBasket() public static function getBasket()
{ {
return new TP_Basket(); return new TP_Basket();
@ -48,8 +47,7 @@ class TP_Basket
public function getWeight() public function getWeight()
{ {
$weight = 0; $weight = 0;
foreach ( $this->_Warenkorb->Articles as $Artikel ) foreach ($this->_Warenkorb->Articles as $Artikel) {
{
$weight = $weight + $Artikel->getWeight(); $weight = $weight + $Artikel->getWeight();
} }
return $weight; return $weight;
@ -58,8 +56,7 @@ class TP_Basket
public function getWeightLargestOnRoll() public function getWeightLargestOnRoll()
{ {
$weight = 0; $weight = 0;
foreach ( $this->_Warenkorb->Articles as $Artikel ) foreach ($this->_Warenkorb->Articles as $Artikel) {
{
if ($weight == 0 || $weight < $Artikel->getWeight()) { if ($weight == 0 || $weight < $Artikel->getWeight()) {
$weight = $Artikel->getWeight(); $weight = $Artikel->getWeight();
} }
@ -76,6 +73,7 @@ class TP_Basket
$this->_Warenkorb->LastTempProductId = $basketArticle->getArticleId(); $this->_Warenkorb->LastTempProductId = $basketArticle->getArticleId();
$this->_Warenkorb->lock(); $this->_Warenkorb->lock();
} }
/** /**
* Gibt das Basket Item * Gibt das Basket Item
* *
@ -94,7 +92,6 @@ class TP_Basket
} }
if (!isset($this->_Warenkorb->TempProduct[$uuid])) { if (!isset($this->_Warenkorb->TempProduct[$uuid])) {
if ($this->_Warenkorb->isLocked()) { if ($this->_Warenkorb->isLocked()) {
$this->_Warenkorb->unLock(); $this->_Warenkorb->unLock();
} }
@ -102,7 +99,6 @@ class TP_Basket
$this->_Warenkorb->TempProduct[$uuid] = new TP_Basket_Item(); $this->_Warenkorb->TempProduct[$uuid] = new TP_Basket_Item();
$this->_Warenkorb->LastTempProductId = $uuid; $this->_Warenkorb->LastTempProductId = $uuid;
$this->_Warenkorb->lock(); $this->_Warenkorb->lock();
} }
if (isset($this->_Warenkorb->TempProduct[$this->_Warenkorb->LastTempProductId])) { if (isset($this->_Warenkorb->TempProduct[$this->_Warenkorb->LastTempProductId])) {
if ($this->_Warenkorb->isLocked()) { if ($this->_Warenkorb->isLocked()) {
@ -113,6 +109,7 @@ class TP_Basket
} }
return $this->_Warenkorb->TempProduct[$uuid]; return $this->_Warenkorb->TempProduct[$uuid];
} }
/** /**
* Konstruiert das Model für den Warenkorb * Konstruiert das Model für den Warenkorb
* *
@ -129,7 +126,6 @@ class TP_Basket
$this->_Warenkorb->lock(); $this->_Warenkorb->lock();
} }
/** /**
* Fuegt einen Artikel hinzu * Fuegt einen Artikel hinzu
* *
@ -166,7 +162,10 @@ class TP_Basket
if ($this->_Warenkorb->isLocked()) { if ($this->_Warenkorb->isLocked()) {
$this->_Warenkorb->unLock(); $this->_Warenkorb->unLock();
} }
$this->_Warenkorb->Articles->updateItem($this->_Warenkorb->TempProduct[$uuid]->getInLoad(), $this->_Warenkorb->TempProduct[$uuid]); $this->_Warenkorb->Articles->updateItem(
$this->_Warenkorb->TempProduct[$uuid]->getInLoad(),
$this->_Warenkorb->TempProduct[$uuid],
);
//Optionen eintragen //Optionen eintragen
$this->_Warenkorb->TempProduct[$uuid] = new TP_Basket_Item(); $this->_Warenkorb->TempProduct[$uuid] = new TP_Basket_Item();
@ -203,6 +202,7 @@ class TP_Basket
$this->_Warenkorb->lock(); $this->_Warenkorb->lock();
return true; return true;
} }
public function getPaymenttype() public function getPaymenttype()
{ {
// unlocking read-only lock // unlocking read-only lock
@ -214,6 +214,7 @@ class TP_Basket
$this->_Warenkorb->lock(); $this->_Warenkorb->lock();
return $paymentid; return $paymentid;
} }
public function setShippingtype($shippingid) public function setShippingtype($shippingid)
{ {
// unlocking read-only lock // unlocking read-only lock
@ -225,6 +226,7 @@ class TP_Basket
$this->_Warenkorb->lock(); $this->_Warenkorb->lock();
return true; return true;
} }
public function getShippingtype() public function getShippingtype()
{ {
// unlocking read-only lock // unlocking read-only lock
@ -236,6 +238,7 @@ class TP_Basket
$this->_Warenkorb->lock(); $this->_Warenkorb->lock();
return $shippingid; return $shippingid;
} }
/** /**
* L<EFBFBD>scht einen Artikel aus dem Warenkorb * L<EFBFBD>scht einen Artikel aus dem Warenkorb
* *
@ -254,6 +257,7 @@ class TP_Basket
$this->_Warenkorb->lock(); $this->_Warenkorb->lock();
return true; return true;
} }
/** /**
* Gibt einige Informationen <EFBFBD>ber den Warenkorb zur<EFBFBD>ck * Gibt einige Informationen <EFBFBD>ber den Warenkorb zur<EFBFBD>ck
* *
@ -267,43 +271,39 @@ class TP_Basket
$ArtikelAnzahl = $this->_Warenkorb->ArtikelAnzahl; $ArtikelAnzahl = $this->_Warenkorb->ArtikelAnzahl;
if ($ArtikelAnzahl < 1) { if ($ArtikelAnzahl < 1) {
return array( return array(
'WarenkorbPreis' => $WarenkorbPreis,
"WarenkorbPreis" => $WarenkorbPreis , 'Artikelanzahl' => $ArtikelAnzahl,
"Artikelanzahl" => $ArtikelAnzahl
); );
} } else {
else foreach ($this->_Warenkorb->Artikel as $Artikel) {
{
foreach ( $this->_Warenkorb->Artikel as $Artikel )
{
// DB-Prefix & Adapter auslesen // DB-Prefix & Adapter auslesen
$db = Zend_registry::get('db'); $db = Zend_registry::get('db');
$prefix = Zend_Registry::get('config')->db->prefix; $prefix = Zend_Registry::get('config')->db->prefix;
//Zend_Db_Select aufbauen //Zend_Db_Select aufbauen
//Wir joinen die tables von Hand zusammen da dies einfacher ist :) //Wir joinen die tables von Hand zusammen da dies einfacher ist :)
$select = $db->select()->from($prefix . '_shop_artikel', 'shop_artikel_preis')->where('shop_artikel_id = "' . $this->_Warenkorb->Artikel["ArtikelID"] . '"'); $select = $db
->select()
->from($prefix . '_shop_artikel', 'shop_artikel_preis')
->where('shop_artikel_id = "' . $this->_Warenkorb->Artikel['ArtikelID'] . '"');
//Query abschicken //Query abschicken
$stmt = $db->query($select); $stmt = $db->query($select);
$result = $stmt->fetchOne(); $result = $stmt->fetchOne();
$WarenkorbPreis += $result->shop_artikel_preis * $Artikel["Anzahl"]; $WarenkorbPreis += $result->shop_artikel_preis * $Artikel['Anzahl'];
} }
} }
return array( return array(
'WarenkorbPreis' => $WarenkorbPreis,
"WarenkorbPreis" => $WarenkorbPreis , 'Artikelanzahl' => $ArtikelAnzahl,
"Artikelanzahl" => $ArtikelAnzahl
); );
} }
public function checkIsLayouterIdInUse($id) public function checkIsLayouterIdInUse($id)
{ {
foreach ($this->_Warenkorb->Articles as $article) { foreach ($this->_Warenkorb->Articles as $article) {
if ($id == $article->getLayouterId()) { if ($id == $article->getLayouterId()) {
return true; return true;
} }
} }
} }
/** /**
@ -315,18 +315,22 @@ class TP_Basket
{ {
return $this->_Warenkorb->Articles; return $this->_Warenkorb->Articles;
} }
public function getBasketArtikel($uuid) public function getBasketArtikel($uuid)
{ {
return $this->_Warenkorb->Articles->getItemById($uuid); return $this->_Warenkorb->Articles->getItemById($uuid);
} }
public function getBasketArtikelId($uuid, $getKey = false) public function getBasketArtikelId($uuid, $getKey = false)
{ {
return $this->_Warenkorb->Articles->getItemByArticleId($uuid, $getKey); return $this->_Warenkorb->Articles->getItemByArticleId($uuid, $getKey);
} }
public function getAllCount() public function getAllCount()
{ {
return $this->_Warenkorb->Articles->count(); return $this->_Warenkorb->Articles->count();
} }
public function setPreisNetto($preis) public function setPreisNetto($preis)
{ {
if ($this->_Warenkorb->isLocked()) { if ($this->_Warenkorb->isLocked()) {
@ -336,6 +340,7 @@ class TP_Basket
//Namespace wieder sperren //Namespace wieder sperren
$this->_Warenkorb->lock(); $this->_Warenkorb->lock();
} }
public function setGutschein($id) public function setGutschein($id)
{ {
if ($this->_Warenkorb->isLocked()) { if ($this->_Warenkorb->isLocked()) {
@ -345,6 +350,7 @@ class TP_Basket
//Namespace wieder sperren //Namespace wieder sperren
$this->_Warenkorb->lock(); $this->_Warenkorb->lock();
} }
public function setGutscheinAbzug($value) public function setGutscheinAbzug($value)
{ {
if ($this->_Warenkorb->isLocked()) { if ($this->_Warenkorb->isLocked()) {
@ -400,6 +406,7 @@ class TP_Basket
//Namespace wieder sperren //Namespace wieder sperren
$this->_Warenkorb->lock(); $this->_Warenkorb->lock();
} }
public function setVersandkosten($value) public function setVersandkosten($value)
{ {
if ($this->_Warenkorb->isLocked()) { if ($this->_Warenkorb->isLocked()) {
@ -409,6 +416,7 @@ class TP_Basket
//Namespace wieder sperren //Namespace wieder sperren
$this->_Warenkorb->lock(); $this->_Warenkorb->lock();
} }
public function getVersandkosten() public function getVersandkosten()
{ {
if ($this->_Warenkorb->isLocked()) { if ($this->_Warenkorb->isLocked()) {
@ -438,6 +446,7 @@ class TP_Basket
//Namespace wieder sperren //Namespace wieder sperren
$this->_Warenkorb->lock(); $this->_Warenkorb->lock();
} }
public function getZahlkosten() public function getZahlkosten()
{ {
if ($this->_Warenkorb->isLocked()) { if ($this->_Warenkorb->isLocked()) {
@ -448,6 +457,7 @@ class TP_Basket
$this->_Warenkorb->lock(); $this->_Warenkorb->lock();
return $ids; return $ids;
} }
public function getGutschein() public function getGutschein()
{ {
if ($this->_Warenkorb->isLocked()) { if ($this->_Warenkorb->isLocked()) {
@ -458,6 +468,7 @@ class TP_Basket
$this->_Warenkorb->lock(); $this->_Warenkorb->lock();
return $ids; return $ids;
} }
public function getGutscheinAbzug() public function getGutscheinAbzug()
{ {
if ($this->_Warenkorb->isLocked()) { if ($this->_Warenkorb->isLocked()) {
@ -511,6 +522,7 @@ class TP_Basket
//Namespace wieder sperren //Namespace wieder sperren
$this->_Warenkorb->lock(); $this->_Warenkorb->lock();
} }
public function setPreisBrutto($preis) public function setPreisBrutto($preis)
{ {
if ($this->_Warenkorb->isLocked()) { if ($this->_Warenkorb->isLocked()) {
@ -520,6 +532,7 @@ class TP_Basket
//Namespace wieder sperren //Namespace wieder sperren
$this->_Warenkorb->lock(); $this->_Warenkorb->lock();
} }
public function getPreisNetto() public function getPreisNetto()
{ {
if ($this->_Warenkorb->isLocked()) { if ($this->_Warenkorb->isLocked()) {
@ -530,6 +543,7 @@ class TP_Basket
$this->_Warenkorb->lock(); $this->_Warenkorb->lock();
return $preis; return $preis;
} }
public function getPreisSteuer() public function getPreisSteuer()
{ {
if ($this->_Warenkorb->isLocked()) { if ($this->_Warenkorb->isLocked()) {
@ -540,6 +554,7 @@ class TP_Basket
$this->_Warenkorb->lock(); $this->_Warenkorb->lock();
return $steuer; return $steuer;
} }
public function getPreisBrutto() public function getPreisBrutto()
{ {
if ($this->_Warenkorb->isLocked()) { if ($this->_Warenkorb->isLocked()) {
@ -550,6 +565,7 @@ class TP_Basket
$this->_Warenkorb->lock(); $this->_Warenkorb->lock();
return $brutto; return $brutto;
} }
public function getBasketField1() public function getBasketField1()
{ {
if ($this->_Warenkorb->isLocked()) { if ($this->_Warenkorb->isLocked()) {
@ -560,6 +576,7 @@ class TP_Basket
$this->_Warenkorb->lock(); $this->_Warenkorb->lock();
return $bs1; return $bs1;
} }
public function setBasketField1($bs1) public function setBasketField1($bs1)
{ {
if ($this->_Warenkorb->isLocked()) { if ($this->_Warenkorb->isLocked()) {
@ -569,6 +586,7 @@ class TP_Basket
//Namespace wieder sperren //Namespace wieder sperren
$this->_Warenkorb->lock(); $this->_Warenkorb->lock();
} }
public function getBasketField2() public function getBasketField2()
{ {
if ($this->_Warenkorb->isLocked()) { if ($this->_Warenkorb->isLocked()) {
@ -579,6 +597,7 @@ class TP_Basket
$this->_Warenkorb->lock(); $this->_Warenkorb->lock();
return $bs2; return $bs2;
} }
public function setBasketField2($bs2) public function setBasketField2($bs2)
{ {
if ($this->_Warenkorb->isLocked()) { if ($this->_Warenkorb->isLocked()) {
@ -588,6 +607,7 @@ class TP_Basket
//Namespace wieder sperren //Namespace wieder sperren
$this->_Warenkorb->lock(); $this->_Warenkorb->lock();
} }
public function getPaymentZusatz() public function getPaymentZusatz()
{ {
if ($this->_Warenkorb->isLocked()) { if ($this->_Warenkorb->isLocked()) {
@ -598,6 +618,7 @@ class TP_Basket
$this->_Warenkorb->lock(); $this->_Warenkorb->lock();
return $bs2; return $bs2;
} }
public function setPaymentZusatz($bs2) public function setPaymentZusatz($bs2)
{ {
if ($this->_Warenkorb->isLocked()) { if ($this->_Warenkorb->isLocked()) {
@ -607,6 +628,7 @@ class TP_Basket
//Namespace wieder sperren //Namespace wieder sperren
$this->_Warenkorb->lock(); $this->_Warenkorb->lock();
} }
public function getBic() public function getBic()
{ {
if ($this->_Warenkorb->isLocked()) { if ($this->_Warenkorb->isLocked()) {
@ -617,6 +639,7 @@ class TP_Basket
$this->_Warenkorb->lock(); $this->_Warenkorb->lock();
return $bs2; return $bs2;
} }
public function setBic($bs2) public function setBic($bs2)
{ {
if ($this->_Warenkorb->isLocked()) { if ($this->_Warenkorb->isLocked()) {
@ -626,6 +649,7 @@ class TP_Basket
//Namespace wieder sperren //Namespace wieder sperren
$this->_Warenkorb->lock(); $this->_Warenkorb->lock();
} }
public function getIban() public function getIban()
{ {
if ($this->_Warenkorb->isLocked()) { if ($this->_Warenkorb->isLocked()) {
@ -636,15 +660,17 @@ class TP_Basket
$this->_Warenkorb->lock(); $this->_Warenkorb->lock();
return $bs2; return $bs2;
} }
public function setIban($bs2) public function setIban($bs2)
{ {
if ($this->_Warenkorb->isLocked()) { if ($this->_Warenkorb->isLocked()) {
$this->_Warenkorb->unLock(); $this->_Warenkorb->unLock();
} }
$this->_Warenkorb->iban = str_replace(" ", "", $bs2); $this->_Warenkorb->iban = str_replace(' ', '', $bs2);
//Namespace wieder sperren //Namespace wieder sperren
$this->_Warenkorb->lock(); $this->_Warenkorb->lock();
} }
public function setDeliveryIsSame($val) public function setDeliveryIsSame($val)
{ {
if ($this->_Warenkorb->isLocked()) { if ($this->_Warenkorb->isLocked()) {
@ -654,6 +680,7 @@ class TP_Basket
//Namespace wieder sperren //Namespace wieder sperren
$this->_Warenkorb->lock(); $this->_Warenkorb->lock();
} }
public function setDelivery($val) public function setDelivery($val)
{ {
if ($this->_Warenkorb->isLocked()) { if ($this->_Warenkorb->isLocked()) {
@ -663,6 +690,7 @@ class TP_Basket
//Namespace wieder sperren //Namespace wieder sperren
$this->_Warenkorb->lock(); $this->_Warenkorb->lock();
} }
public function setInvoiceIsSame($val) public function setInvoiceIsSame($val)
{ {
if ($this->_Warenkorb->isLocked()) { if ($this->_Warenkorb->isLocked()) {
@ -672,6 +700,7 @@ class TP_Basket
//Namespace wieder sperren //Namespace wieder sperren
$this->_Warenkorb->lock(); $this->_Warenkorb->lock();
} }
public function setInvoice($val) public function setInvoice($val)
{ {
if ($this->_Warenkorb->isLocked()) { if ($this->_Warenkorb->isLocked()) {
@ -681,6 +710,7 @@ class TP_Basket
//Namespace wieder sperren //Namespace wieder sperren
$this->_Warenkorb->lock(); $this->_Warenkorb->lock();
} }
public function setSenderIsSame($val) public function setSenderIsSame($val)
{ {
if ($this->_Warenkorb->isLocked()) { if ($this->_Warenkorb->isLocked()) {
@ -690,6 +720,7 @@ class TP_Basket
//Namespace wieder sperren //Namespace wieder sperren
$this->_Warenkorb->lock(); $this->_Warenkorb->lock();
} }
public function setSender($val) public function setSender($val)
{ {
if ($this->_Warenkorb->isLocked()) { if ($this->_Warenkorb->isLocked()) {
@ -699,14 +730,17 @@ class TP_Basket
//Namespace wieder sperren //Namespace wieder sperren
$this->_Warenkorb->lock(); $this->_Warenkorb->lock();
} }
public function getDeliveryIsSame() public function getDeliveryIsSame()
{ {
return $this->_Warenkorb->deliverysame; return $this->_Warenkorb->deliverysame;
} }
public function getPaymentRef() public function getPaymentRef()
{ {
return $this->_Warenkorb->paymentRef; return $this->_Warenkorb->paymentRef;
} }
public function setPaymentRef($value) public function setPaymentRef($value)
{ {
if ($this->_Warenkorb->isLocked()) { if ($this->_Warenkorb->isLocked()) {
@ -721,6 +755,7 @@ class TP_Basket
{ {
return $this->_Warenkorb->paymentGateway; return $this->_Warenkorb->paymentGateway;
} }
public function setPaymentGateway($value) public function setPaymentGateway($value)
{ {
if ($this->_Warenkorb->isLocked()) { if ($this->_Warenkorb->isLocked()) {
@ -730,30 +765,37 @@ class TP_Basket
//Namespace wieder sperren //Namespace wieder sperren
$this->_Warenkorb->lock(); $this->_Warenkorb->lock();
} }
public function getDelivery() public function getDelivery()
{ {
return $this->_Warenkorb->delivery; return $this->_Warenkorb->delivery;
} }
public function getInvoiceIsSame() public function getInvoiceIsSame()
{ {
return $this->_Warenkorb->invoicesame; return $this->_Warenkorb->invoicesame;
} }
public function getInvoice() public function getInvoice()
{ {
return $this->_Warenkorb->invoice; return $this->_Warenkorb->invoice;
} }
public function getSenderIsSame() public function getSenderIsSame()
{ {
return $this->_Warenkorb->sendersame; return $this->_Warenkorb->sendersame;
} }
public function getSender() public function getSender()
{ {
return $this->_Warenkorb->sender; return $this->_Warenkorb->sender;
} }
public function getToken() public function getToken()
{ {
return $this->_Warenkorb->token; return $this->_Warenkorb->token;
} }
public function setToken($value) public function setToken($value)
{ {
if ($this->_Warenkorb->isLocked()) { if ($this->_Warenkorb->isLocked()) {
@ -768,6 +810,7 @@ class TP_Basket
{ {
return $this->_Warenkorb->plz; return $this->_Warenkorb->plz;
} }
public function getOfferNumber() public function getOfferNumber()
{ {
return $this->_Warenkorb->offerNumber; return $this->_Warenkorb->offerNumber;
@ -797,6 +840,7 @@ class TP_Basket
{ {
return $this->_Warenkorb->delivery_plz; return $this->_Warenkorb->delivery_plz;
} }
public function setDeliveryPLZ($value) public function setDeliveryPLZ($value)
{ {
if ($this->_Warenkorb->isLocked()) { if ($this->_Warenkorb->isLocked()) {
@ -806,6 +850,7 @@ class TP_Basket
//Namespace wieder sperren //Namespace wieder sperren
$this->_Warenkorb->lock(); $this->_Warenkorb->lock();
} }
public function setDeliveryCountry($value) public function setDeliveryCountry($value)
{ {
if ($this->_Warenkorb->isLocked()) { if ($this->_Warenkorb->isLocked()) {
@ -815,6 +860,7 @@ class TP_Basket
//Namespace wieder sperren //Namespace wieder sperren
$this->_Warenkorb->lock(); $this->_Warenkorb->lock();
} }
public function setDeliveryUstId($value) public function setDeliveryUstId($value)
{ {
if ($this->_Warenkorb->isLocked()) { if ($this->_Warenkorb->isLocked()) {
@ -824,17 +870,25 @@ class TP_Basket
//Namespace wieder sperren //Namespace wieder sperren
$this->_Warenkorb->lock(); $this->_Warenkorb->lock();
} }
public function getDeliveryCountry() public function getDeliveryCountry()
{ {
return $this->_Warenkorb->delivery_country; return $this->_Warenkorb->delivery_country;
} }
public function getDeliveryUstId() public function getDeliveryUstId()
{ {
return $this->_Warenkorb->delivery_ustid; return $this->_Warenkorb->delivery_ustid;
} }
public function setAdditional($productpreisNetto, $productpreisBrutto, $zahlart, $versandart, $mwert) public function setAdditional(
{ $productpreisNetto,
$productpreisBrutto,
$zahlart,
$versandart,
$mwert,
$gutscheinMwert,
) {
if ($this->_Warenkorb->isLocked()) { if ($this->_Warenkorb->isLocked()) {
$this->_Warenkorb->unLock(); $this->_Warenkorb->unLock();
} }
@ -843,6 +897,7 @@ class TP_Basket
$this->_Warenkorb->ZahlkostenBrutto = $zahlart; $this->_Warenkorb->ZahlkostenBrutto = $zahlart;
$this->_Warenkorb->VersandkostenBrutto = $versandart; $this->_Warenkorb->VersandkostenBrutto = $versandart;
$this->_Warenkorb->mwert = $mwert; $this->_Warenkorb->mwert = $mwert;
$this->_Warenkorb->vouchermwert = $vouchermwert;
//Namespace wieder sperren //Namespace wieder sperren
$this->_Warenkorb->lock(); $this->_Warenkorb->lock();
} }
@ -896,10 +951,12 @@ class TP_Basket
{ {
if (Zend_Auth::getInstance()->hasIdentity()) { if (Zend_Auth::getInstance()->hasIdentity()) {
$user = Zend_Auth::getInstance()->getIdentity(); $user = Zend_Auth::getInstance()->getIdentity();
$user = Doctrine_Query::create()->from('Contact c')->where('c.id = ?')->fetchOne( $user = Doctrine_Query::create()
array( ->from('Contact c')
$user['id']) ->where('c.id = ?')
); ->fetchOne(array(
$user['id'],
));
if (!$user['mwert']) { if (!$user['mwert']) {
return false; return false;
} }
@ -931,6 +988,7 @@ class TP_Basket
{ {
return $this->_Warenkorb->offerContact; return $this->_Warenkorb->offerContact;
} }
public function getDeliveryMode() public function getDeliveryMode()
{ {
return $this->_Warenkorb->deliveryMode; return $this->_Warenkorb->deliveryMode;
@ -945,6 +1003,7 @@ class TP_Basket
//Namespace wieder sperren //Namespace wieder sperren
$this->_Warenkorb->lock(); $this->_Warenkorb->lock();
} }
public function getDeliveryAddress() public function getDeliveryAddress()
{ {
return $this->_Warenkorb->deliveryAddress; return $this->_Warenkorb->deliveryAddress;
@ -995,6 +1054,11 @@ class TP_Basket
return $this->_Warenkorb->mwert; return $this->_Warenkorb->mwert;
} }
public function getVoucherMWert()
{
return $this->_Warenkorb->vouchermwert;
}
public function clearBasketItems() public function clearBasketItems()
{ {
$this->_Warenkorb->unlock(); $this->_Warenkorb->unlock();
@ -1016,7 +1080,6 @@ class TP_Basket
} }
$this->removeProduct($removeAble); $this->removeProduct($removeAble);
} }
public function clear() public function clear()
@ -1025,7 +1088,7 @@ class TP_Basket
$this->_Warenkorb->ArtikelAnzahl = 0; $this->_Warenkorb->ArtikelAnzahl = 0;
$this->_Warenkorb->Paymenttype = 0; $this->_Warenkorb->Paymenttype = 0;
$this->_Warenkorb->Articles->clear(); $this->_Warenkorb->Articles->clear();
$this->_Warenkorb->Gutschein = ""; $this->_Warenkorb->Gutschein = '';
$this->_Warenkorb->GutscheinAbzug = 0; $this->_Warenkorb->GutscheinAbzug = 0;
$this->_Warenkorb->GutscheinAbzugNetto = 0; $this->_Warenkorb->GutscheinAbzugNetto = 0;
$this->_Warenkorb->GutscheinAbzugMwSt = []; $this->_Warenkorb->GutscheinAbzugMwSt = [];
@ -1039,6 +1102,7 @@ class TP_Basket
$this->_Warenkorb->ZahlkostenBrutto = 0; $this->_Warenkorb->ZahlkostenBrutto = 0;
$this->_Warenkorb->VersandkostenBrutto = 0; $this->_Warenkorb->VersandkostenBrutto = 0;
$this->_Warenkorb->mwert = array(); $this->_Warenkorb->mwert = array();
$this->_Warenkorb->vouchermwert = array();
$this->_Warenkorb->Zahlkosten = 0; $this->_Warenkorb->Zahlkosten = 0;
$this->_Warenkorb->Versandkosten = 0; $this->_Warenkorb->Versandkosten = 0;
@ -1055,22 +1119,23 @@ class TP_Basket
$this->_Warenkorb->invoice = 0; $this->_Warenkorb->invoice = 0;
$this->_Warenkorb->sendersame = true; $this->_Warenkorb->sendersame = true;
$this->_Warenkorb->sender = 0; $this->_Warenkorb->sender = 0;
$this->_Warenkorb->token = ""; $this->_Warenkorb->token = '';
$this->_Warenkorb->plz = false; $this->_Warenkorb->plz = false;
$this->_Warenkorb->delivery_plz = false; $this->_Warenkorb->delivery_plz = false;
$this->_Warenkorb->delivery_country = false; $this->_Warenkorb->delivery_country = false;
$this->_Warenkorb->delivery_ustid = null; $this->_Warenkorb->delivery_ustid = null;
$this->_Warenkorb->shippingtype_extra_label = ""; $this->_Warenkorb->shippingtype_extra_label = '';
$this->_Warenkorb->info = array(); $this->_Warenkorb->info = array();
$this->_Warenkorb->paymentRef = substr(md5(rand()), 0, 7); $this->_Warenkorb->paymentRef = substr(md5(rand()), 0, 7);
$this->_Warenkorb->paymentGateway = ""; $this->_Warenkorb->paymentGateway = '';
$this->_Warenkorb->TempProduct = array(); $this->_Warenkorb->TempProduct = array();
$this->_Warenkorb->LastTempProductId = false; $this->_Warenkorb->LastTempProductId = false;
$this->_Warenkorb->offerNumber = time(); $this->_Warenkorb->offerNumber = time();
$this->_Warenkorb->withTax = true; $this->_Warenkorb->withTax = true;
$this->_Warenkorb->lock(); $this->_Warenkorb->lock();
} }
/** /**
* Initialisiert den Warenkorb * Initialisiert den Warenkorb
*/ */
@ -1079,7 +1144,7 @@ class TP_Basket
$this->_Warenkorb->ArtikelAnzahl = 0; $this->_Warenkorb->ArtikelAnzahl = 0;
$this->_Warenkorb->Articles = new TP_Basket_Collection(); $this->_Warenkorb->Articles = new TP_Basket_Collection();
$this->_Warenkorb->Gutschein = ""; $this->_Warenkorb->Gutschein = '';
$this->_Warenkorb->GutscheinAbzug = 0; $this->_Warenkorb->GutscheinAbzug = 0;
$this->_Warenkorb->GutscheinAbzugNetto = 0; $this->_Warenkorb->GutscheinAbzugNetto = 0;
$this->_Warenkorb->GutscheinAbzugMwSt = []; $this->_Warenkorb->GutscheinAbzugMwSt = [];
@ -1090,7 +1155,7 @@ class TP_Basket
$this->_Warenkorb->invoicesame = true; $this->_Warenkorb->invoicesame = true;
$this->_Warenkorb->deliveryAddress = []; $this->_Warenkorb->deliveryAddress = [];
$this->_Warenkorb->deliveryMode = self::DELIVERY_MODE_NORMAL; $this->_Warenkorb->deliveryMode = self::DELIVERY_MODE_NORMAL;
$this->_Warenkorb->shippingtype_extra_label = ""; $this->_Warenkorb->shippingtype_extra_label = '';
$this->_Warenkorb->invoice = 0; $this->_Warenkorb->invoice = 0;
$this->_Warenkorb->offerContact = array(); $this->_Warenkorb->offerContact = array();
$this->_Warenkorb->sendersame = true; $this->_Warenkorb->sendersame = true;
@ -1102,7 +1167,7 @@ class TP_Basket
$this->_Warenkorb->preis = 0; $this->_Warenkorb->preis = 0;
$this->_Warenkorb->steuer = 0; $this->_Warenkorb->steuer = 0;
$this->_Warenkorb->brutto = 0; $this->_Warenkorb->brutto = 0;
$this->_Warenkorb->token = ""; $this->_Warenkorb->token = '';
$this->_Warenkorb->basketfield1 = ''; $this->_Warenkorb->basketfield1 = '';
$this->_Warenkorb->basketfield2 = ''; $this->_Warenkorb->basketfield2 = '';
$this->_Warenkorb->payment_zusatz = ''; $this->_Warenkorb->payment_zusatz = '';
@ -1111,7 +1176,7 @@ class TP_Basket
$this->_Warenkorb->delivery_country = false; $this->_Warenkorb->delivery_country = false;
$this->_Warenkorb->info = array(); $this->_Warenkorb->info = array();
$this->_Warenkorb->paymentRef = substr(md5(rand()), 0, 7); $this->_Warenkorb->paymentRef = substr(md5(rand()), 0, 7);
$this->_Warenkorb->paymentGateway = ""; $this->_Warenkorb->paymentGateway = '';
$this->_Warenkorb->TempProduct = array(); $this->_Warenkorb->TempProduct = array();
$this->_Warenkorb->LastTempProductId = false; $this->_Warenkorb->LastTempProductId = false;
$this->_Warenkorb->offerNumber = time(); $this->_Warenkorb->offerNumber = time();