Jump to content
thirty bees forum

How to show tags on products page


zimmer-media

Recommended Posts

for example default theme add the code <section class="page-product-box"> <h3 class="page-product-heading">Tags</h3> <div> {if Tag::getProductTags(Tools::getValue('id_product'))!=""} <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> {else} {l s='No tags specified yet' mod='blocktags'} {/if} </div> </section>

after this code ```

  {if !empty($accessories)}
    <section id="product-accessories" class="page-product-box">
      <h3 class="page-product-heading">{l s='Accessories'}</h3>
      <div class="accessories-block">
        {include file="$tpl_dir./product-list.tpl" products=$accessories}
      </div>
    </section>
  {/if}

```

(custom)css code if necessary adjust the css code to the template (color, style, etc) ``` .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;} ``` 0_1514848848412_6cfffcea-2c93-4c02-b79a-5ac3577b0608-grafik.png and -

0_1514848874197_68e682e2-64b7-4a69-88af-a880a9a02701-grafik.png

and -

0_1514848935098_e55f8563-e184-46ef-b67d-0690144fa174-grafik.png

Link to comment
Share on other sites

  • 1 year later...
  • 2 weeks later...

@AndyC thats an interesting question. I am thinking of using tags extensively in future. The way it set up right now, cant help you in seo reason. My plan is to use tags similair as categories. Why not use categories instead? It would get messy if you have like 500 categories...

The customer does benefit with tags. We sell more than 1000 jigsaw puzzles. Imagine we tag all images where a wolve is on. If the customer wants to buy a wolve puzzle, he just clicks on the tag and sees every fitting puzzle. 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...