Thu 09 Apr |
|
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. 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' ) {
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.$config_val = str_replace("'","\'",vmGet( $d, $value,'',VMREQUEST_ALLOWRAW) ); $config .= "define('".$key."', '".$config_val."');\n"; }; 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).
The result is a much more attractive and professional looking "Terms & Conditions" box. |
Last Updated on Thursday, 09 April 2009 10:56 |