Skip to content
Code-Schnipsel Gruppen Projekte
Commit 3509a902 erstellt von Henning Leutz's avatar Henning Leutz :martial_arts_uniform:
Dateien durchsuchen

feat: #101

Übergeordneter 5b62652c
No related branches found
No related tags found
Keine zugehörigen Merge Requests gefunden
......@@ -767,6 +767,14 @@
If this option is not activated, each product added will have its own position.
]]></en>
</locale>
<locale name="order.settings.orderProcess.backToShopUrl">
<de><![CDATA[Zurück zum Shop Link]]></de>
<en><![CDATA[Back to the Shop Link]]></en>
</locale>
<locale name="order.settings.orderProcess.backToShopUrl.description">
<de><![CDATA[Diese Eigenschaft legt fest, wohin der 'Zurück zum Shop' Link führen soll.]]></de>
<en><![CDATA[This property defines where the 'Back to Shop' link should lead to.]]></en>
</locale>
<locale name="exception.order.process.not.found">
<de><![CDATA[Keinen Bestellprozess gefunden. Bitte legen Sie einen Bestellprozess an.]]></de>
......
......@@ -68,6 +68,9 @@
<type><![CDATA[bool]]></type>
<defaultvalue><![CDATA[1]]></defaultvalue>
</conf>
<conf name="backToShopUrl">
<type><![CDATA[string]]></type>
</conf>
</section>
<section name="paymentsChangeable"/>
......@@ -110,6 +113,19 @@
var="order.settings.orderProcess.mergeSameProducts.description"/>
</description>
</input>
<input conf="orderProcess.backToShopUrl"
data-qui="controls/projects/project/site/Input"
>
<text>
<locale group="quiqqer/order"
var="order.settings.orderProcess.backToShopUrl"/>
</text>
<description>
<locale group="quiqqer/order"
var="order.settings.orderProcess.backToShopUrl.description"/>
</description>
</input>
</settings>
<settings title="order" name="order">
......
......@@ -76,7 +76,7 @@
<div class="quiqqer-order-ordering-buttons">
{if $CurrentStep->getName() === 'Basket'}
<a href="{url id=1}"
<a href="{$backToShopUrl}"
class="btn btn-light btn-outline quiqqer-order-ordering-buttons-backToShop"
>
{locale group="quiqqer/order" var="ordering.btn.backToShop"}
......
......@@ -71,7 +71,8 @@ public function __construct($attributes = [])
'data-qui' => 'package/quiqqer/order/bin/frontend/controls/OrderProcess',
'orderHash' => false,
'basket' => true, // import basket articles to the order, use the basket
'basketEditable' => true
'basketEditable' => true,
'backToShopUrl' => false
]);
parent::__construct($attributes);
......@@ -401,7 +402,8 @@ protected function executePayableStatus()
'currentStepContent' => QUI\ControlUtils::parse($ProcessingStep),
'Site' => $this->getSite(),
'Order' => $this->getOrder(),
'hash' => $this->getStepHash()
'hash' => $this->getStepHash(),
'backToShopUrl' => $this->getBackToShopUrl()
]);
return QUI\Output::getInstance()->parse($Engine->fetch($template));
......@@ -419,7 +421,8 @@ protected function executePayableStatus()
'currentStepContent' => QUI\ControlUtils::parse($this->getCurrentStep()),
'Site' => $this->getSite(),
'Order' => $this->getOrder(),
'hash' => $this->getStepHash()
'hash' => $this->getStepHash(),
'backToShopUrl' => $this->getBackToShopUrl()
]);
return QUI\Output::getInstance()->parse($Engine->fetch($template));
......@@ -595,7 +598,8 @@ public function getBody()
'Site' => $this->getSite(),
'Order' => $this->getOrder(),
'hash' => $this->getStepHash(),
'messages' => $this->getStepMessages(\get_class($Current))
'messages' => $this->getStepMessages(\get_class($Current)),
'backToShopUrl' => $this->getBackToShopUrl()
]);
$this->Events->fireEvent('getBody', [$this]);
......@@ -790,7 +794,8 @@ protected function renderFinish()
'currentStepContent' => $stepControl,
'Site' => $Site,
'Order' => $Order,
'hash' => $stepHash
'hash' => $stepHash,
'backToShopUrl' => $this->getBackToShopUrl()
]);
$this->Events->fireEvent('getBody', [$this]);
......@@ -1518,4 +1523,34 @@ protected function getStepMessages(string $orderStep)
return $messages;
}
/**
* Return the url to the shop
* this is the url that sets the link at "back to shop
*
* @return string
* @throws QUI\Exception
*/
protected function getBackToShopUrl()
{
$Project = $this->getSite()->getProject();
if (Settings::getInstance()->get('orderProcess', 'backToShopUrl')) {
$url = Settings::getInstance()->get('orderProcess', 'backToShopUrl');
if (!empty($url) && QUI\Projects\Site\Utils::isSiteLink($url)) {
try {
return QUI\Projects\Site\Utils::getSiteByLink($url)->getUrlRewritten();
} catch (QUI\Exception $Exception) {
QUI\System\Log::addDebug($Exception->getTraceAsString());
}
}
}
if ($this->getAttribute('backToShopUrl')) {
return $this->getAttribute('backToShopUrl');
}
return $Project->firstChild()->getUrlRewritten();
}
}
0% oder .
You are about to add 0 people to the discussion. Proceed with caution.
Bearbeitung dieser Nachricht zuerst beenden!
Bitte registrieren oder zum Kommentieren