| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | Mark Forums Read | User manuals | Login |
JavaScript in Category/Product Description? | |||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
JavaScript in Category/Product Description?
The Category Description and Product Descriptions are not allowing me to add JavaScript. Everytime I add JS and save it, the screen refreshes with an empty description box. I've tried it with and without literal tags.
Anyone got any ideas what I'm doing wrong? Version 4.0.8
__________________
Version 4.0.8 Live |
|||||||
#2
|
|||||||
|
|||||||
Ah hah, might be able to help. Spent a long time on an identical problem, and, if this is documented then it's very, very well hidden.
Sure, the Trusted variables fix ( http://forum.x-cart.com/viewtopic.php?t=13682&sid=773e50d2983433efb0fd8d0c 38af9ea3 ) works for html code, but X-Cart is still ripping out other stuff, <Script> included. Adding this: define('USE_TRUSTED_SCRIPT_VARS',1); to the two files mentioned in the above post will have you smiling. Sure, there are security issues if you don't entirely trust any providers who might have access, but, as far as I can see, there are no issues otherwise. Hope this helps |
|||||||
#3
|
|||||||
|
|||||||
Thanks for the response.
This is what I have right now: Code:
Should I change it to this?: Code:
I'm new to x-cart so I just want to make sure I'm inputting the code correctly.
__________________
Version 4.0.8 Live |
|||||||
#4
|
|||||||
|
|||||||
No, you don't need that second line, just:
define('USE_TRUSTED_SCRIPT_VARS',1); So, you'll end up with: define('USE_TRUSTED_POST_VARIABLES',1); $trusted_post_variables = array("product_lng_descr","product_lng_full_descr" ,"product_new_descr","product_new_full_descr","des cr","fulldescr","posted_data","js_code","javascrip t_code"); define('USE_TRUSTED_SCRIPT_VARS',1); X-Cart is just looking for the variable to be defined, so it would seem, you don't have to then specify the string. |
|||||||
#5
|
|||||||
|
|||||||
I just applied the changes...it's working perfect!
Thanks for your help.
__________________
Version 4.0.8 Live |
|||||||
#6
|
|||||||
|
|||||||
Glad to be able to help for once. This really should be documented, IMO. Cheers.
|
|||||||
#7
|
|||||||||
|
|||||||||
I know this is an old post, so I hope that someone will reply! I want to be able to put this in the product description:
Code:
provider/product_modify.php Code:
admin/product_modify.php Code:
So basically all I added was param00 and define('USE_TRUSTED_SCRIPT_VARS',1);. Is there something I am missing?
__________________
X-Cart version 4.0.14 |
|||||||||
#8
|
|||||||
|
|||||||
Javascript in Category Description
Hi,
I tried to modify the two files: admin/product_modify.php and provider/product_modify.php with the following code: Code:
Am I doing something wrong here? Thanks in advance for the help. Xcart 4.0.18 |
|||||||
#9
|
|||||||
|
|||||||
Ok, I think I found it.
I changed the admin/category_modify.php by adding the following: Code:
Quote:
This definately allowed me to insert javascript in the category description. Any input is still very welcome because I'm not a programmer. Thanks. |
|||||||
#10
|
|||||||
|
|||||||
Re: JavaScript in Category/Product Description?
Hi,
I'm also upping this old thread as i could not find a newer version. I have the same issue, i wish to embed audio previews in the detailer description field. I've modified admin and provider/product_modify.php with the code so i have: PROVIDER define("NUMBER_VARS", "shipping_freight,price,list_price,weight"); define('USE_TRUSTED_POST_VARIABLES',1); $trusted_post_variables = array("product_lng","product_new_descr","product_n ew_full_descr","descr","fulldescr","posted_data"," js_code","efields","javascript_code","param00"); define('USE_TRUSTED_SCRIPT_VARS',1); & ADMIN define("NUMBER_VARS", "shipping_freight,price,list_price,weight"); define('USE_TRUSTED_POST_VARIABLES',1); $trusted_post_variables = array("product_lng","product_new_descr","product_n ew_full_descr","descr","fulldescr","posted_data"," js_code","efields","javascript_code","param00"); define('USE_TRUSTED_SCRIPT_VARS',1); But after saving it still ends up blank.. ideas? |
|||||||
|
Thread Tools | Search this Thread |
|
|
|
|||
X-Cart forums © 2001-2020
|