web design, England, Britain, UK, belgium
 

Allow html formatting in VirtueMart's "Terms of Service" - Joomla & VirtueMart Tips & How To's

Hack to allow html formatting in VirtueMart's Terms of Service text box at the final checkout stage.

Home Joomla VirtueMart Tips Allow html formatting in VirtueMart's "Terms of Service"

Thu

09

Apr

Allow html formatting in VirtueMart's "Terms of Service"
  • Joomla 1.5 + 1.0
  • VirtueMart 1.1

If your "Terms of Service" that shows on the last stage of VirtueMarts checkout is more than a couple of lines long then it can be quite unreadable.

With this hack we can enable the text area (the "Legal information text (short version)." as VirtueMart calls it) of the VirtueMart configuration page (first tab) to accept html formatting.

VirtueMart 1.1 html in Terms of Service checkout
Open the file joomla_root/administrator/components/com_virtuemart/classes/ps_config.php in any text editor and go to line 306 and add the red highlighted code snippet.
elseif( $key == 'PSHOP_OFFLINE_MESSAGE' || $key == 'VM_ONCHECKOUT_LEGALINFO_SHORTTEXT' ) {
$config_val = str_replace("'","\'",vmGet( $d, $value,'',VMREQUEST_ALLOWRAW) );
$config .= "define('".$key."', '".$config_val."');\n";
};
This adds a parameter ,'',VMREQUEST_ALLOWRAW to the the VirtueMart function ,'',vmGet() which default action is to strip any html out of the returned string.
Now you can happily format the text in the text area and even includes links etc.

You can also change the size of the administration text area ("Legal information text (short version).) to give yourself a bit more room to work with.
Open the file joomla_root/administrator/components/com_virtuemart/html/admin.show_cfg.php and go to line 372 and adjust the size to your liking.
<textarea rows="10" cols="70" id="conf_VM_ONCHECKOUT_LEGALINFO_SHORTTEXT" name="conf_VM_ONCHECKOUT_LEGALINFO_SHORTTEXT" class="inputbox">
};
Legal information text (short version). VirtueMart 1.1 html Legal information text

The result is a much more attractive and professional looking "Terms & Conditions" box.

VirtueMart 1.1 html in returns policy checkout with html formatting
Last Updated on Thursday, 09 April 2009 10:56
 
VirtueMart
Your Cart is currently empty.

Latest Joomla & VirtueMart Tips

See all tips & examples



Allow html formatting in VirtueMart's "Terms of Service"|Joomla & VirtueMart Tips & How To's



Hack to allow html formatting in VirtueMart's Terms of Service text box at the final checkout stage.


virtuemart, html, text, style, div, span, joomla, legal, information, policy, width, red, com, returns, checkout, terms, class, color, config, gjcwebdesign, www, right, service, src, http, alt, height, title, float, png, images, margin, shorttext, legalinfo, version, short, area, oncheckout, code, img

|

We use cookies to improve our website and your experience when using it. Cookies used for the essential operation of the site have already been set.
To find out more about the cookies we use and how to delete them, see our privacy policy.

I accept cookies from this site.