Design · PHP · Server

Design · PHP · Server

WordPress · Drupal · PrestaShop

  • Startseite
  • WordPress
  • PHP
  • Ubuntu
  • Prestashop
  • Indesign
  • Grafik

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

Themen

Adminbar Apache Attachment Count Automatische Updates Backend Boolean values Boolesche Werte BuddyPress Code Snippets Concatenation Operator Conditional Statement Datenbank Email Enfold Escape Zeichen Galerien genesis Grid View htaccess Layout Builder List View Logische Operatoren Loops Maskieren Media Manager Mitgliederbereich PHP PHP Kommentare PHP Anfänger PHP Variablen Plugins Prestashop Prestashop 1.5 Prestashop 1.6 Prestashop Module RSS Feed s2member Server ssl Strings Windows Windows 10 WooCommerce WooCommerce Sortierung WordPress

Letzte Kommentare

  • Thomas bei WordPress: Einzelne Kategorien aus dem RSS Feed ausschließen
  • Bernhard bei CSS: Automatische Silbentrennung in einzelnen Wörtern verhindern
  • Bernhard bei CSS: Automatische Silbentrennung in einzelnen Wörtern verhindern
  • MC bei PHP: Boolesche Werte (Boolean Values)
  • eno bei Zufällige Produktanordnung beim Featured Product Slider (PrestaShop 6.1.11 / Megashop Theme)

Informationen

  • Kontakt
  • Datenschutzerklärung
  • Impressum
  • Kontakt
  • Datenschutzerklärung
  • Impressum
Diese Website benutzt Cookies. Wenn Sie die Website weiter nutzen, stimmen Sie der Verwendung von Cookies zu.EinverstandenCookies von Drittanbietern ablehnenErfahren Sie mehr