Neu Zusätzliches Hersteller-Tab in 4.06

photoshop-becker

Aktives Mitglied
7. September 2011
29
0
Kann mir jemand sagen, wie ich in Shop 4.06 ein zusätzliches Hersteller-Tab mit den Herstelle-Infos aus der Wawi implementiere? In welcher tpl-(Child)-Datei muss ich die Änderung vornehmen? Die Template-Änderung in Shop 3 (https://forum.jtl-software.de/threads/hersteller-text-zusaetzlich-im-angebot-anzeigen-lassen.83566/) hilft mir leider nicht weiter:

{if $Artikel->cHerstellerBeschreibung != ''}
<div class="panel {if $Einstellungen.artikeldetails.artikeldetails_tabs_nutzen == "N"}notab{/if}" id="box_herstellerinformationen">
<h2 class="title">{lang key="herstellerInformationen" section="custom"}</h2>
{$Artikel->cHerstellerBeschreibung}
</div>
{/if}

Vielen Dank für eure Hilfe.
 

FPrüfer

Moderator
Mitarbeiter
19. Februar 2016
1.878
518
Halle
Hallo,
das Template welches du für Shop4 in einem Child-Template ersetzen musst ist productdetails/tabs.tpl. An zwei Stellen muss zusätzlicher Code eingefügt werden. Einmal für den Tab selbst und einmal für den Inhalt.
An das Ende des Containers <ul class="nav nav-tabs bottom15" role="tablist">, also ca. Zeile 128 kommt zusätzlich:
PHP:
{if $Artikel->cHerstellerBeschreibung != ''}
    <li role="presentation" {if $setActiveClass.tags} class="active"{/if}>
        <a href="#tab-manufacturer" aria-controls="tab-manufacturer" role="tab" data-toggle="tab">
            {lang key="manufacturer" section="productDetails"}
        </a>
    </li>
{/if}
Analog dazu an das Ende des Containers <div class="tab-content" id="article-tabs">, ca. Zeile 331 kommt zusätzlich:
PHP:
{if $Artikel->cHerstellerBeschreibung != ''}
    {if $tabanzeige}
        <div role="tabpanel" class="tab-pane fade {if $setActiveClass.tags} in active{/if}" id="tab-manufacturer">
    {else}
        <div class="panel panel-default">
            <div class="panel-heading">
                <h3 class="panel-title">{lang key="manufacturer" section="productDetails"}</h3>
            </div>
            <div class="panel-body" id="tab-manufacturer">
    {/if}
        {$Artikel->cHerstellerBeschreibung}
    {if $tabanzeige}
        </div>
    {else}
            </div>
        </div>
    {/if}
{/if}
 

photoshop-becker

Aktives Mitglied
7. September 2011
29
0
Leider funktioniert es bei mir nicht, oder ich habe den Code an die falsche Stelle gesetzt. Könnten Sie den Code hier einsetzen?

{$tabanzeige = $Einstellungen.artikeldetails.artikeldetails_tabs_nutzen !== 'N'}
{if $Artikel->cBeschreibung|strlen > 0 || $Einstellungen.artikeldetails.merkmale_anzeigen === 'Y'
&& $Artikel->oMerkmale_arr|count > 1}
{$tabsPaneleArr['description'] = [
'id' => 'description',
'cName' => "{block name='tab-description-title'}{lang key='description' section='productDetails'}{/block}",
'content' => '<div class="desc">' ,
'content2' => {$Artikel->cBeschreibung},
'content3' => '',
'content4' => '</div>',
'content5' => "{block name='tab-description-attributes'}{include file='productdetails/attributes.tpl' tplscope='details'}{/block}"
]}
{if (($Einstellungen.artikeldetails.mediendatei_anzeigen === 'YA' && $Artikel->cMedienDateiAnzeige !== 'tab')
|| $Artikel->cMedienDateiAnzeige === 'beschreibung') && !empty($Artikel->cMedienTyp_arr)}
{foreach name="mediendateigruppen" from=$Artikel->cMedienTyp_arr item=cMedienTyp}
{$mediaDescriptionContentArr[$cMedienTyp] = [
'content' => '<div class="media">',
'content2' => {include file='productdetails/mediafile.tpl'},
'content3' => '</div>'
]}
{/foreach}
{$tabsPaneleArr.description.content3 = $mediaDescriptionContentArr}
{/if}
{/if}
{if isset($Artikel->oDownload_arr) && $Artikel->oDownload_arr|@count > 0}
{$tabsPaneleArr['downloads'] = [
'id' => 'downloads',
'cName' => {lang section="productDownloads" key="downloadSection"},
'content' => {include file="productdetails/download.tpl"}
]}
{/if}
{section name=iterator start=1 loop=10}
{$tab = tab}
{$tabname = $tab|cat:$smarty.section.iterator.index|cat:" name"}
{$tabinhalt = $tab|cat:$smarty.section.iterator.index|cat:" inhalt"}
{if isset($Artikel->AttributeAssoc[$tabname]) && $Artikel->AttributeAssoc[$tabname]
&& $Artikel->AttributeAssoc[$tabinhalt]}
{$tabsPaneleArr[{$tabname|replace:' ':'-'}] = [
'id' => {$tabname|replace:' ':'-'},
'cName' => {$Artikel->AttributeAssoc[$tabname]},
'content' => {$Artikel->AttributeAssoc[$tabinhalt]}
]}
{/if}
{/section}
{if $Einstellungen.bewertung.bewertung_anzeigen === 'Y'}
{$tabsPaneleArr['votes'] = [
'id' => 'votes',
'cName' => {lang key="Votes" section="global"},
'content' => {include file="productdetails/reviews.tpl" stars=$Artikel->Bewertungen->oBewertungGesamt->fDurchschnitt}
]}
{/if}
{if $Einstellungen.artikeldetails.artikeldetails_fragezumprodukt_anzeigen === 'Y'}
{$tabsPaneleArr['questionOnItem'] = [
'id' => 'questionOnItem',
'cName' => {lang key="productQuestion" section="productDetails"},
'content' => {include file="productdetails/question_on_item.tpl" position="tab"}
]}
{/if}
{if $Einstellungen.preisverlauf.preisverlauf_anzeigen === 'Y' && $bPreisverlauf}
{$tabsPaneleArr['priceFlow'] = [
'id' => 'priceFlow',
'cName' => {lang key="priceFlow" section="productDetails"},
'content' => {include file="productdetails/price_history.tpl"}
]}
{/if}
{if $verfuegbarkeitsBenachrichtigung == 1 && $Artikel->cLagerBeachten === 'Y'}
{$tabsPaneleArr['availabilityNotification'] = [
'id' => 'availabilityNotification',
'cName' => {lang key="notifyMeWhenProductAvailableAgain" section="global"},
'content' => {include file="productdetails/availability_notification_form.tpl" position="tab" tplscope="artikeldetails"}
]}
{/if}
{if (($Einstellungen.artikeldetails.mediendatei_anzeigen === 'YM' && $Artikel->cMedienDateiAnzeige !== 'beschreibung')
|| $Artikel->cMedienDateiAnzeige === 'tab') && !empty($Artikel->cMedienTyp_arr)}
{foreach name="mediendateigruppen" from=$Artikel->cMedienTyp_arr item=cMedienTyp}
{$cMedienTypId = $cMedienTyp|regex_replace:"/[\'\"\/ ]/":""}
{$tabsPaneleArr[{$cMedienTypId}] = [
'id' => {$cMedienTypId},
'cName' => {$cMedienTyp},
'content' => {include file="productdetails/mediafile.tpl"}
]}
{/foreach}
{/if}
{if $Einstellungen.artikeldetails.tagging_anzeigen === 'Y' && (count($ProduktTagging) > 0
|| $Einstellungen.artikeldetails.tagging_freischaltung !== 'N')}
{$tabsPaneleArr['tags'] = [
'id' => 'tags',
'cName' => {lang key="productTags" section="productDetails"},
'content' => {include file="productdetails/tags.tpl"}
]}
{/if}

{if !empty($tabsPaneleArr)}
{if $tabanzeige}
<ul class="nav nav-tabs bottom15" role="tablist">
{foreach from=$tabsPaneleArr item=tabPanel name=tabPanelItem}
<li role="presentation"
{if $tabPanel.id === "votes" &&
(isset($smarty.get.ratings_nPage) && count($smarty.get.ratings_nPage) > 0
|| isset($smarty.get.bewertung_anzeigen) && count($smarty.get.bewertung_anzeigen) > 0
|| isset($smarty.get.ratings_nItemsPerPage) && count($smarty.get.ratings_nItemsPerPage) > 0
|| isset($smarty.get.ratings_nSortByDir) && count($smarty.get.ratings_nSortByDir) > 0
|| isset($smarty.get.btgsterne) && count($smarty.get.btgsterne) > 0)}
class="active"
{else}
{if $smarty.foreach.tabPanelItem.first && !isset($smarty.get.ratings_nPage)
&& !isset($smarty.get.bewertung_anzeigen) && !isset($smarty.get.btgsterne)
&& !isset($smarty.get.ratings_nItemsPerPage) && !isset($smarty.get.ratings_nSortByDir)}
class="active"
{/if}
{/if}>
<a href="#tab-{$tabPanel.id}" aria-controls="tab-{$tabPanel.id}" role="tab" data-toggle="tab">{$tabPanel.cName}</a>
</li>
{/foreach}
</ul>
{/if}
<div class="tab-content" id="article-tabs">
{foreach from=$tabsPaneleArr item=tabPanele name=tabPaneleItem}
{if $tabanzeige}
{if $tabPanele.id === "votes" &&
(isset($smarty.get.ratings_nPage) && count($smarty.get.ratings_nPage) > 0
|| isset($smarty.get.bewertung_anzeigen) && count($smarty.get.bewertung_anzeigen) > 0
|| isset($smarty.get.ratings_nItemsPerPage) && count($smarty.get.ratings_nItemsPerPage) > 0
|| isset($smarty.get.ratings_nSortByDir) && count($smarty.get.ratings_nSortByDir) > 0
|| isset($smarty.get.btgsterne) && count($smarty.get.btgsterne) > 0)}
<div role="tabpanel" class="tab-pane fade in active"
{else}
<div role="tabpanel" class="tab-pane fade
{if $smarty.foreach.tabPaneleItem.first && !isset($smarty.get.ratings_nPage)
&& !isset($smarty.get.bewertung_anzeigen) && !isset($smarty.get.btgsterne)
&& !isset($smarty.get.ratings_nItemsPerPage)&& !isset($smarty.get.ratings_nSortByDir)} in active{/if}"
{/if}
id="tab-{$tabPanele.id}">
{else}
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">{$tabPanele.cName}</h3>
</div>
<div class="panel-body" id="tab-{$tabPanele.id}">
{/if}
{$tabPanele.content}
{if !empty($tabPanele.content2)}
{$tabPanele.content2}
{/if}
{if !empty($tabPanele.content3)}
<div class="top15">
{foreach from=$tabPanele.content3 item=content3}
{$content3.content}
{$content3.content2}
{$content3.content3}
{/foreach}
</div>
{/if }
{if !empty($tabPanele.content4)}
{$tabPanele.content4}
{/if}
{if !empty($tabPanele.content5)}
{$tabPanele.content5}
{/if}
{if $tabanzeige}
</div>
{else}
</div>
</div>
{/if}
{/foreach}
</div>
{/if}
 

FPrüfer

Moderator
Mitarbeiter
19. Februar 2016
1.878
518
Halle
Hallo,
am Ende des Tab-Containers (<ul class="nav nav-tabs bottom15" role="tablist">) gibt es den Code-Block:
PHP:
{if $useTags}
    <li role="presentation" {if $setActiveClass.tags} class="active"{/if}>
        <a href="#tab-tags" aria-controls="tab-tags" role="tab" data-toggle="tab">
            {lang key="productTags" section="productDetails"}
        </a>
    </li>
{/if}
direkt danach fügst du den ersten Teil ein, so dass das danach so aussieht:
PHP:
{if $useTags}
    <li role="presentation" {if $setActiveClass.tags} class="active"{/if}>
        <a href="#tab-tags" aria-controls="tab-tags" role="tab" data-toggle="tab">
            {lang key="productTags" section="productDetails"}
        </a>
    </li>
{/if}
{if $Artikel->cHerstellerBeschreibung != ''}
    <li role="presentation" {if $setActiveClass.tags} class="active"{/if}>
        <a href="#tab-manufacturer" aria-controls="tab-manufacturer" role="tab" data-toggle="tab">
            {lang key="manufacturer" section="productDetails"}
        </a>
    </li>
{/if}
Am Ende des Inhalt-Containers (<div class="tab-content" id="article-tabs">) steht:
PHP:
{if $useTags}
    {if $tabanzeige}
        <div role="tabpanel" class="tab-pane fade {if $setActiveClass.tags} in active{/if}" id="tab-tags">
    {else}
        <div class="panel panel-default">
            <div class="panel-heading">
                <h3 class="panel-title">{lang key="productTags" section="productDetails"}</h3>
            </div>
            <div class="panel-body" id="tab-tags">
    {/if}
    {include file="productdetails/tags.tpl"}
    {if $tabanzeige}
        </div>
    {else}
            </div>
        </div>
    {/if}
{/if}
Direkt danach setzt du den zweiten Teil ein, so dass es danach so aussieht:
PHP:
{if $useTags}
    {if $tabanzeige}
        <div role="tabpanel" class="tab-pane fade {if $setActiveClass.tags} in active{/if}" id="tab-tags">
    {else}
        <div class="panel panel-default">
            <div class="panel-heading">
                <h3 class="panel-title">{lang key="productTags" section="productDetails"}</h3>
            </div>
            <div class="panel-body" id="tab-tags">
    {/if}
    {include file="productdetails/tags.tpl"}
    {if $tabanzeige}
        </div>
    {else}
            </div>
        </div>
    {/if}
{/if}
{if $Artikel->cHerstellerBeschreibung != ''}
    {if $tabanzeige}
        <div role="tabpanel" class="tab-pane fade {if $setActiveClass.tags} in active{/if}" id="tab-manufacturer">
    {else}
        <div class="panel panel-default">
        <div class="panel-heading">
            <h3 class="panel-title">{lang key="manufacturer" section="productDetails"}</h3>
        </div>
        <div class="panel-body" id="tab-manufacturer">
    {/if}
    {$Artikel->cHerstellerBeschreibung}
    {if $tabanzeige}
        </div>
    {else}
            </div>
        </div>
    {/if}
{/if}
Anm.: Bitte formatiere Code bitte mit der entsprechenden Funktion, dass ist sonst nicht lesbar.
 

photoshop-becker

Aktives Mitglied
7. September 2011
29
0
Den Code-Block

{if $useTags}
<li role="presentation" {if $setActiveClass.tags} class="active"{/if}>
<a href="#tab-tags" aria-controls="tab-tags" role="tab" data-toggle="tab">
{lang key="productTags" section="productDetails"}
</a>
</li>
{/if}

habe ich nicht. <ul class="nav nav-tabs bottom15" steht bei mit in Zeile 94.

Und diesen Block habe ich auch nicht:

{if $useTags}
{if $tabanzeige}
<div role="tabpanel" class="tab-pane fade {if $setActiveClass.tags} in active{/if}" id="tab-tags">
{else}
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">{lang key="productTags" section="productDetails"}</h3>
</div>
<div class="panel-body" id="tab-tags">
{/if}
{include file="productdetails/tags.tpl"}
{if $tabanzeige}
</div>
{else}
</div>
</div>
{/if}
{/if}

Zeile 311 gibt es bei mir auch nicht. Es geht nur bis Zeile 168.

Ich nutze das EVO-406.
 

photoshop-becker

Aktives Mitglied
7. September 2011
29
0
Hat jetzt funktioniert. Ich habe etwas herum probiert und dann die Blöcke mit den entsprechenden Codes aus Ihrer ersten Antwort eingefügt.

Besten Dank.
 

FPrüfer

Moderator
Mitarbeiter
19. Februar 2016
1.878
518
Halle
Anm.: Alle meine Code-Beispiele beziehen sich immer - sofern nicht anders angegeben - auf die zu diesem Zeitpunkt aktuelle Version des JTL- Shop. In dem Fall hier also auf die 4.06.17.