Fixes
This commit is contained in:
parent
36229bd2bc
commit
ae6713a490
@ -2,14 +2,17 @@
|
|||||||
|
|
||||||
namespace Plugin\Custom\PSC\Saxoprint_API_R1\Api;
|
namespace Plugin\Custom\PSC\Saxoprint_API_R1\Api;
|
||||||
|
|
||||||
|
use PSC\Shop\EntityBundle\Entity\Contact;
|
||||||
|
use PSC\System\SettingsBundle\Document\LogEntry;
|
||||||
|
use PSC\System\SettingsBundle\Service\Log;
|
||||||
use PSC\System\SettingsBundle\Service\Shop;
|
use PSC\System\SettingsBundle\Service\Shop;
|
||||||
|
use Plugin\Custom\PSC\Saxoprint_API_R1\Form\Group\Saxoprint;
|
||||||
use Symfony\Component\Mime\Part\Multipart\FormDataPart;
|
use Symfony\Component\Mime\Part\Multipart\FormDataPart;
|
||||||
use Symfony\Contracts\Cache\CacheInterface;
|
use Symfony\Contracts\Cache\CacheInterface;
|
||||||
use Symfony\Contracts\HttpClient\HttpClientInterface;
|
use Symfony\Contracts\HttpClient\HttpClientInterface;
|
||||||
|
|
||||||
class Base
|
class Base
|
||||||
{
|
{
|
||||||
|
|
||||||
protected $baseUrlTest = 'https://sri1.staging.saxoprint.com/api/v3/';
|
protected $baseUrlTest = 'https://sri1.staging.saxoprint.com/api/v3/';
|
||||||
protected $baseUrlLive = 'https://sri.saxoprint.com/api/v3/';
|
protected $baseUrlLive = 'https://sri.saxoprint.com/api/v3/';
|
||||||
|
|
||||||
@ -22,10 +25,16 @@ class Base
|
|||||||
|
|
||||||
protected bool $test = false;
|
protected bool $test = false;
|
||||||
|
|
||||||
|
|
||||||
protected \PSC\Shop\EntityBundle\Document\Shop $shop;
|
protected \PSC\Shop\EntityBundle\Document\Shop $shop;
|
||||||
|
protected \PSC\Shop\EntityBundle\Entity\Shop $shopEntity;
|
||||||
|
|
||||||
public function __construct(private readonly HttpClientInterface $client, private readonly CacheInterface $cache)
|
|
||||||
|
public function setShopEntity(\PSC\Shop\EntityBundle\Entity\Shop $shop): void
|
||||||
|
{
|
||||||
|
$this->shopEntity = $shop;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function __construct(private readonly HttpClientInterface $client, private readonly CacheInterface $cache, protected readonly Log $logService)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -43,6 +52,8 @@ class Base
|
|||||||
,
|
,
|
||||||
'json' => $data,
|
'json' => $data,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
$this->logService->createLogEntry($this->shopEntity, new Contact(), LogEntry::INFO, Saxoprint::class, "saxoprint", "SaxoPrint PrintShop Response", ['content' => $response->getContent(), 'status' => $response->getStatusCode()]);
|
||||||
$content = $response->toArray();
|
$content = $response->toArray();
|
||||||
|
|
||||||
return $content;
|
return $content;
|
||||||
@ -114,6 +125,7 @@ class Base
|
|||||||
'body' => $data,
|
'body' => $data,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
$this->logService->createLogEntry($this->shopEntity, new Contact(), LogEntry::INFO, Saxoprint::class, "saxoprint", "SaxoPrint Upload Response", ['content' => $response->getContent(), 'status' => $response->getStatusCode()]);
|
||||||
return $response;
|
return $response;
|
||||||
}
|
}
|
||||||
public function postUploadConfirm($url, $data)
|
public function postUploadConfirm($url, $data)
|
||||||
@ -126,7 +138,7 @@ class Base
|
|||||||
'headers' => $this->buildHeaders(),
|
'headers' => $this->buildHeaders(),
|
||||||
'body' => $data,
|
'body' => $data,
|
||||||
]);
|
]);
|
||||||
|
$this->logService->createLogEntry($this->shopEntity, new Contact(), LogEntry::INFO, Saxoprint::class, "saxoprint", "SaxoPrint UploadConfirm Response", ['content' => $response->getContent(), 'status' => $response->getStatusCode()]);
|
||||||
return $response;
|
return $response;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -195,7 +207,7 @@ class Base
|
|||||||
return $this->cache;
|
return $this->cache;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function buildQuery(Array $data): string
|
protected function buildQuery(array $data): string
|
||||||
{
|
{
|
||||||
return base64_encode(json_encode($data));
|
return base64_encode(json_encode($data));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,10 @@
|
|||||||
|
|
||||||
namespace Plugin\Custom\PSC\Saxoprint_API_R1\Api;
|
namespace Plugin\Custom\PSC\Saxoprint_API_R1\Api;
|
||||||
|
|
||||||
|
use PSC\Shop\EntityBundle\Entity\Contact;
|
||||||
|
use PSC\System\SettingsBundle\Document\LogEntry;
|
||||||
use PSC\System\SettingsBundle\Service\Shop;
|
use PSC\System\SettingsBundle\Service\Shop;
|
||||||
|
use Plugin\Custom\PSC\Saxoprint_API_R1\Form\Group\Saxoprint;
|
||||||
|
|
||||||
class PostPrintJob extends Base
|
class PostPrintJob extends Base
|
||||||
{
|
{
|
||||||
@ -14,6 +17,7 @@ class PostPrintJob extends Base
|
|||||||
|
|
||||||
public function call()
|
public function call()
|
||||||
{
|
{
|
||||||
|
$this->logService->createLogEntry($this->shopEntity, new Contact(), LogEntry::INFO, Saxoprint::class, "saxoprint", "SaxoPrint PostJob Data", $this->buildData());
|
||||||
return $this->post('printjob', $this->buildData());
|
return $this->post('printjob', $this->buildData());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -35,8 +39,7 @@ class PostPrintJob extends Base
|
|||||||
|
|
||||||
$productGroup = $this->position->getAdditionalInfo('saxoprint')['saxoprintProductId'];
|
$productGroup = $this->position->getAdditionalInfo('saxoprint')['saxoprintProductId'];
|
||||||
$auflage = 0;
|
$auflage = 0;
|
||||||
foreach($infos as $row)
|
foreach($infos as $row) {
|
||||||
{
|
|
||||||
if($row['name'] == "" || $row['name'] == 'property[auflage]' || $row['name'] == 'auflage') {
|
if($row['name'] == "" || $row['name'] == 'property[auflage]' || $row['name'] == 'auflage') {
|
||||||
$auflage = (int)$row['value'];
|
$auflage = (int)$row['value'];
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
@ -8,7 +8,6 @@ use Symfony\Component\Mime\Part\DataPart;
|
|||||||
|
|
||||||
class PostUpload extends Base
|
class PostUpload extends Base
|
||||||
{
|
{
|
||||||
|
|
||||||
private \PSC\Shop\OrderBundle\Model\Order\Position $position;
|
private \PSC\Shop\OrderBundle\Model\Order\Position $position;
|
||||||
private \PSC\Shop\OrderBundle\Model\Base $order;
|
private \PSC\Shop\OrderBundle\Model\Base $order;
|
||||||
|
|
||||||
@ -20,6 +19,7 @@ class PostUpload extends Base
|
|||||||
|
|
||||||
public function call()
|
public function call()
|
||||||
{
|
{
|
||||||
|
$return = false;
|
||||||
if(count($this->position->getUploads()) > 0) {
|
if(count($this->position->getUploads()) > 0) {
|
||||||
|
|
||||||
$temp = [];
|
$temp = [];
|
||||||
@ -31,6 +31,7 @@ class PostUpload extends Base
|
|||||||
'/' . $this->position->getExternalOrderNumber() . '/link',
|
'/' . $this->position->getExternalOrderNumber() . '/link',
|
||||||
$this->buildDataLink($temp)
|
$this->buildDataLink($temp)
|
||||||
);
|
);
|
||||||
|
$return = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($this->position->getProduct()->getUploadProvidedFile() && $this->position->getProduct()->getUploadProvidedFile()->getUrl() != "") {
|
if($this->position->getProduct()->getUploadProvidedFile() && $this->position->getProduct()->getUploadProvidedFile()->getUrl() != "") {
|
||||||
@ -38,6 +39,7 @@ class PostUpload extends Base
|
|||||||
'/' . $this->position->getExternalOrderNumber() . '/link',
|
'/' . $this->position->getExternalOrderNumber() . '/link',
|
||||||
$this->buildDataLink(['https://' . $this->domain . $this->position->getProduct()->getUploadProvidedFile()->getUrl()])
|
$this->buildDataLink(['https://' . $this->domain . $this->position->getProduct()->getUploadProvidedFile()->getUrl()])
|
||||||
);
|
);
|
||||||
|
$return = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
$outfile = '/data/www/old/market/steplayouter/basket/' . $this->order->getUid() . '/' . $this->position->getPos() . '/'.$this->order->getAlias() . '_' . $this->position->getPos().'.pdf';
|
$outfile = '/data/www/old/market/steplayouter/basket/' . $this->order->getUid() . '/' . $this->position->getPos() . '/'.$this->order->getAlias() . '_' . $this->position->getPos().'.pdf';
|
||||||
@ -47,8 +49,10 @@ class PostUpload extends Base
|
|||||||
'/' . $this->position->getExternalOrderNumber() . '/link',
|
'/' . $this->position->getExternalOrderNumber() . '/link',
|
||||||
$this->buildDataLink(['https://' . $this->domain . '/apps/market/steplayouter/basket/' . $this->order->getUid() . '/' . $this->position->getPos() . '/'.$this->order->getAlias() . '_' . $this->position->getPos().'.pdf'])
|
$this->buildDataLink(['https://' . $this->domain . '/apps/market/steplayouter/basket/' . $this->order->getUid() . '/' . $this->position->getPos() . '/'.$this->order->getAlias() . '_' . $this->position->getPos().'.pdf'])
|
||||||
);
|
);
|
||||||
|
$return = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return $return;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function buildDataLink(array $links)
|
private function buildDataLink(array $links)
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace Plugin\Custom\PSC\Saxoprint_API_R1\Queue;
|
namespace Plugin\Custom\PSC\Saxoprint_API_R1\Queue;
|
||||||
|
|
||||||
use Doctrine\ODM\MongoDB\DocumentManager;
|
use Doctrine\ODM\MongoDB\DocumentManager;
|
||||||
@ -41,15 +42,16 @@ class Confirm implements QueueInterface, ConfigurableElementInterface
|
|||||||
*/
|
*/
|
||||||
private Manager $_eventManager;
|
private Manager $_eventManager;
|
||||||
|
|
||||||
function __construct(FormFactoryInterface $formFactory,
|
public function __construct(
|
||||||
|
FormFactoryInterface $formFactory,
|
||||||
EntityManagerInterface $entityManager,
|
EntityManagerInterface $entityManager,
|
||||||
DocumentManager $doctrine_mongodb,
|
DocumentManager $doctrine_mongodb,
|
||||||
Status $statusService,
|
Status $statusService,
|
||||||
PostConfirm $postConfirm,
|
PostConfirm $postConfirm,
|
||||||
Shop $shopService,
|
Shop $shopService,
|
||||||
Order $orderService,
|
Order $orderService,
|
||||||
Manager $eventManager)
|
Manager $eventManager
|
||||||
{
|
) {
|
||||||
$this->_formFactory = $formFactory;
|
$this->_formFactory = $formFactory;
|
||||||
$this->_entityManager = $entityManager;
|
$this->_entityManager = $entityManager;
|
||||||
$this->_doctrine_mongodb = $doctrine_mongodb;
|
$this->_doctrine_mongodb = $doctrine_mongodb;
|
||||||
@ -123,7 +125,8 @@ class Confirm implements QueueInterface, ConfigurableElementInterface
|
|||||||
* @return bool
|
* @return bool
|
||||||
* @internal param Queue $doc
|
* @internal param Queue $doc
|
||||||
*/
|
*/
|
||||||
public function execute(EventInterface $event, Queue $queue) {
|
public function execute(EventInterface $event, Queue $queue)
|
||||||
|
{
|
||||||
|
|
||||||
/** @var \Plugin\Custom\PSC\Saxoprint_API_R1\Document\Export $settings */
|
/** @var \Plugin\Custom\PSC\Saxoprint_API_R1\Document\Export $settings */
|
||||||
$settings = $queue->getQueueDocument();
|
$settings = $queue->getQueueDocument();
|
||||||
@ -135,6 +138,7 @@ class Confirm implements QueueInterface, ConfigurableElementInterface
|
|||||||
|
|
||||||
$order = $this->_orderService->getCurrentOrder();
|
$order = $this->_orderService->getCurrentOrder();
|
||||||
|
|
||||||
|
$this->_postConfirm->setShopEntity($this->_shopService->getShopByUid($order->getShop()->getId()));
|
||||||
$this->_postConfirm->setShop($this->_shopService->getMongoShopByUid($order->getShop()->getId()));
|
$this->_postConfirm->setShop($this->_shopService->getMongoShopByUid($order->getShop()->getId()));
|
||||||
$this->_postConfirm->setPosition($position);
|
$this->_postConfirm->setPosition($position);
|
||||||
$this->_postConfirm->setOrder($order);
|
$this->_postConfirm->setOrder($order);
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace Plugin\Custom\PSC\Saxoprint_API_R1\Queue;
|
namespace Plugin\Custom\PSC\Saxoprint_API_R1\Queue;
|
||||||
|
|
||||||
use DirectoryIterator;
|
use DirectoryIterator;
|
||||||
@ -58,15 +59,16 @@ class Export implements QueueInterface, ConfigurableElementInterface
|
|||||||
*/
|
*/
|
||||||
private Manager $_eventManager;
|
private Manager $_eventManager;
|
||||||
|
|
||||||
function __construct(FormFactoryInterface $formFactory,
|
public function __construct(
|
||||||
|
FormFactoryInterface $formFactory,
|
||||||
EntityManagerInterface $entityManager,
|
EntityManagerInterface $entityManager,
|
||||||
DocumentManager $doctrine_mongodb,
|
DocumentManager $doctrine_mongodb,
|
||||||
Status $statusService,
|
Status $statusService,
|
||||||
PostPrintJob $postPrintJob,
|
PostPrintJob $postPrintJob,
|
||||||
Shop $shopService,
|
Shop $shopService,
|
||||||
Order $orderService,
|
Order $orderService,
|
||||||
Manager $eventManager)
|
Manager $eventManager
|
||||||
{
|
) {
|
||||||
$this->_formFactory = $formFactory;
|
$this->_formFactory = $formFactory;
|
||||||
$this->_entityManager = $entityManager;
|
$this->_entityManager = $entityManager;
|
||||||
$this->_doctrine_mongodb = $doctrine_mongodb;
|
$this->_doctrine_mongodb = $doctrine_mongodb;
|
||||||
@ -140,7 +142,8 @@ class Export implements QueueInterface, ConfigurableElementInterface
|
|||||||
* @return bool
|
* @return bool
|
||||||
* @internal param Queue $doc
|
* @internal param Queue $doc
|
||||||
*/
|
*/
|
||||||
public function execute(EventInterface $event, Queue $queue) {
|
public function execute(EventInterface $event, Queue $queue)
|
||||||
|
{
|
||||||
|
|
||||||
/** @var \Plugin\Custom\PSC\Saxoprint_API_R1\Document\Export $settings */
|
/** @var \Plugin\Custom\PSC\Saxoprint_API_R1\Document\Export $settings */
|
||||||
$settings = $queue->getQueueDocument();
|
$settings = $queue->getQueueDocument();
|
||||||
@ -153,6 +156,7 @@ class Export implements QueueInterface, ConfigurableElementInterface
|
|||||||
$order = $this->_orderService->getCurrentOrder();
|
$order = $this->_orderService->getCurrentOrder();
|
||||||
|
|
||||||
$this->_postPrintJob->setShop($this->_shopService->getMongoShopByUid($order->getShop()->getId()));
|
$this->_postPrintJob->setShop($this->_shopService->getMongoShopByUid($order->getShop()->getId()));
|
||||||
|
$this->_postPrintJob->setShopEntity($this->_shopService->getShopByUid($order->getShop()->getId()));
|
||||||
$this->_postPrintJob->setPosition($position);
|
$this->_postPrintJob->setPosition($position);
|
||||||
$this->_postPrintJob->setOrder($order);
|
$this->_postPrintJob->setOrder($order);
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace Plugin\Custom\PSC\Saxoprint_API_R1\Queue;
|
namespace Plugin\Custom\PSC\Saxoprint_API_R1\Queue;
|
||||||
|
|
||||||
use DirectoryIterator;
|
use DirectoryIterator;
|
||||||
@ -60,15 +61,16 @@ class Upload implements QueueInterface, ConfigurableElementInterface
|
|||||||
*/
|
*/
|
||||||
private Manager $_eventManager;
|
private Manager $_eventManager;
|
||||||
|
|
||||||
function __construct(FormFactoryInterface $formFactory,
|
public function __construct(
|
||||||
|
FormFactoryInterface $formFactory,
|
||||||
EntityManagerInterface $entityManager,
|
EntityManagerInterface $entityManager,
|
||||||
DocumentManager $doctrine_mongodb,
|
DocumentManager $doctrine_mongodb,
|
||||||
Status $statusService,
|
Status $statusService,
|
||||||
PostUpload $postUpload,
|
PostUpload $postUpload,
|
||||||
Shop $shopService,
|
Shop $shopService,
|
||||||
Order $orderService,
|
Order $orderService,
|
||||||
Manager $eventManager)
|
Manager $eventManager
|
||||||
{
|
) {
|
||||||
$this->_formFactory = $formFactory;
|
$this->_formFactory = $formFactory;
|
||||||
$this->_entityManager = $entityManager;
|
$this->_entityManager = $entityManager;
|
||||||
$this->_doctrine_mongodb = $doctrine_mongodb;
|
$this->_doctrine_mongodb = $doctrine_mongodb;
|
||||||
@ -142,7 +144,8 @@ class Upload implements QueueInterface, ConfigurableElementInterface
|
|||||||
* @return bool
|
* @return bool
|
||||||
* @internal param Queue $doc
|
* @internal param Queue $doc
|
||||||
*/
|
*/
|
||||||
public function execute(EventInterface $event, Queue $queue) {
|
public function execute(EventInterface $event, Queue $queue)
|
||||||
|
{
|
||||||
|
|
||||||
/** @var \Plugin\Custom\PSC\Saxoprint_API_R1\Document\Export $settings */
|
/** @var \Plugin\Custom\PSC\Saxoprint_API_R1\Document\Export $settings */
|
||||||
$settings = $queue->getQueueDocument();
|
$settings = $queue->getQueueDocument();
|
||||||
@ -169,9 +172,12 @@ class Upload implements QueueInterface, ConfigurableElementInterface
|
|||||||
$domain = false;
|
$domain = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$this->_postUpload->setShopEntity($this->_shopService->getShopByUid($order->getShop()->getId()));
|
||||||
$this->_postUpload->setDomain($domain);
|
$this->_postUpload->setDomain($domain);
|
||||||
$this->_postUpload->call();
|
$return = $this->_postUpload->call();
|
||||||
|
if(!$return) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
$position->setStatus($settings->getStatusSuccess());
|
$position->setStatus($settings->getStatusSuccess());
|
||||||
|
|
||||||
$this->_orderService->storeOrder($order);
|
$this->_orderService->storeOrder($order);
|
||||||
|
|||||||
@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
class market_article
|
class market_article
|
||||||
{
|
{
|
||||||
|
|
||||||
public $id = "6";
|
public $id = "6";
|
||||||
public $articlegroups;
|
public $articlegroups;
|
||||||
public $private;
|
public $private;
|
||||||
@ -603,7 +602,10 @@ class market_article
|
|||||||
->where('c.uuid = ?', array((string)$layouterPreviewId))
|
->where('c.uuid = ?', array((string)$layouterPreviewId))
|
||||||
->fetchOne();
|
->fetchOne();
|
||||||
$design = json_decode($layoutData->design, true);
|
$design = json_decode($layoutData->design, true);
|
||||||
return '<img src="' . $design['previews'][0]['url'] .'" class="layouter_10" />';
|
if(isset($design['previews'][$site - 1])) {
|
||||||
|
return '<img src="' . $design['previews'][$site - 1] .'" class="layouter_10" />';
|
||||||
|
}
|
||||||
|
return '';
|
||||||
} elseif ($articleSess->getLayouterModus() == 101) {
|
} elseif ($articleSess->getLayouterModus() == 101) {
|
||||||
$layoutData = Doctrine_Query::create()
|
$layoutData = Doctrine_Query::create()
|
||||||
->from('LayouterDesignData c')
|
->from('LayouterDesignData c')
|
||||||
|
|||||||
@ -37,6 +37,9 @@ user.login.elements.password_re.options.validators.1.options = "password"
|
|||||||
; firstname element
|
; firstname element
|
||||||
user.rech.legend = "Rechnungsadresse"
|
user.rech.legend = "Rechnungsadresse"
|
||||||
|
|
||||||
|
user.rech.elements.is_company.type = "checkbox"
|
||||||
|
user.rech.elements.is_company.options.label = "Gewerblich?"
|
||||||
|
|
||||||
user.rech.elements.self_anrede.type = "select"
|
user.rech.elements.self_anrede.type = "select"
|
||||||
user.rech.elements.self_anrede.options.label = "Anrede"
|
user.rech.elements.self_anrede.options.label = "Anrede"
|
||||||
user.rech.elements.self_anrede.options.required = false
|
user.rech.elements.self_anrede.options.required = false
|
||||||
|
|||||||
@ -135,18 +135,10 @@ a.editAddress.btn.btn-info.btn-xs {
|
|||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
|
|
||||||
<input id="delivery" type="hidden" name="delivery" value="custom" />
|
<input id="delivery" type="hidden" name="delivery" value="<?php echo $this->delivery ?>" />
|
||||||
<input id="sender" type="hidden" name="sender" value="<?php echo $this->sender ?>" />
|
<input id="sender" type="hidden" name="sender" value="<?php echo $this->sender ?>" />
|
||||||
<input id="invoice" type="hidden" name="invoice" value="<?php echo $this->invoice ?>" />
|
<input id="invoice" type="hidden" name="invoice" value="<?php echo $this->invoice ?>" />
|
||||||
<input type="text" name="delivery_firstname" value="<?php echo TP_Basket::getBasket()->getDeliveryAddress()['firstname'] ?>"/>
|
|
||||||
<input type="text" name="delivery_lastname" value="<?php echo TP_Basket::getBasket()->getDeliveryAddress()['lastname'] ?>"/>
|
|
||||||
<input type="text" name="delivery_street" value="<?php echo TP_Basket::getBasket()->getDeliveryAddress()['street'] ?>"/>
|
|
||||||
<input type="text" name="delivery_houseNumber" value="<?php echo TP_Basket::getBasket()->getDeliveryAddress()['houseNumber'] ?>"/>
|
|
||||||
<input type="text" name="delivery_zip" value="<?php echo TP_Basket::getBasket()->getDeliveryAddress()['zip'] ?>"/>
|
|
||||||
<input type="text" name="delivery_city" value="<?php echo TP_Basket::getBasket()->getDeliveryAddress()['city'] ?>"/>
|
|
||||||
<input type="text" name="delivery_email" value="<?php echo TP_Basket::getBasket()->getDeliveryAddress()['email'] ?>"/>
|
|
||||||
<input type="text" name="delivery_company" value="<?php echo TP_Basket::getBasket()->getDeliveryAddress()['company'] ?>"/>
|
|
||||||
<input type="text" name="delivery_company2" value="<?php echo TP_Basket::getBasket()->getDeliveryAddress()['company2'] ?>"/>
|
|
||||||
|
|
||||||
|
|
||||||
<div class="col-xs-12"><input id="review_next" type="submit" value="<?php echo $this->translate('Weiter') ?>" class="btn btn-success btn-lg pull-right" style="margin-right: 15px;" /></div>
|
<div class="col-xs-12"><input id="review_next" type="submit" value="<?php echo $this->translate('Weiter') ?>" class="btn btn-success btn-lg pull-right" style="margin-right: 15px;" /></div>
|
||||||
|
|||||||
@ -3283,6 +3283,8 @@ class BasketController extends TP_Controller_Action
|
|||||||
}
|
}
|
||||||
|
|
||||||
$basket->setDeliveryIsSame(true);
|
$basket->setDeliveryIsSame(true);
|
||||||
|
$basket->setDeliveryUstid($this->view->sender_address->ustid);
|
||||||
|
$basket->setDeliveryPLZ($this->view->sender_address->zip);
|
||||||
//$basket->setSender(0);
|
//$basket->setSender(0);
|
||||||
$this->redirectSpeak('/basket/finish');
|
$this->redirectSpeak('/basket/finish');
|
||||||
} elseif ($this->getRequest()->getParam('delivery') != '' && $this->getRequest()->getParam('delivery') != 's'
|
} elseif ($this->getRequest()->getParam('delivery') != '' && $this->getRequest()->getParam('delivery') != 's'
|
||||||
@ -3293,10 +3295,14 @@ class BasketController extends TP_Controller_Action
|
|||||||
$basket->setDelivery($this->getRequest()->getParam('delivery'));
|
$basket->setDelivery($this->getRequest()->getParam('delivery'));
|
||||||
$basket->setInvoice($this->getRequest()->getParam('invoice'));
|
$basket->setInvoice($this->getRequest()->getParam('invoice'));
|
||||||
$basket->setSender($this->getRequest()->getParam('sender'));
|
$basket->setSender($this->getRequest()->getParam('sender'));
|
||||||
|
$basket->setDeliveryUstid($this->view->delivery_address->ustid);
|
||||||
|
$basket->setDeliveryPLZ($this->view->delivery_address->zip);
|
||||||
$this->redirectSpeak('/basket/finish');
|
$this->redirectSpeak('/basket/finish');
|
||||||
} elseif ($this->getRequest()->getParam('delivery') != '' && $this->getRequest()->getParam('delivery') != 's') {
|
} elseif ($this->getRequest()->getParam('delivery') != '' && $this->getRequest()->getParam('delivery') != 's') {
|
||||||
$basket->setDeliveryIsSame(false);
|
$basket->setDeliveryIsSame(false);
|
||||||
$basket->setDelivery($this->getRequest()->getParam('delivery'));
|
$basket->setDelivery($this->getRequest()->getParam('delivery'));
|
||||||
|
$basket->setDeliveryUstid($this->view->delivery_address->ustid);
|
||||||
|
$basket->setDeliveryPLZ($this->view->delivery_address->zip);
|
||||||
$this->redirectSpeak('/basket/finish');
|
$this->redirectSpeak('/basket/finish');
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4549,7 +4555,6 @@ class BasketController extends TP_Controller_Action
|
|||||||
|
|
||||||
$this->view->gutschein = $gutscheincode;
|
$this->view->gutschein = $gutscheincode;
|
||||||
}
|
}
|
||||||
|
|
||||||
$basket->setWithTax(TP_Country::getTaxForCountry($basket->getDeliveryCountry(), $basket->getDeliveryUstId()));
|
$basket->setWithTax(TP_Country::getTaxForCountry($basket->getDeliveryCountry(), $basket->getDeliveryUstId()));
|
||||||
|
|
||||||
$this->view->withTax = $basket->isWithTax();
|
$this->view->withTax = $basket->isWithTax();
|
||||||
|
|||||||
@ -3023,7 +3023,10 @@ class UserController extends TP_Controller_Action
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($this->_request->isPost()) {
|
if ($this->_request->isPost()) {
|
||||||
|
if($form->getSubForm('rech')->getElement('is_company')->isChecked()) {
|
||||||
|
$form->get('rech')->get('self_department')->setRequired(true);
|
||||||
|
$form->get('rech')->get('ustid')->setRequired(true);
|
||||||
|
}
|
||||||
$externalValidation = true;
|
$externalValidation = true;
|
||||||
if($this->shop->getPluginSettings(module: 'friendlycaptcha', name: 'secret')) {
|
if($this->shop->getPluginSettings(module: 'friendlycaptcha', name: 'secret')) {
|
||||||
$externalValidation = false;
|
$externalValidation = false;
|
||||||
|
|||||||
@ -1,8 +1,9 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
class TP_Country {
|
class TP_Country
|
||||||
|
{
|
||||||
public static function getCountrysAsArray() {
|
public static function getCountrysAsArray(): array
|
||||||
|
{
|
||||||
|
|
||||||
$shop = Zend_Registry::get('shop');
|
$shop = Zend_Registry::get('shop');
|
||||||
$statusCollection = TP_Mongo::getInstance()->Country;
|
$statusCollection = TP_Mongo::getInstance()->Country;
|
||||||
@ -17,9 +18,9 @@ class TP_Country {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getTaxForCountry($code, $ustid)
|
public static function getTaxForCountry($code, $ustid): bool
|
||||||
{
|
{
|
||||||
if($code === NULL || $code == '') {
|
if($code === null || $code == '') {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
$shop = Zend_Registry::get('shop');
|
$shop = Zend_Registry::get('shop');
|
||||||
@ -27,11 +28,11 @@ class TP_Country {
|
|||||||
|
|
||||||
$country = $statusCollection->findOne(array('shop' => (string)$shop['id'], 'code' => $code));
|
$country = $statusCollection->findOne(array('shop' => (string)$shop['id'], 'code' => $code));
|
||||||
|
|
||||||
if($country === NULL) {
|
if($country === null) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($ustid == NULL || $ustid == "") {
|
if($ustid == null || $ustid == "") {
|
||||||
return $country['withTaxWithoutUstNr'];
|
return $country['withTaxWithoutUstNr'];
|
||||||
} else {
|
} else {
|
||||||
return $country['withTaxWithUstNr'];
|
return $country['withTaxWithUstNr'];
|
||||||
|
|||||||
@ -166,7 +166,7 @@ class TP_Image {
|
|||||||
if($resize == "-resize 0x0") {
|
if($resize == "-resize 0x0") {
|
||||||
exec("convert -density 140 '".$image->path."[0]' -quality 75 -background white -alpha remove -colorspace sRGB ". PUBLIC_PATH.'/temp/thumb/'.$shop['uid'].'/'.$image->id.'_'.$mode.'.png');
|
exec("convert -density 140 '".$image->path."[0]' -quality 75 -background white -alpha remove -colorspace sRGB ". PUBLIC_PATH.'/temp/thumb/'.$shop['uid'].'/'.$image->id.'_'.$mode.'.png');
|
||||||
}else{
|
}else{
|
||||||
var_dump("convert -density 140 '".$image->path."[0]' ".$resize." -quality 75 -background white -alpha remove -colorspace sRGB ". PUBLIC_PATH.'/temp/thumb/'.$shop['uid'].'/'.$image->id.'_'.$mode.'.png');
|
exec("convert -density 140 '".$image->path."[0]' ".$resize." -quality 75 -background white -alpha remove -colorspace sRGB ". PUBLIC_PATH.'/temp/thumb/'.$shop['uid'].'/'.$image->id.'_'.$mode.'.png');
|
||||||
}
|
}
|
||||||
return '/temp/thumb/'.$shop['uid'].'/'.$image->id.'_'.$mode.'.png';
|
return '/temp/thumb/'.$shop['uid'].'/'.$image->id.'_'.$mode.'.png';
|
||||||
}elseif($finfo == 'image/png') {
|
}elseif($finfo == 'image/png') {
|
||||||
|
|||||||
@ -46,7 +46,7 @@ class Zend_Form_Element_Captcha extends Zend_Form_Element_Xhtml
|
|||||||
/**
|
/**
|
||||||
* Captcha plugin type constant
|
* Captcha plugin type constant
|
||||||
*/
|
*/
|
||||||
const CAPTCHA = 'CAPTCHA';
|
public const CAPTCHA = 'CAPTCHA';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Captcha adapter
|
* Captcha adapter
|
||||||
@ -90,7 +90,7 @@ class Zend_Form_Element_Captcha extends Zend_Form_Element_Xhtml
|
|||||||
|
|
||||||
$name = $this->getPluginLoader(self::CAPTCHA)->load($name);
|
$name = $this->getPluginLoader(self::CAPTCHA)->load($name);
|
||||||
if (empty($options)) {
|
if (empty($options)) {
|
||||||
$instance = new $name;
|
$instance = new $name();
|
||||||
} else {
|
} else {
|
||||||
$r = new ReflectionClass($name);
|
$r = new ReflectionClass($name);
|
||||||
if ($r->hasMethod('__construct')) {
|
if ($r->hasMethod('__construct')) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user