Skip to content
Code-Schnipsel Gruppen Projekte
Commit 2b1bc9f7 erstellt von Michael Danielczok's avatar Michael Danielczok
Dateien durchsuchen

feat: cta url varibale renamed

Related: #8
Übergeordneter ea75fe46
Keine zugehörigen Branchen gefunden
Keine zugehörigen Tags gefunden
1 Merge Request!24feat: product landing page demo data
Pipeline-Nr. 11543 bestanden
whenQuiLoaded().then(() => {
"use strict";
setActionUrl();
function setActionUrl() {
const ctaUrl = QUIQQER_LANDING_PAGE_CTA_URL;
if (!ctaUrl) {
return;
}
const actionButtons = document.querySelectorAll('[data-qui-productLandingPage-cta="1"]');
actionButtons.forEach((Btn) => {
Btn.href = ctaUrl;
});
}
});
\ No newline at end of file
...@@ -164,13 +164,13 @@ ...@@ -164,13 +164,13 @@
<de><![CDATA[Wähle hier das Produkt aus, das auf der Seite angezeigt werden soll.]]></de> <de><![CDATA[Wähle hier das Produkt aus, das auf der Seite angezeigt werden soll.]]></de>
<en><![CDATA[Select the product to be displayed on the page here.]]></en> <en><![CDATA[Select the product to be displayed on the page here.]]></en>
</locale> </locale>
<locale name="order.simple.checkout.settings.actionUrl"> <locale name="order.simple.checkout.settings.ctaUrl">
<de><![CDATA[Aktion-URL]]></de> <de><![CDATA[Aktion-URL (CTA)]]></de>
<en><![CDATA[Action url]]></en> <en><![CDATA[Action url (CTA)]]></en>
</locale> </locale>
<locale name="order.simple.checkout.settings.actionUrl.description"> <locale name="order.simple.checkout.settings.ctaUrl.description">
<de><![CDATA[Die hier festgelegte URL wird auf alle Buttons angewendet, die das Data-Attribut <code>data-qui-productLandingPage="1"</code> enthalten. Dies kann eine interne URL, eine URL mit Produkt-ID oder ein Link zu einer externen Seite sein.]]></de> <de><![CDATA[Die hier festgelegte URL wird auf alle Buttons (Call To Actions) angewendet, die das Data-Attribut <code>data-qui-productLandingPage-cta="1"</code> enthalten. Dies kann eine interne URL, eine URL mit Produkt-ID oder ein Link zu einer externen Seite sein.]]></de>
<en><![CDATA[The URL defined here is applied to all buttons that contain the data attribute <code>data-qui-productLandingPage="1"</code>. This can be an internal URL, a URL with a product ID or a link to an external page.]]></en> <en><![CDATA[The URL defined here is applied to all buttons (Call To Actions) that contain the data attribute <code>data-qui-productLandingPage-cta="1"</code>. This can be an internal URL, a URL with a product ID or a link to an external page.]]></en>
</locale> </locale>
</groups> </groups>
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
</desc> </desc>
<attributes> <attributes>
<attribute>order.simple.productLandingPage.productId</attribute> <attribute>order.simple.productLandingPage.productId</attribute>
<attribute>order.simple.productLandingPage.actionUrl</attribute> <attribute>order.simple.productLandingPage.ctaUrl</attribute>
</attributes> </attributes>
<settings> <settings>
...@@ -40,14 +40,14 @@ ...@@ -40,14 +40,14 @@
</description> </description>
</input> </input>
<input conf="order.simple.productLandingPage.actionUrl"> <input conf="order.simple.productLandingPage.ctaUrl">
<text> <text>
<locale group="quiqqer/order-simple-checkout" <locale group="quiqqer/order-simple-checkout"
var="order.simple.checkout.settings.actionUrl"/> var="order.simple.checkout.settings.ctaUrl"/>
</text> </text>
<description> <description>
<locale group="quiqqer/order-simple-checkout" <locale group="quiqqer/order-simple-checkout"
var="order.simple.checkout.settings.actionUrl.description"/> var="order.simple.checkout.settings.ctaUrl.description"/>
</description> </description>
</input> </input>
</settings> </settings>
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
use QUI\ERP\Products\Handler\Products; use QUI\ERP\Products\Handler\Products;
$productId = $Site->getAttribute('order.simple.productLandingPage.productId'); $productId = $Site->getAttribute('order.simple.productLandingPage.productId');
$actionUrl = $Site->getAttribute('order.simple.productLandingPage.actionUrl'); $ctaUrl = $Site->getAttribute('order.simple.productLandingPage.ctaUrl');
if (empty($productId)) { if (empty($productId)) {
$Engine->assign('Product', null); $Engine->assign('Product', null);
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
} }
} }
if ($actionUrl) { if ($ctaUrl) {
$Template->extendHeader('<script>QUIQQER_LANDING_PAGE_ACTION_URL = "' . $actionUrl . '";</script>'); $ctaUrl = filter_var($ctaUrl, FILTER_SANITIZE_URL);
} $Template->extendHeader('<script>QUIQQER_LANDING_PAGE_CTA_URL = "' . $ctaUrl . '";</script>');
\ No newline at end of file }
0% Lade oder .
You are about to add 0 people to the discussion. Proceed with caution.
Bearbeitung dieser Nachricht zuerst beenden!
Bitte registrieren oder zum Kommentieren