Jump to content

Links not working in product description


Guest grafixster

Recommended Posts

Guest grafixster

I'm still not able to get the links to work in product description. Here is the lates thing I've tried.

<td>	

{TXT_DESC}

<div class="txtOutOfStock">{TXT_OUTOFSTOCK}</div>

</td>




I've modified it to be;




<td>	

<a href="{TXT_DESC}">Play</a>

<div class="txtOutOfStock">{TXT_OUTOFSTOCK}</div>

</td>




When I add a product, I put the path to the "public" folder like /demos/genre/sound.mp3 in the description field.  This works fine and the link becomes availaible in the product listings as well as the product detailed info (if you click on more).



If I view HTML source of the shopping cart I see this




<td>	

<a href="/demos/beats/rap/1.mp3&hellip;">Play</a>

<div class="txtOutOfStock"></div>

</td>




The &hellip; makes the link come;




/demos/beats/rap/1.mp3%E2%80%A6

I hope that sheds some light on the prob.

Thanks!

Link to comment
Share on other sites

Guest estelle

Hi there,

So you want to modify the category view to have the product descriptions as a link?

Firstly, the reason why it is displayed as a link when you view the full product info, but not in the category view, is because in the category view all the HTML tags such as <a href...> are being stripped. Also, as you noticed, &hellip; is being added to the end.

Here is the code that does this. Its in includes/content/viewCat.inc.php

$view_cat->assign("TXT_DESC",substr(strip_tags($productResults[$i]['description']),0,$config['productPrecis'])."&hellip;");

So you could either keep the current solution that you are working on, and just get rid of the &hellip; that is getting added to the end (and also the possible chopping of the end of the text):

$view_cat->assign("TXT_DESC",strip_tags($productResults[$i]['description']));




Or you could also get rid of the strip_tags(), so that any HTML tags will also used to markup the text in the category listing, and then you could undo your other change in viewCat.tpl.


$view_cat->assign("TXT_DESC",$productResults[$i]['description']);

Hope this helps! :w00t:

Estelle.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...