Skip to content
Code-Schnipsel Gruppen Projekte

Revisionen vergleichen

Änderungen werden so angezeigt, als ob die Quellrevision mit der Zielrevision zusammengeführt würde. Erfahre mehr über den Vergleich von Revisionen.

Quelle

Zielprojekt auswählen
No results found

Ziel

Zielprojekt auswählen
  • quiqqer/template-cologne
1 Ergebnis
Änderungen anzeigen
werden angezeigt mit 110 Ergänzungen und 46 Löschungen
......@@ -69,12 +69,12 @@
{/foreach}
{assign var=ShippingTimeFrontendView
value=\QUI\TemplateCologne\Utils::getShippingTimeFrontendView($Product->getId())}
value=QUI\TemplateCologne\Utils::getShippingTimeFrontendView($Product->getId())}
{if $ShippingTimeFrontendView}
{$ShippingTimeFrontendView->create()}
{/if}
{assign var=StockFrontendView value=\QUI\TemplateCologne\Utils::getStockFrontendView($Product->getId())}
{assign var=StockFrontendView value=QUI\TemplateCologne\Utils::getStockFrontendView($Product->getId())}
{if $StockFrontendView}
{$StockFrontendView->create()}
{/if}
......
......@@ -52,12 +52,12 @@
{/foreach}
{assign var=ShippingTimeFrontendView
value=\QUI\TemplateCologne\Utils::getShippingTimeFrontendView($Product->getId())}
value=QUI\TemplateCologne\Utils::getShippingTimeFrontendView($Product->getId())}
{if $ShippingTimeFrontendView}
{$ShippingTimeFrontendView->create()}
{/if}
{assign var=StockFrontendView value=\QUI\TemplateCologne\Utils::getStockFrontendView($Product->getId())}
{assign var=StockFrontendView value=QUI\TemplateCologne\Utils::getStockFrontendView($Product->getId())}
{if $StockFrontendView}
{$StockFrontendView->create()}
{/if}
......
......@@ -40,9 +40,9 @@
<type><![CDATA[bool]]></type>
<defaultvalue>1</defaultvalue>
</conf>
<conf name="basketOpen">
<type><![CDATA[integer]]></type>
<defaultvalue>2</defaultvalue>
<conf name="basketAction">
<type><![CDATA[string]]></type>
<defaultvalue>openSmallBasket</defaultvalue>
</conf>
<conf name="hideEmptyFields">
<type><![CDATA[bool]]></type>
......@@ -454,27 +454,35 @@
</description>
</input>
<!-- basket open (nothing order window, order page)-->
<select conf="templateCologne.settings.basketOpen">
<!-- basket action (openSmallBasket, openOrderProcessUrl, openOrderProcess (qui popup))-->
<select conf="templateCologne.settings.basketAction">
<text>
<locale group="quiqqer/template-cologne"
var="settings.shop.basketOpen"
var="settings.shop.basketAction"
/>
</text>
<description>
<locale group="quiqqer/template-cologne"
var="settings.shop.basketAction.desc"
/>
</description>
<option value="0">
<option value="openSmallBasket">
<locale group="quiqqer/template-cologne"
var="settings.shop.basketOpen.nothing"
var="settings.shop.basketAction.openSmallBasket"
/>
</option>
<option value="1">
<option value="openOrderProcessUrl">
<locale group="quiqqer/template-cologne"
var="settings.shop.basketOpen.window"
var="settings.shop.basketAction.openOrderProcessUrl"
/>
</option>
<option value="2">
<option value="openOrderProcess">
<locale group="quiqqer/template-cologne"
var="settings.shop.basketOpen.page"
var="settings.shop.basketAction.openOrderProcess"
/>
</option>
</select>
......
......@@ -72,10 +72,14 @@ public function getBody(): string
}
$cache = EventHandler::menuCacheName() . '/megaMenu/';
$cachePah = '';
if (method_exists($this->getSite(), 'getCachePath')) {
$cachePah = $this->getSite()->getCachePath();
}
$cache .= md5(
$this->getSite()->getCachePath() .
serialize($this->getAttributes())
$cachePah . serialize($this->getAttributes())
);
try {
......
......@@ -7,6 +7,7 @@
namespace QUI\TemplateCologne;
use QUI;
use Smarty;
use QUI\ERP\Products\Product\ViewFrontend;
use QUI\Smarty\Collector;
......@@ -71,4 +72,17 @@ public static function onQuiqqerProductsProductButtonsEnd(
</div>'
);
}
/**
* Event: on smarty init
*
* @param Smarty $Smarty
* @return void
*/
public static function onSmartyInit(Smarty $Smarty): void
{
$Smarty->registerClass('QUI\TemplateCologne\Utils', '\QUI\TemplateCologne\Utils');
$Smarty->registerClass('QUI\Bricks\Manager', '\QUI\Bricks\Manager');
$Smarty->registerClass('QUI\ERP\Products\Utils\Products', '\QUI\ERP\Products\Utils\Products');
}
}
......@@ -11,8 +11,8 @@
use QUI\ERP\Shipping\Shipping;
use QUI\ERP\StockManagement\StockManager;
use QUI\Projects\Project;
use QUI\Projects\Site;
use QUI\TemplateCologne\Controls\Payments;
use ReflectionClass;
use function class_exists;
use function count;
......@@ -32,7 +32,7 @@ class Utils
* @throws QUI\Exception
*
*/
public static function getAvatar(mixed $User): QUI\Projects\Media\Image|bool
public static function getAvatar(mixed $User): QUI\Projects\Media\Image | bool
{
if (!$User instanceof QUI\Interfaces\Users\User) {
throw new QUI\Exception([
......@@ -73,15 +73,10 @@ public static function getAvatar(mixed $User): QUI\Projects\Media\Image|bool
* @return array|bool|object|string
* @throws QUI\Exception
*/
public static function getConfig(array $params): object|array|bool|string
public static function getConfig(array $params): object | array | bool | string
{
/** @var $Site Site */
$Site = $params['Site'];
/* @var $Project Project */
$Project = $params['Project'];
/* @var $Project QUI\Template */
$Template = $params['Template'];
$cacheName = md5($Site->getId() . $Project->getName() . $Project->getLang());
......@@ -237,13 +232,10 @@ public static function getConfig(array $params): object|array|bool|string
}
// basket open
$basketOpen = 2;
$basketAction = $Project->getConfig('templateCologne.settings.basketAction');
switch ($Project->getConfig('templateCologne.settings.basketOpen')) {
case '0':
case '1':
case '2':
$basketOpen = $Project->getConfig('templateCologne.settings.basketOpen');
if (!in_array($basketAction, ['openSmallBasket', 'openOrderProcessUrl', 'openOrderProcess'])) {
$basketAction = 'openSmallBasket';
}
$settingsCSS = include 'settings.css.php';
......@@ -355,7 +347,7 @@ public static function getConfig(array $params): object|array|bool|string
$config['siteType'] = $siteType;
$config['pageCustomClass'] = $pageCustomClass;
$config['basketStyle'] = $basketStyle;
$config['basketOpen'] = $basketOpen;
$config['basketAction'] = $basketAction;
$config['showCategoryMenu'] = $showCategoryMenu;
$config['homeLink'] = $homeLink;
$config['homeLinkText'] = $homeLinkText;
......@@ -602,7 +594,7 @@ private static function getPredefinedFooter(Project $Project): array
*
* @return false|QUI\ERP\Products\Field\View
*/
public static function getShippingTimeFrontendView(int $productId)
public static function getShippingTimeFrontendView(int $productId): bool | QUI\ERP\Products\Field\View
{
try {
$Product = QUI\ERP\Products\Handler\Products::getProduct($productId);
......@@ -612,7 +604,7 @@ public static function getShippingTimeFrontendView(int $productId)
return false;
}
if (QUI::getPackageManager()->isInstalled('quiqqer/stock-management')) {
if (class_exists('QUI\ERP\StockManagement\StockManager')) {
return StockManager::getShippingTimeFrontendViewByProduct($Product);
}
......@@ -620,6 +612,16 @@ public static function getShippingTimeFrontendView(int $productId)
return false;
}
if (!class_exists('QUI\ERP\Shipping\Shipping')) {
return false;
}
$reflection = new ReflectionClass(Shipping::class);
if (!$reflection->hasConstant('PRODUCT_FIELD_SHIPPING_TIME')) {
return false;
}
try {
$ShippingField = $Product->getField(Shipping::PRODUCT_FIELD_SHIPPING_TIME);
} catch (\Exception $Exception) {
......@@ -659,6 +661,10 @@ public static function getStockFrontendView(int $productId)
return false;
}
if (!class_exists('QUI\ERP\StockManagement\StockManager')) {
return false;
}
try {
$Product = QUI\ERP\Products\Handler\Products::getProduct($productId);
$StockField = $Product->getField(StockManager::PRODUCT_FIELD_STOCK);
......@@ -668,7 +674,6 @@ public static function getStockFrontendView(int $productId)
return false;
}
/** @var QUI\ERP\StockManagement\Products\Fields\StockView $StockView */
$StockView = $StockField->getFrontendView();
if (method_exists($StockView, 'setProduct')) {
......@@ -712,7 +717,7 @@ public static function convertBrickCSSClass(array $classes): string
* @param string $settingName
* @return bool|array|int|string
*/
public static function getSetting(string $settingName): bool|array|int|string
public static function getSetting(string $settingName): bool | array | int | string
{
if (empty($settingName)) {
return false;
......@@ -732,6 +737,5 @@ public static function getSetting(string $settingName): bool|array|int|string
return '';
}
}
}
<?php
/**
* cologne template file
*
* @var QUI\Projects\Project $Project
* @var QUI\Projects\Site $Site
* @var QUI\Interfaces\Template\EngineInterface $Engine
* @var QUI\Template $Template
**/
$largeSpacing = $Site->getAttribute('templateCologne.largeSpacing');
$headerImagePosition = $Project->getConfig('templateCologne.settings.headerImagePosition');
......@@ -7,7 +15,6 @@
ob_start();
?>
<?php if ($largeSpacing) { ?>
/* more spacing */
.page-content-header,
......
......@@ -13,7 +13,6 @@
<link rel="stylesheet" href="{$Template->getTemplateUrl('bin/css/products.css')}"/>
<link rel="stylesheet" href="{$Template->getTemplateUrl('bin/css/frontend-users.css')}"/>
<link rel="stylesheet" href="{$Template->getTemplateUrl('bin/css/order.css')}"/>
<link rel="stylesheet" href="{$Template->getTemplateUrl('bin/css/user-orders.css')}"/>
<link rel="stylesheet" href="{$Template->getTemplateUrl('bin/css/controls.css')}"/>
<link rel="stylesheet" href="{$Template->getTemplateUrl('bin/css/mini-basket.css')}"/>
<link rel="stylesheet" href="{$Template->getTemplateUrl('bin/css/product-bricks.css')}"/>
......
......@@ -10,14 +10,18 @@
<button disabled class="quiqqer-order-basketButton button--callToAction tpl-btn basket-style-{$basketStyle}"
style="float: right;"><span class="quiqqer-order-basketButton-icon-custom"><span
class="fa fa-shopping-basket"></span></span><span
class="quiqqer-order-basketButton-quantity quiqqer-order-basketButton-batch-custom">0</span></button>
class="quiqqer-order-basketButton-quantity quiqqer-order-basketButton-batch-custom">
<span class="fa fa-spinner fa-spin"></span>
</span></button>
{else}
<button disabled class="quiqqer-order-basketButton button--callToAction tpl-btn basket-style-full"
style="float: right;">
<span class="quiqqer-order-basketButton-icon-custom">
<span class="fa fa-shopping-basket"></span>
</span>
<span class="quiqqer-order-basketButton-quantity quiqqer-order-basketButton-batch-custom">0</span>
<span class="quiqqer-order-basketButton-quantity quiqqer-order-basketButton-batch-custom">
<span class="fa fa-spinner fa-spin"></span>
</span>
<span class="quiqqer-order-basketButton-sum">
{*$InitialBasketPrice->getDisplayPrice()*}
{$initialBasketPrice}
......
......@@ -25,7 +25,7 @@
{assign var=brickNoPadding value="brick-no-spacing"}
{/if}
{assign var=classes value=\QUI\TemplateCologne\Utils::convertBrickCSSClass($Brick->getAttribute('classes'))}
{assign var=classes value=QUI\TemplateCologne\Utils::convertBrickCSSClass($Brick->getAttribute('classes'))}
<section class="template-brick-container template-brick-headerSuffix brick-id-{$Brick->getAttribute('id')} {$classes}">
<div class="template-grid-container template-grid-row {$brickFullWidth} {$brickNoPadding}">
......@@ -54,7 +54,7 @@
{assign var=brickNoPadding value="brick-no-spacing"}
{/if}
{assign var=classes value=\QUI\TemplateCologne\Utils::convertBrickCSSClass($Brick->getAttribute('classes'))}
{assign var=classes value=QUI\TemplateCologne\Utils::convertBrickCSSClass($Brick->getAttribute('classes'))}
<section class="template-brick-container template-brick-footerPrefix brick-id-{$Brick->getAttribute('id')} {$classes}">
<div class="template-grid-container template-grid-row {$brickFullWidth} {$brickNoPadding}">
......
......@@ -24,7 +24,7 @@
{/if}
{* END language & currency switch *}
<span class="cologne-header-control-user">
<div class="cologne-header-control-user">
{if $User->getId()}
{$Avatar->create()}
{else}
......@@ -34,6 +34,6 @@
<span class="cologne-header-control-user-loader">
<span class="fa fa-pulse fa-circle-o-notch"></span>
</span>
</span>
</div>
</div>
</div>
\ No newline at end of file
<?php
if (!defined('QUIQQER_SYSTEM')) {
define('QUIQQER_SYSTEM', true);
}
if (!defined('QUIQQER_AJAX')) {
define('QUIQQER_AJAX', true);
}
putenv("QUIQQER_OTHER_AUTOLOADERS=KEEP");
require_once __DIR__ . '/../../../../bootstrap.php';
<?php
if (!defined('QUIQQER_SYSTEM')) {
define('QUIQQER_SYSTEM', true);
}
if (!defined('QUIQQER_AJAX')) {
define('QUIQQER_AJAX', true);
}
require_once __DIR__ . '/../../../../bootstrap.php';