Jump to content

How to add a html link in Product Features


Recommended Posts

In Prestashop 1.6, is it possible to add a html hyperlink within the product features? And if so, how would I do that?

 

My shop has services provided by different companies. What I would like to do is have a link to the service companies website. Are there any other ways I could have such a link?

 

Many thanks

Link to comment
Share on other sites

no, becouse each feature can have 1 link. Imagina that you add the link for feature A, but 2 products use feature A, so the link must be the same for both features. you can do, but manually. And i guess you need to add a lot of features. Maybe you can use a module for that like:

 

http://addons.prestashop.com/es/publicidad-marketing-newsletter-modulos/18802-product-labels-stickers.html

Link to comment
Share on other sites

Shacker, thanks for reply.

 

I'm sure if I explained my question and situation well enough - I will try to rephrase it.

 

So for example, if my product is an Apple iPhone, what I'd like to do is have an external link to the Apply website so that users can check that out, before buying on it on my PrestaShop site. The link doesn't necessarily have to be in the features section. Is there anyway I can do that? Or any add-ons to do that?

 

What I have done so far is have a "feature" called "website url" which has the website adress but users can't just click that - they would to cut and paste it into their browser.

 

Many thanks

Link to comment
Share on other sites

What I have done so far is have a "feature" called "website url" which has the website adress but users can't just click that - they would to cut and paste it into their browser.

 

Many thanks

Before the link you add the text:  "Select the link to the right, right click selection and chose to open in new tab or window".

I know it's not what U wanted but a little easier perhaps?  ;)

Link to comment
Share on other sites

ok, i found the best way. Just create a feature called URL , and in each product put the full url like http://www.destination.com

 

open the product.tpl of your temmplate and find:

 

{if isset($features) && $features}
<!-- Data sheet -->
<section class="page-product-box">
<h3 class="page-product-heading">{l s='Data sheet'}</h3>
<table class="table-data-sheet">
{foreach from=$features item=feature}
<tr class="{cycle values="odd,even"}">
{if isset($feature.value)}
<td>{$feature.name|escape:'html':'UTF-8'}</td>
<td>{$feature.value|escape:'html':'UTF-8'}</td>
{/if}
</tr>
{/foreach}
</table>
</section>
<!--end Data sheet -->
{/if}

to

 

{if isset($features) && $features}
<!-- Data sheet -->
<section class="page-product-box">
<h3 class="page-product-heading">{l s='Data sheet'}</h3>
<table class="table-data-sheet">
{foreach from=$features item=feature}
<tr class="{cycle values="odd,even"}">
{if isset($feature.value)}
{if $feature.name eq "URL"}
<td>{$feature.name|escape:'html':'UTF-8'}</td>
<td><a href="{$feature.value|escape:'html':'UTF-8'}" target="_blank">{$feature.value|escape:'html':'UTF-8'}</a></td>
{else}
<td>{$feature.name|escape:'html':'UTF-8'}</td>
<td>{$feature.value|escape:'html':'UTF-8'}</td>
{/if}
{/if}
</tr>
{/foreach}
</table>
</section>
<!--end Data sheet -->
{/if}
  • Like 1
Link to comment
Share on other sites

Hi shacker - unfortunately I have ran into an issue, but I found a fix and here it is for any other forum viewers.

When I you use the product CSV bulk upload, the Feature format is Feature(Name:Value:Position).

When you put a URL such as http://www.destination.com in the value, it interprests it as "Value = http" and "Position = //www.destination.com" - so it doesn't work.

 

 

Seems to work fine now :)

 

{if isset($features) && $features}

<!-- Data sheet -->
<section class="page-product-box">
<h3 class="page-product-heading">{l s='Data sheet'}</h3>
<table class="table-data-sheet">
{foreach from=$features item=feature}
<tr class="{cycle values="odd,even"}">
{if isset($feature.value)}
{if $feature.name eq "URL"}
<td>{$feature.name|escape:'html':'UTF-8'}</td>
<td><a href="{$feature.value|escape:'html':'UTF-8'}" target="_blank">{$feature.value|escape:'html':'UTF-8'}</a></td>
{else}
<td>{$feature.name|escape:'html':'UTF-8'}</td>
<td>{$feature.value|escape:'html':'UTF-8'}</td>
{/if}
{/if}
</tr>
{/foreach}
</table>
</section>
<!--end Data sheet -->
{/if}

Link to comment
Share on other sites

  • 4 years later...

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...