Author Topic: Adding Javascript tags to Category and Product Descriptions  (Read 5493 times)

jsprague

  • Beginner
  • *
  • Posts: 5
Adding Javascript tags to Category and Product Descriptions
« on: February 06, 2009, 19:05:32 pm »
Hello fellow VM developers!
I was trying to add a JWFlash player video to my category description to play a little flash movie related to my category. The only thing was that VM kept removing my <script> tags from the category description. So I did some searches on this forum to see if other people had the same problem and found may posts where people had the same problem, but there was no solution given.

So I looked through the code and figured out how to allow <script> tags in your descriptions. All you have to do is replace:

Code: [Select]
vmGet( $d, 'category_description', '', VMREQUEST_ALLOWHTML )
With:

Code: [Select]
vmGet( $d, 'category_description', '', VMREQUEST_ALLOWRAW ),

Repeat the above replacement in all the places that you want to allow <script> tags.

After doing that I can use <script> tags and play my little flash video in my category description, yay!

Just thought I would post the tweak in case someone else might be wondering the same thing.

caplinq

  • Jr. Member
  • **
  • Posts: 60
Re: Adding Javascript tags to Category and Product Descriptions
« Reply #1 on: March 25, 2009, 19:28:04 pm »
Oh yay!  This is exactly what I was looking for.

I hope this helps others, the code jsprague refers to is in:
yoursite/administrator/com_virtuemart/classes/ps_product_category.php

and the line changes made are on Lines 247 and 309

beesbane

  • Beginner
  • *
  • Posts: 2
  • Skype Name: beesbane
Re: Adding Javascript tags to Category and Product Descriptions
« Reply #2 on: March 06, 2013, 02:53:53 am »
I've been searching for a while now, and this solution seems dated. Is there a current solution for this?

I say this because the folder structure no longer exists in that format.