Design Meets Code

Design Meets Code

WordPress · PrestaShop

  • Startseite
  • WordPress
  • PHP / Datenbanken
  • Ubuntu
  • Prestashop
  • Verschiedenes
  • Grafik
  • Glossar

Prestashop: Produkt-Tags in der Produktbeschreibung anzeigen

29. Januar 2014 Leave a Comment

Um Tags auf der Produkteinzelansicht zu zeigen, öffne die Datei product.tpl und suche die Zeile

<div id="primary_block" class="clearfix">

Direkt dahinter füge dann folgenden Code ein

<ul class="producttags">
    {foreach from=Tag::getProductTags(Tools::getValue('id_product')) key=k item=v}
        {foreach from=$v item=value}
            <li><a href="{$link->getPageLink('search', true, NULL, "tag={$value|urlencode}")}">{$value|escape:html:'UTF-8'}</a></li>
        {/foreach}
    {/foreach}
</ul>

Um die Tags zu stylen, füge folgende CSS Deklarationen in die global.css ein

.producttags {
    list-style:none;
    position:relative;
    clear:both;
    display:block;
    padding-bottom:20px;
    margin-bottom:20px;
}
 
.producttags li, .producttags a{
    float:left;
    height:24px;
    line-height:24px;
    position:relative;
    font-size:11px;
    }
 
.producttags a{
    margin-left:20px;
    padding:0 10px 0 12px;
    background:#0089e0;
    color:#fff;
    text-decoration:none;
    -moz-border-radius-bottomright:4px;
    -webkit-border-bottom-right-radius:4px;
    border-bottom-right-radius:4px;
    -moz-border-radius-topright:4px;
    -webkit-border-top-right-radius:4px;   
    border-top-right-radius:4px;   
}
.producttags a:visited{
    color:#fff;
}
 
.producttags a:before{
    content:"";
    float:left;
    position:absolute;
    top:0;
    left:-12px;
    width:0;
    height:0;
    border-color:transparent #0089e0 transparent transparent;
    border-style:solid;
    border-width:12px 12px 12px 0;     
}
 
.producttags a:after{
    content:"";
    position:absolute;
    top:10px;
    left:0;
    float:left;
    width:4px;
    height:4px;
    -moz-border-radius:2px;
    -webkit-border-radius:2px;
    border-radius:2px;
    background:#fff;
    -moz-box-shadow:-1px -1px 2px #004977;
    -webkit-box-shadow:-1px -1px 2px #004977;
    box-shadow:-1px -1px 2px #004977;
}
 
.producttags a:hover{background:#555; text-decoration:none;}   
 
.producttags a:hover:before{border-color:transparent #555 transparent transparent;}

Nun erscheinen die Produkt-Tags gleich oberhalb der Produktbeschreibung. Sie können natürlich auch an einer anderen Stelle eingefügt werden.

tags

Quelle: mypresta.eu

Ist der Shop mehrsprachig angelegt, so filtert der folgende Code die Tags nach Sprache:

{if isset($product->tags) && $product->tags}
<ul class="producttags">

{assign var='id_lang' value=Language::getIdByIso($lang_iso)}
{assign var='productTags' value=$product->tags}
{foreach from=$productTags[$id_lang] item=productTag name=productTags}
<li>  <a href="{$base_dir}index.php?controller=search&tag={$productTag|escape:'url'}"><strong>{$productTag}</strong></a></li>{if !$smarty.foreach.productTags.last}, {/if}
{/foreach}
</ul>
{/if}

Quelle: prestashop.com

Filed Under: Prestashop Tagged With: Prestashop 1.5, Produkt-Tags

Text Widgets für Prestashop

24. November 2013 Leave a Comment

Das Modul contentbox erlaubt es, Text an irgendeiner beliebigen Position einer Prestashop Seite einzufügen.

Filed Under: Prestashop Tagged With: Prestashop 1.5, Prestashop Module

Anzeige

Themen

Apache BuddyPress Code Snippets CSS Datenbank Email Enfold genesis Grid View htaccess i-mscp Indesign Katalogpreisregel Layout Builder LibreOffice Lieferschein List View Medien Mitgliederbereich MySQL PHP PHP Anfänger PHP Variablen Plugins Prestashop Prestashop 1.5 Prestashop 1.6 Prestashop 1.7 Prestashop 8 Prestashop Module Registrierung RSS Feed s2member Server ssl Startseite Strings Tag Cloud Tipps Windows Windows 10 Windows 11 WooCommerce WooCommerce Sortierung WordPress
Anzeige

Letzte Kommentare

  • Martin zu CSS: Automatische Silbentrennung in einzelnen Wörtern verhindern
  • Martin zu CSS: Automatische Silbentrennung in einzelnen Wörtern verhindern
  • Klaus zu Woocommerce: Shop Seiten neu generieren
  • Thomas zu WordPress: Einzelne Kategorien aus dem RSS Feed ausschließen
  • Bernhard zu CSS: Automatische Silbentrennung in einzelnen Wörtern verhindern

Informationen

  • Kontakt
  • Datenschutzerklärung
  • Impressum
  • Cookie-Richtlinie (EU)
  • Kontakt
  • Datenschutzerklärung
  • Impressum
  • Cookie-Richtlinie (EU)
Anzeige