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

feat: product landing page demo data

Übergeordneter edb51450
No related branches found
No related tags found
3 Merge Requests!26Update 'next-3.x' with latest changes from 'main',!25Next 2.x,!24feat: product landing page demo data
.quiqqer-orderSimpleCheckout-productLandingPage-product .product-data-more {
display: none;
}
.quiqqer-orderSimpleCheckout-productLandingPage-product .product-visited-products {
display: none;
}
/********/
/* Demo */
/********/
/* header */
.demo__product-landing-page__brick__header {
background-color: #f5f5f5;
}
.demo__product-landing-page__brick__header .wallpaperTextArrow {
height: min(80vh, 700px);
}
@media screen and (min-width: 768px) {
.demo__product-landing-page__brick__header img {
max-width: 400px;
}
}
/* logo */
.brick-container__demo__product-landing-page__brick__logo {
background: #f5f5f5;
}
/* boxes */
.demo__product-landing-page__brick__boxes .quiqqer-boxContentAdvanced-entry {
background: #f8f8f8;
padding: 2rem 1rem;
border-radius: 1rem;
}
/* product */
.quiqqer-orderSimpleCheckout-productLandingPage-product {
background-color: #f5f5f5;
padding: 2rem;
border-radius: 1rem;
}
.quiqqer-orderSimpleCheckout-productLandingPage-product .product-data .quiqqer-order-button-add {
background: #00000008;
border: none;
}
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
......@@ -21,7 +21,9 @@
"require": {
"php": "^8",
"quiqqer/order": "^2",
"quiqqer/frontend-users": "^2"
"quiqqer/frontend-users": "^2",
"quiqqer/gallery": "^2.1",
"quiqqer/presentation-bricks": "^2"
},
"autoload": {
"psr-4": {
......
<?xml version="1.0" encoding="UTF-8"?>
<events>
<event on="onSiteCreateChildEnd" fire="\QUI\ERP\Order\SimpleCheckout\Events::siteCreateChildEnd"/>
</events>
......@@ -14,6 +14,22 @@
<de><![CDATA[Konto / Kontakt]]></de>
<en><![CDATA[Account / Contact]]></en>
</locale>
<locale name="area.productLandingPage.top.title">
<de><![CDATA[Produkt Landingpage: Zone vor dem Produkt]]></de>
<en><![CDATA[Product landing page: area before the product]]></en>
</locale>
<locale name="area.productLandingPage.top.description">
<de><![CDATA[Spezielle Bausteinzone für die schnelle und einfache Erstellung von Produkt Landingpage.]]></de>
<en><![CDATA[Special brick area for the quick and easy creation of product landing pages.]]></en>
</locale>
<locale name="area.productLandingPage.bottom.title">
<de><![CDATA[Produkt Landingpage: Zone nach dem Produkt]]></de>
<en><![CDATA[Product landing page: area after the product]]></en>
</locale>
<locale name="area.productLandingPage.bottom.description">
<de><![CDATA[Spezielle Bausteinzone für die schnelle und einfache Erstellung von Produkt Landingpage.]]></de>
<en><![CDATA[Special brick area for the quick and easy creation of product landing pages.]]></en>
</locale>
<locale name="or">
<de><![CDATA[ODER]]></de>
<en><![CDATA[OR]]></en>
......@@ -91,6 +107,74 @@
</locale>
</groups>
<groups name="quiqqer/order-simple-checkout" datatype="php">
<locale name="admin.types.simpleCheckout">
<de><![CDATA[Einfacher Bestellprozess]]></de>
<en><![CDATA[Simple ordering process]]></en>
</locale>
<locale name="admin.types.simpleCheckout.description">
<de><![CDATA[
Der einfache Bestellprozess bietet eine benutzerfreundliche Alternative zum Standard-Bestellprozess,
indem er eine strukturierte und intuitive Kaufabwicklung ermöglicht, die den Bedürfnissen von Kunden gerecht wird,
die nach einer schnellen und unkomplizierten Bestellung suchen.
]]></de>
<en><![CDATA[
The simple ordering process offers a user-friendly alternative to the standard ordering process,
by providing a structured and intuitive checkout process that meets the needs of customers
who are looking for a quick and straightforward ordering process.
]]></en>
</locale>
<locale name="admin.types.productLandingPage">
<de><![CDATA[Produkt Landing Page]]></de>
<en><![CDATA[Product Landing Page]]></en>
</locale>
<locale name="admin.types.productLandingPage.description">
<de><![CDATA[
Die Produkt-Landing-Page ist eine speziell konzipierte Seite, die es ermöglicht,
ein einzelnes Produkt in den Mittelpunkt zu stellen und es mit relevanten Inhalten und Bausteinen zu umgeben.
Durch die flexible Gestaltung der Seite können Sie verschiedene Bausteine über oder unter dem Produkt platzieren,
um eine ansprechende und überzeugende Präsentation zu schaffen.
Diese Seite ist ideal für die Promotion von Neuerscheinungen, Bestsellern oder speziellen Angeboten,
da sie es ermöglicht, das Produkt in einer klaren und fokussierten Weise zu präsentieren
und die Aufmerksamkeit der Besucher auf das Wesentliche zu lenken.
]]></de>
<en><![CDATA[
The product landing page is a specially designed page that makes it possible to
to focus on a single product and surround it with relevant content and modules.
The flexible design of the page allows you to place different modules above or below the product,
to create an appealing and convincing presentation.
This page is ideal for promoting new releases, bestsellers or special offers,
as it makes it possible to present the product in a clear and focused way
and draw visitors' attention to the essentials.
]]></en>
</locale>
<locale name="order.simple.checkout.settings.title">
<de><![CDATA[Produkt Landing Page]]></de>
<en><![CDATA[Product Landing Page]]></en>
</locale>
<locale name="order.simple.checkout.settings.productId">
<de><![CDATA[Produkt Id:]]></de>
<en><![CDATA[Product Id:]]></en>
</locale>
<locale name="order.simple.checkout.settings.productId.description">
<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>
</locale>
<locale name="order.simple.checkout.settings.ctaUrl">
<de><![CDATA[Aktion-URL (CTA)]]></de>
<en><![CDATA[Action url (CTA)]]></en>
</locale>
<locale name="order.simple.checkout.settings.ctaUrl.description">
<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 (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>
</groups>
<groups name="quiqqer/order-simple-checkout" datatype="js">
<locale name="SimpleCheckoutWindow.btn.continue">
<de><![CDATA[Weiter]]></de>
......
......@@ -2,12 +2,59 @@
<site>
<types>
<type type="types/simpleCheckout" icon="fa fa-shopping-cart ">
<type type="types/simpleCheckout" icon="fa fa-shopping-cart">
<locale group="quiqqer/order-simple-checkout" var="admin.types.simpleCheckout"/>
<desc>
<locale group="quiqqer/order-simple-checkout" var="admin.types.simpleCheckout.desc"/>
<locale group="quiqqer/order-simple-checkout" var="admin.types.simpleCheckout.description"/>
</desc>
</type>
<type type="types/productLandingPage" icon="fa fa-store">
<locale group="quiqqer/order-simple-checkout" var="admin.types.productLandingPage"/>
<desc>
<locale group="quiqqer/order-simple-checkout" var="admin.types.productLandingPage.description"/>
</desc>
<attributes>
<attribute>order.simple.productLandingPage.productId</attribute>
<attribute>order.simple.productLandingPage.ctaUrl</attribute>
</attributes>
<settings>
<category name="product-landing-page">
<settings>
<title>
<locale group="quiqqer/order-simple-checkout" var="order.simple.checkout.settings.title"/>
</title>
<input conf="order.simple.productLandingPage.productId"
data-qui="package/quiqqer/products/bin/controls/products/Select"
data-qui-options-max="1"
>
<text>
<locale group="quiqqer/order-simple-checkout"
var="order.simple.checkout.settings.productId"/>
</text>
<description>
<locale group="quiqqer/order-simple-checkout"
var="order.simple.checkout.settings.productId.description"/>
</description>
</input>
<input conf="order.simple.productLandingPage.ctaUrl">
<text>
<locale group="quiqqer/order-simple-checkout"
var="order.simple.checkout.settings.ctaUrl"/>
</text>
<description>
<locale group="quiqqer/order-simple-checkout"
var="order.simple.checkout.settings.ctaUrl.description"/>
</description>
</input>
</settings>
</category>
</settings>
</type>
</types>
</site>
<?php
namespace QUI\ERP\Order\SimpleCheckout;
use phpseclib3\File\ASN1\Maps\NameConstraints;
use QUI;
use QUI\Projects\Site\Edit;
use function is_array;
use function is_string;
use function json_decode;
use function json_encode;
class Events
{
public static function siteCreateChildEnd(Edit $Site): void
{
if ($Site->getAttribute('type') !== 'quiqqer/order-simple-checkout:types/productLandingPage') {
return;
}
QUI\Permissions\Permission::setUser(
QUI::getUsers()->getSystemUser()
);
$BrickManager = QUI\Bricks\Manager::init();
$Project = $Site->getProject();
foreach (self::getDemoBricksData($Site) as $data) {
$brickDataToSave = [
'attributes' => $data['attributes']
];
if (isset($data['settings'])) {
$brickDataToSave['settings'] = $data['settings'];
}
$Brick = new QUI\Bricks\Brick($brickDataToSave);
$brickId = $BrickManager->createBrickForProject($Project, $Brick);
// First, set brick type. so, extra settings and attributes can be set
if (!empty($brickDataToSave['attributes']['type'])) {
$BrickManager->saveBrick($brickId, [
'attributes' => [
'title' => $brickDataToSave['attributes']['title'],
'type' => $brickDataToSave['attributes']['type']
]
]);
}
// Assign the data here first
$BrickManager->saveBrick($brickId, $brickDataToSave);
// add brick to site
self::addBrickToSite($Site, $brickId, $data['assignedBrickArea']);
}
// save site
$Site->save(QUI::getUsers()->getSystemUser());
}
// region helper methods
/**
* Add a brick to a site.
*
* @param QUI\Projects\Site\Edit $Site Site object
* @param string|int $brickId Brick ID
* @param string $areaName Name of the area
*
* @return void
*/
public static function addBrickToSite(
Edit $Site,
string|int $brickId,
string $areaName
): void {
$areas = $Site->getAttribute('quiqqer.bricks.areas');
if (is_string($areas)) {
$areas = json_decode($areas, true);
}
if (!is_array($areas)) {
$areas = [];
}
$areas[$areaName][] = [
'brickId' => $brickId,
'customFields' => '',
'uid' => ''
];
$Site->setAttribute('quiqqer.bricks.areas', json_encode($areas));
}
public static function getDemoBricksData(Edit $Site): array
{
$Project = $Site->getProject();
$Media = $Project->getMedia();
$PlaceholdersImage = $Media->getPlaceholderImage();
$placeholderImage = $PlaceholdersImage->getUrl();
return [
[
'attributes' => [
'type' => '\\QUI\\PresentationBricks\\Controls\\WallpaperTextArrow',
'title' => 'Produkt Landingpage - Header (mit Produktbild) - ' . QUI\Utils\Uuid::get(),
'description' => '(Generierter Baustein für Seite ' . $Site->getId() . ')',
'content' => "<h1>Produkt Landing Page<br />\nf&uuml;r einen besonderer Artikel</h1>\n\n<p>Phasellus tempus. Integer tincidunt. Nam eget dui.. Praesent metus tellus, elementum eu, semper a, adipiscing nec, purus.</p>\n\n<p>&nbsp;</p>\n\n<p><a class=\"btn btn-primary btn-large btn-lg\" data-qui-productlandingpage-cta=\"1\" href=\"#\">Jetzt bestellen <i class=\"fa-solid fa-cart-shopping\"></i></a></p>\n",
'areas' => 'headerSuffix'
],
'settings' => [
'classes' => 'demo__product-landing-page__brick__header',
'image' => $placeholderImage,
'general.fullWidth' => 1,
'general.noSpacing' => 1
],
'assignedBrickArea' => 'headerSuffix'
],
[
'attributes' => [
'type' => '\\QUI\\Gallery\\Controls\\Logo\\InfiniteCarousel',
'title' => 'Produkt Landingpage - Logo-Karussell - ' . QUI\Utils\Uuid::get(),
'description' => '(Generierter Baustein für Seite ' . $Site->getId() . ')',
'content' => "",
'areas' => 'headerSuffix'
],
'settings' => [
'classes' => 'demo__product-landing-page__brick__logo',
'folderId' => '1',
'imgHeight' => '50',
'carouselBlockSpacing' => 'normal',
'animationDuration' => '40',
'stopAnimationOnHover' => '1',
'general.fullWidth' => 1,
'general.noSpacing' => 1
],
'assignedBrickArea' => 'headerSuffix'
],
[
'attributes' => [
'type' => '\\QUI\\Bricks\\Controls\\BoxContentAdvanced',
'title' => 'Produkt Landingpage - Boxen mit Icon - ' . QUI\Utils\Uuid::get(),
'description' => '(Generierter Baustein für Seite ' . $Site->getId() . ')',
'content' => "",
'areas' => 'headerSuffix'
],
'settings' => [
'classes' => 'demo__product-landing-page__brick__boxes',
'template' => 'standard',
'centerText' => true,
'entriesPerLine' => 4,
'entries' => "[{\"entryTitle\":\"Ut non enim eleifend\",\"entrySubTitle\":\"\",\"entryImage\":\"fa fa-anchor-circle-check\",\"entryUrl\":\"\",\"entryOrder\":\"\",\"entryContent\":\"<p>Curabitur turpis. Maecenas nec odio et ante tincidunt tempus.</p>\"},{\"entryTitle\":\"Nam ipsum risus\",\"entrySubTitle\":\"\",\"entryImage\":\"fa fa-bar-chart\",\"entryUrl\":\"\",\"entryOrder\":\"\",\"entryContent\":\"<p>Sed hendrerit. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem.</p>\"},{\"entryTitle\":\"Vestibulum fringilla pede\",\"entrySubTitle\":\"\",\"entryImage\":\"fa fa-arrow-trend-up\",\"entryUrl\":\"\",\"entryOrder\":\"\",\"entryContent\":\"<p>In turpis. Praesent nec nisl a purus blandit viverra.</p>\"},{\"entryTitle\":\"Fusce risus nisl\",\"entrySubTitle\":\"\",\"entryImage\":\"fa fa-envelopes-bulk\",\"entryUrl\":\"\",\"entryOrder\":\"\",\"entryContent\":\"<p>Phasellus viverra nulla ut metus varius laoreet.</p>\"}]"
],
'assignedBrickArea' => 'headerSuffix'
],
[
'attributes' => [
'type' => '\\QUI\\Bricks\\Controls\\TextAndImageMultiple',
'title' => 'Produkt Landingpage - Features (Text und Bilder) - ' . QUI\Utils\Uuid::get(),
'description' => '(Generierter Baustein für Seite ' . $Site->getId() . ')',
'content' => "<h2 style=\"text-align: center;\">In consectetuer turpis ut velit</h2>\n\n<p style=\"max-width: 60ch; text-align: center; margin-inline: auto;\">Morbi nec metus. Quisque id mi. Phasellus leo dolor, tempus non, auctor et, hendrerit quis, nisi. Praesent nec nisl a purus blandit viverra. Nulla consequat massa quis enim.</p>\n",
'areas' => 'headerSuffix'
],
'settings' => [
'textPosition' => 'center',
'imagePosition' => 'imageRightAlternately',
'textRatio' => '50',
'maxImageWidth' => '500',
'entriesPerLine' => 4,
'entries' => "[{\"image\":\"" . $placeholderImage . "\",\"text\":\"<h3>Phasellus viverra nulla ut metus</h3><p>Duis leo. Aliquam lorem ante, dapibus in, viverra quis, feugiat a, tellus. Donec mi odio, faucibus at, scelerisque quis, convallis in, nisi. Sed in libero ut nibh placerat accumsan. Phasellus volutpat, metus eget egestas mollis, lacus lacus blandit dui, id egestas quam mauris ut lacus.</p>\",\"isDisabled\":0},{\"image\":\"" . $placeholderImage . "\",\"text\":\"<h3>Duis vel nibh at velit</h3><p>In auctor lobortis lacus. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Cras ultricies mi eu turpis hendrerit fringilla.&nbsp;</p><ul><li>Ut non enim eleifend felis pretium feugiat.</li><li>Fusce vulputate eleifend sapien.</li><li>Fusce neque.</li><li>Quisque id odio.</li>t<li>Curabitur suscipit suscipit tellus.</li></ul><p><a class=\\\"btn btn-primary btn-large btn-lg\\\" href=\\\"#\\\" data-qui-productlandingpage-cta=\\\"1\\\">Jetzt bestellen <i class=\\\"fa-solid fa-cart-shopping\\\"></i></a></p>\",\"isDisabled\":0}]"
],
'assignedBrickArea' => 'headerSuffix'
],
[
'attributes' => [
'type' => '\\QUI\\PresentationBricks\\Controls\\WallpaperText',
'title' => 'Produkt Landingpage - Slogan - ' . QUI\Utils\Uuid::get(),
'description' => '(Generierter Baustein für Seite ' . $Site->getId() . ')',
'content' => "<p style=\"text-align: center;\"><span style=\"font-size:22px;\"><em>Phasellus viverra nulla ut metus varius laoreet. Aenean massa. Quisque libero metus, condimentum nec.</em></span></p>\n",
'areas' => 'headerSuffix'
],
'settings' => [
'minHeight' => '400px',
"bg-color" => "#f5f5f5",
"content-position" => "center",
'contentMaxWidth' => '600',
'fontColor' => '',
'general.fullWidth' => 1,
'general.noSpacing' => 1
],
'assignedBrickArea' => 'headerSuffix'
],
[
'attributes' => [
'type' => '\\QUI\\Bricks\\Controls\\Slider\\CustomerReviewsSlider',
'title' => 'Produkt Landingpage - Kunden Rezensionen - ' . QUI\Utils\Uuid::get(),
'description' => '(Generierter Baustein für Seite ' . $Site->getId() . ')',
'content' => "",
'areas' => 'headerSuffix,footerPrefix'
],
'settings' => [
'template' => 'templateOne',
'perView' => 3,
'gap' => 40,
'autoplay' => true,
'delay' => 5000,
'showArrows' => false,
'sliderHeight' => 'fixed',
'entries' => "[{\"image\":\"" . $placeholderImage . "\",\"customerName\":\"John Doe\",\"addition\":\"\",\"url\":\"\",\"urlTitle\":\"\",\"review\":\"<p>Vivamus laoreet. Praesent blandit laoreet nibh. Maecenas malesuada. Morbi vestibulum volutpat enim. Pellentesque dapibus hendrerit tortor.</p>\",\"isDisabled\":0},{\"image\":\"" . $placeholderImage . "\",\"customerName\":\"Peter Young\",\"addition\":\"\",\"url\":\"\",\"urlTitle\":\"\",\"review\":\"<p>Vestibulum suscipit nulla quis orci. Phasellus nec sem in justo pellentesque facilisis. Duis leo. Curabitur ligula sapien, tincidunt non, euismod vitae, posuere imperdiet, leo. Vestibulum rutrum, mi nec elementum vehicula.</p>\",\"isDisabled\":0},{\"image\":\"" . $placeholderImage . "\",\"customerName\":\"Ann Parks\",\"addition\":\"\",\"url\":\"\",\"urlTitle\":\"\",\"review\":\"<p>Ut leo. Etiam rhoncus. Ut id nisl quis enim dignissim sagittis. Nullam accumsan lorem in dui.</p>\",\"isDisabled\":0},{\"image\":\"" . $placeholderImage . "\",\"customerName\":\"Katrin Strong\",\"addition\":\"\",\"url\":\"\",\"urlTitle\":\"\",\"review\":\"<p>Vestibulum ullamcorper mauris at ligula. Proin faucibus arcu quis ante. Quisque libero metus, condimentum nec, tempor a, commodo mollis, magna. Cras ultricies mi eu turpis hendrerit fringilla. Sed fringilla mauris sit amet nibh.</p>\",\"isDisabled\":0}]"
],
'assignedBrickArea' => 'headerSuffix'
]
];
}
//endregion
}
{if $ProductControl}
<section class="quiqqer-orderSimpleCheckout-productLandingPage-product">
{$ProductControl->create()}
</section>
{/if}
\ No newline at end of file
<?php
/**
* This file contains a product landing page
*
* @var QUI\Projects\Project $Project
* @var QUI\Projects\Site $Site
* @var QUI\Interfaces\Template\EngineInterface $Engine
* @var QUI\Template $Template
*/
use QUI\ERP\Products\Handler\Products;
$productId = $Site->getAttribute('order.simple.productLandingPage.productId');
$ctaUrl = $Site->getAttribute('order.simple.productLandingPage.ctaUrl');
if (empty($productId)) {
$Engine->assign('Product', null);
} else {
try {
$Product = Products::getProduct($productId);
$ProductControl = new QUI\ERP\Products\Controls\Products\Product([
'Product' => $Product
]);
$Engine->assign('ProductControl', $ProductControl);
} catch (\QUI\ERP\Products\Product\Exception) {
$Engine->assign('Product', null);
}
}
if ($ctaUrl) {
$ctaUrl = filter_var($ctaUrl, FILTER_SANITIZE_URL);
$Template->extendHeader('<script>QUIQQER_LANDING_PAGE_CTA_URL = "' . $ctaUrl . '";</script>');
}
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