sailfishweb.com

 

Allow Raw Output on K2 Extra Fields

E-mail Print PDF

Needed K2 items to have a form. Wanted the form to be in the extra fields.

First create the EXTRA FIELD

  • -click EXTRA FIELDS
  • -click NEW
  • -name the field NEWPRICE
  • -make "Type" be: TEXTAREA
  • -leave "Default Values" blank
  • -click SAVE

Next, edit the ./administrator/components/com_k2/models/item.php

  • -vi item.php
  • -:510
  • -change: $variables = JRequest::get('post', 4);
  • -to: $variables = JRequest::get('post',JREQUEST_ALLOWRAW);
  • -:wq

Finally, test it out.

  • -click ITEMS
  • -select item
  • -click EXTRA FIELDS tab
  • -type your HTML or FORM code
  • -mine was: <form action="https://domainname.foxycart.com/cart" method="post" accept-charset=utf-8>
  • -click APPLY

Your code should stick!