X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   code stripping out of product description in 4.7.5 (https://forum.x-cart.com/showthread.php?t=73792)

christindall 03-31-2016 01:48 AM

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

PhilJ 03-31-2016 02:14 AM

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',
);


christindall 03-31-2016 02:50 AM

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!


All times are GMT -8. The time now is 09:12 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.