Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

Product Details

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 04-15-2003, 11:27 AM
 
jgkiefer jgkiefer is offline
 

Advanced Member
  
Join Date: Apr 2003
Posts: 85
 

Default Product Details

Can I use HTML in the detailed description? I would like to use a 2 column table to display lists however when I try to add the html in the detailed product field it dosen't display correctly. The table is to far down and has unknown spaces.
Reply With Quote
  #2  
Old 04-15-2003, 01:37 PM
 
funkydunk funkydunk is offline
 

X-Man
  
Join Date: Oct 2002
Location: Cambridge, UK
Posts: 2,210
 

Default

To do this, you would need to edit the php code that inserts the product description into the database. Probably product_modify.php is the file to change.
__________________
ex x-cart guru
Reply With Quote
  #3  
Old 04-16-2003, 05:37 AM
 
jgkiefer jgkiefer is offline
 

Advanced Member
  
Join Date: Apr 2003
Posts: 85
 

Default

In product_modify.tpl I forund the code snippet:
Code:
<td valign="top" class=ProductDetails> <textarea name="fulldescr" cols="45" rows="10"> { $product.fulldescr|replace:" ":"\n"|escape:"html"}</textarea> </td>

I want to use html in both the short and long description. Can I safely remove
Code:
|escape:"html"

So I am left with:
Code:
<td valign="top" class=ProductDetails> <textarea name="fulldescr" cols="45" rows="10"> { $product.fulldescr|replace:" ":"\n"}</textarea> </td>
This seems like the solution for allowing html and having the break tag replaced with a space. I just need some assurance that this is correct as I am not sure what all is dependent on this code.
Reply With Quote
  #4  
Old 04-16-2003, 06:03 AM
 
jgkiefer jgkiefer is offline
 

Advanced Member
  
Join Date: Apr 2003
Posts: 85
 

Default

Well it was a good try, but that dosen't seem to work. Any ideas?
Reply With Quote
  #5  
Old 04-16-2003, 07:46 AM
 
jgkiefer jgkiefer is offline
 

Advanced Member
  
Join Date: Apr 2003
Posts: 85
 

Default

I have isolated the problem to be the br tag. If I put the html all on one line all is well, but using standard html from my html editor xcart puts a br tag at the beginning of every line. I want to be able to copy and paste the html from my editor into the full description area. How do I set this up?
Reply With Quote
  #6  
Old 06-07-2003, 09:25 AM
 
Azkar Azkar is offline
 

Newbie
  
Join Date: May 2003
Posts: 7
 

Default

well ... I am having the same problem ...

say, I insert a table into the descriptions. The output has some funny white spaces as jgkiefer reported. If I had three cols in the table, only one col shows with original cols listed as in rows. Something is not right here .. please help....
Reply With Quote
  #7  
Old 06-07-2003, 09:32 PM
 
jgkiefer jgkiefer is offline
 

Advanced Member
  
Join Date: Apr 2003
Posts: 85
 

Default

I found the way around this problem. It is not the prettiest hack but it works. Just make sure your html is on one line and everything will be fine. This can be time consuming but you will get the hang of it.
I wish they would fix this but I am not expecting it anytime soon.
Reply With Quote
  #8  
Old 06-07-2003, 10:47 PM
 
Azkar Azkar is offline
 

Newbie
  
Join Date: May 2003
Posts: 7
 

Default

works for me .. thanks for your help .. ... but yeah .. they should fix it ....
Reply With Quote
  #9  
Old 11-21-2003, 06:43 AM
 
moshguy moshguy is offline
 

Advanced Member
  
Join Date: May 2003
Location: York, PA USA
Posts: 40
 

Default Same Problem

Yeah, I just wanted to say that I'm in the same boat. I'm not using tables but I'm trying to space things out using
in the detailed description. Xcart wants nothing to do with the
. It turns the
into a new line. So I can only edit the detailed description once and if I change anything, I have to add in all the
's again or it looks like crap. This needs to be fixed with the next version.
__________________
Looking for quality design at a more than fair price. Look no further for your next web design project.
Reply With Quote
  #10  
Old 11-21-2003, 07:19 AM
 
moshguy moshguy is offline
 

Advanced Member
  
Join Date: May 2003
Location: York, PA USA
Posts: 40
 

Default Might have an answer

I got mad and decided to get down and dirty with PHP. Here's the way to just insert HTML into the detailed description field.

Open include/product_modify.php

Look for some code that looks like this.

Code:
if ($fulldescr == strip_tags($fulldescr)) $fulldescr = str_replace("\n", " ", $fulldescr);

change it to this

Code:
$fulldescr = str_replace("\n", " ", $fulldescr);

Now it interprets your HTML code literally. With the exception of the \n character it turns it into a
. If you want it to leave \n alone. Erase the code completely instead of changing it.

-Jeremy
__________________
Looking for quality design at a more than fair price. Look no further for your next web design project.
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 02:29 AM.

   

 
X-Cart forums © 2001-2020