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

code stripping out of product description in 4.7.5
 
Reply
   X-Cart forums > X-Cart 4 > Changing and adding new features
 
Thread Tools Search this Thread
  #1  
Old 03-31-2016, 01:48 AM
  christindall's Avatar 
christindall christindall is offline
 

eXpert
  
Join Date: Dec 2007
Location: Everett, WA
Posts: 262
 

Question code stripping out of product description in 4.7.5

Ok, I'm creating a new "mod" because we have tons of special order items in our store.

I'm adding, to the product details admin page, a couple of text boxes - just like the "description" and "full description" boxes.

I have the updating into the correct (new) fields in the database (in products_lng_en table) - but when I post html tags in, they're getting stripped out.

I've essentially copied the exact code for the description fields, simply changing out the DB field names appropriately.

If I include code in the description fields, those do NOT get stripped out (the same exact code).

So, how the heck do I get it to not strip the code out of the new fields?!??!

Code:
<tr> {if $geid ne ''}<td width="15" class="TableSubHead"><input type="checkbox" value="Y" name="fields[spcnote]" /></td>{/if} <td colspan="2" class="FormButton"><div{if $active_modules.HTML_Editor and not $html_editor_disabled} class="description"{/if}>{$lng.lbl_special_order_product_note}:</div> <div class="description-data">{include file="main/textarea.tpl" name="spcnote" cols=45 rows=12 class="InputWidth" data=$product.spcnote width="100%" btn_rows=4} {if $product.xss_spcnote eq "Y"}<font class="Star">&lt;&lt;</font>{/if}</div></td> </tr>

my DB field here is "spcnote" (special order note)

This code is EXACTLY the same as the desc code, other than the field name. And the fields are set up the exact same as the built in x-cart fields....

help?

Developing for 4.7.5 Gold Plus
__________________
Chris Tindall
x-cart 4.7.5 Gold Plus
www.theweedpatchstore.com
AlteredCart: On-Sale, One Page Checkout, Checkout One Payments (although that's not working yet)
BCSE: Back in stock Notify, Checkbox Radio Mod, Upselling Links
SMACK: CDSEO Pro, Product Map
X-Cart: Gold+, Mobile
(still trying to get working: Gahela Support Suite)
Reply With Quote
  #2  
Old 03-31-2016, 02:14 AM
  PhilJ's Avatar 
PhilJ PhilJ is offline
 

X-Guru
  
Join Date: Nov 2002
Location: UK
Posts: 3,629
 

Default Re: code stripping out of product description in 4.7.5

You have to make the field 'trusted', so add it to the array in admin/product_modify.php
Code:
$trusted_post_variables = array( 'product_lng', 'descr', 'fulldescr', 'posted_data', 'js_code', 'efields', );
Reply With Quote

The following 2 users thank PhilJ for this useful post:
christindall (03-31-2016), qualiteam (03-31-2016)
  #3  
Old 03-31-2016, 02:50 AM
  christindall's Avatar 
christindall christindall is offline
 

eXpert
  
Join Date: Dec 2007
Location: Everett, WA
Posts: 262
 

Default Re: code stripping out of product description in 4.7.5

oh my gosh, Phil - I NEVER would have figured that out... lol - thank you so much! Now I can finally go to bed! WOOHOO!
__________________
Chris Tindall
x-cart 4.7.5 Gold Plus
www.theweedpatchstore.com
AlteredCart: On-Sale, One Page Checkout, Checkout One Payments (although that's not working yet)
BCSE: Back in stock Notify, Checkbox Radio Mod, Upselling Links
SMACK: CDSEO Pro, Product Map
X-Cart: Gold+, Mobile
(still trying to get working: Gahela Support Suite)
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Changing and adding new features


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 01:10 PM.

   

 
X-Cart forums © 2001-2020