web design, England, Britain, UK, belgium
 
Ulti Clocks content

Allow html formatting in VirtueMart's "Terms of Service"

sand 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

Home

Don

09.

Apr


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


Add this page to your favorite Social Bookmarking websites
Digg! Reddit! Del.icio.us! Mixx! Free and Open Source Software News Google! Live! Facebook! Slashdot! Technorati! StumbleUpon! Spurl! Newsvine! Furl! Yahoo! Netvouz! Mister-Wong! RawSugar! Ma.gnolia! Squidoo! DZone! Swik!
Zuletzt aktualisiert am Donnerstag, 09. April 2009 um 10:56 Uhr
 

Add your comment

BoldItalicUnderlineStrikethroughSubscriptSuperscriptEmailImageHyperlinkOrdered listUnordered listQuoteCodeHyperlink to the Article by its id
Very HappySmileWinkSadSurprisedShockedConfusedCoolLaughingMadRazzEmbarrassedCrying or Very SadEvil or Very MadTwisted EvilRolling EyesExclamationQuestionIdeaArrowNeutralMr. GreenGeekUber Geek
Your name:
  The word for verification.
Lowercase letters only with no spaces.

The word for verification.<br/>Lowercase letters only with no spaces.
Word verification:

Titel:
Comment:
Comments (3)
Awesome, thank you!!
3 Montag, 26. Oktober 2009 um 04:00 Uhr
Mike
Worked perfectly, and was exactly what I was looking for! Thank you for posting this handy tip!
@Shane
2 Donnerstag, 15. Oktober 2009 um 12:54 Uhr
GJC (admin)
If you do it exactly as above it works.....

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";

}

else {
That is exactly what I am looking for
1 Donnerstag, 15. Oktober 2009 um 09:52 Uhr
Shane
The problem is when I put in the value in ps_config.php and save It returns with a internal server error. Any suggestions



Allow html formatting in VirtueMart's "Terms of Service"



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