Shop: Artikelliste
kann im Layout-Designer nicht angezeigt werden.
';
exit();
}
$tc = new ShopTextController();
$currentPageUrl = 'widerrufsbelehrung.html';
$detailsPageUrl = 'artikeldetail.php';
$builtInCategoryId = 1;
$pathToRoot = '';
$vc = new ShopOptionValueController();
$productsPerPage = $vc->Value('products-per-page');
$imagePlaceholder = $pathToRoot . $vc->Value('image-placeholder');
$parsedCategoryId = ShopArticleViewHelper::ParseId(UrlHelper::GetCurrentFullUrl());
$categoryId = $parsedCategoryId > 0 ? $parsedCategoryId : $builtInCategoryId;
$catController = new ShopCategoryController();
$articleController = new ShopArticleController();
$category = $catController->GetCategoryById($categoryId);
$parentCategories = $catController->GetParentCategoriesById($categoryId);
$childCategories = $catController->GetCategoriesByParentId($categoryId);
$childArticleCount = $articleController->CountArticlesByCategoryId($categoryId);
// paging
$currentUrl = UrlHelper::GetCurrentFullUrl();
$pages = ceil($childArticleCount / $productsPerPage);
$currentPage = UrlHelper::GetParameter($currentUrl, 'page', 1);
if ( $currentPage > $pages ){
$currentPage = $pages;
}
else if ( $currentPage < 1){
$currentPage = 1;
}
$currentProductNo = ($productsPerPage * $currentPage) - $productsPerPage;
$prevPageUrl = $currentPage > 1 ? UrlHelper::SetParameter($currentUrl, 'page', $currentPage-1) : "";
$nextPageUrl = $currentPage < $pages ? UrlHelper::SetParameter($currentUrl, 'page', $currentPage+1) : "";
// get child articles for currentPage
$childArticles = $articleController->GetArticlesByCategoryId($categoryId, UrlHelper::GetParameter(UrlHelper::GetCurrentFullUrl(), 'offset', $currentProductNo), $productsPerPage);
$pathToRoot = '';
$ccwidth = 276;
$imagePlaceholder = $pathToRoot . 'assets/php/shop/images/image-placeholder-grey.png';
// get link to project-wide shipmend cost page
$lec = new ShopLegalEntityController();
$le = $lec->GetLegalEntityById(ZPS_LEGAL_ENTITY_ID);
$shipmentCostsPageOid = $le->ShipmentCostsPageOid;
$ppc = new ShopPreparedArticleController();
$ppp = new ShopPreparedPageController();
$pp3 = $ppc->GetByOid($shipmentCostsPageOid);
if ( is_null($pp3) ) $pp3 = $ppp->GetByOid($shipmentCostsPageOid);
$shipmentCostsLink = is_null($pp3) ? '' : PathHelper::JoinPathVirtual( $pathToRoot, $pp3->RelativeUrl );
// Helper function to format Grundpreis for listings, depending if a product or a variant is being listed
if(!function_exists("getGrundpreis")) {
function getGrundpreis($gpVariant, $gpArticle){
// Grundpreis
$gpReturnVal = "";
if ( $gpVariant ){
if ( $gpVariant->UseGrundpreis ) {
$gpReturnVal = ' ' . ShopGrundpreisHelper::FormatGrundpreis($gpVariant) . '';
}
} else{
if ( $gpArticle->UseGrundpreis ) {
$gpReturnVal = ' ' . ShopGrundpreisHelper::FormatGrundpreis($gpArticle) . '';
}
}
return $gpReturnVal;
}
}
?> = $parentCategory->Name ?> » = $category->Name ?>
= $tc->Text('alert-category-not-found') ?>
$childArticle) {
$articleImages = $articleController->GetArticleImagesByArticleId($childArticle->Id);
$aurl = ShopArticleViewHelper::BuildUrl($childArticle, $detailsPageUrl);
// get price of first variant (which will initially be displaed in the article details, so we can display that instead of the generic article price (which can't be ordered)
$articleVariant = NULL;
$articleVariants = $articleController->GetVariantsByArticleId($childArticle->Id);
if ( !empty($articleVariants) ){
// Varianten nach Preis aufsteigend sortieren
usort($articleVariants, function($a, $b) { if ($a == $b) { return 0;} return ($a->Price < $b->Price) ? -1 : 1; });
// 1. variante ist die mit dem biligsten Preise
$articleVariant = $articleController->GetArticleVariantById($articleVariants[ 0]->Id, $pathToRoot, 124);
}
// Grundpreis
$grundPreis = getGrundpreis($articleVariant, $childArticle);
?>
$productsPerPage ){ ?> = $childArticle->ShortDescription ?>
= $tc->Text('preis-ab') ?> = CurrencyHelper::FormatMoney($articleVariant->Price) ?> NonReducedPrice > 0 ){ ?> = CurrencyHelper::FormatMoney($articleVariant->NonReducedPrice) ?> = CurrencyHelper::FormatMoney($childArticle->Price) ?> NonReducedPrice > 0 ){ ?> = CurrencyHelper::FormatMoney($childArticle->NonReducedPrice) ?> = $grundPreis ?> FreeShipping ){ ?>
= $tc->Text('beschreibung-preis-kostenloser-versand', $shipmentCostsLink) ?>
= $tc->Text('beschreibung-preis', $shipmentCostsLink) ?>
= $tc->Text('text-previous-page') ?> = $tc->Text('text-paging', $currentPage, $pages) ?> = $tc->Text('text-next-page') ?>
= $tc->Text('title-unterkategorien') ?>
- ImageUnique) ){
$subcategoryImageSrc = ShopArticleImageViewHelper::BuildCategoryImageUrl($childCategory, $pathToRoot);
$subcategoryImageAlt = $childCategory->ImageAltText;
$subcategoryImageTitle = $childCategory->ImageDescription;
}
else{
$subcategoryImageSrc = $imagePlaceholder;
$subcategoryImageAlt = '';
$subcategoryImageTitle = '';
}
?>
-
= $childCategory->Name ?>
= $tc->Text('alert-article-none-found') ?>
Widerrufsbelehrung
Gemäß § 355 BGB haben Sie das Recht, diesen Vertrag innerhalb von 14 Tagen ohne Angabe von Gründen zu wiederufen.
