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

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

GJC Web Design UK Joomla & VirtueMart how to, tips, tricks, coding examples, html, php, tutorial, 101, useful hints, help

A collection of help articles and coding examples for Joomla & Virtuemart

Belgium, VirtueMart & Joomla Web Design England UK Britain & Germany

Joomla, VirtueMart, how to, tips, tricks, coding examples, html, php, tutorial, 101, useful hints, help 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 Joomla - VirtueMart Joomla & VM How To's 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


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!
Last Updated on Thursday, 09 April 2009 10:56
 

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:

Subject:
Comment:
Comments (3)
Awesome, thank you!!
3 Monday, 26 October 2009 04:00
Mike
Worked perfectly, and was exactly what I was looking for! Thank you for posting this handy tip!
@Shane
2 Thursday, 15 October 2009 12:54
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 Thursday, 15 October 2009 09:52
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

Our Recommended Reading

For those interested in extending their knowledge of Joomla! & VirtueMart, Packt Publishing has an excellent range of help & how to books.
Listed below are some I can recommend.
Simply click on the images to be taken directly to their web shop.


Joomla! Social Networking with JomSocial
Joomla! Social Networking
with JomSocial

by Kwasi Boateng & Beatrice A. Boateng.
Joomla! 1.5 Multimedia
Joomla! 1.5 Multimedia
by Allan Walker.


Building job sites with Joomla!
Building job sites with Joomla!
by Santonu Kumar Dhar.

Joomla! Template Design: Create your own professional-quality templates with this fast, friendly guide
Joomla! Template Design: 2nd Edition
Create your own professional-quality
templates with this fast, friendly guide
by Tessa Blakeley Silver.
Magento: Beginner's Guide
Magento: Beginner's Guide by William Rice
is a must for anyone trying the
open-source e-Commerce solution.

Read the review

object-oriented-javascript-applications-libraries
Object-Oriented JavaScript by
Stoyan Stefanov gives you a very
comprehensive grounding in
the latest Javascript techniques.

Read the review
Joomla! Web Security
Joomla! Web Security
by Tom Canavan.

Joomla 1.5 Top Extensions Cookbook
Joomla 1.5 Top Extensions Cookbook by
Suhreed Sarkar is an ideal and concise round up of the extensions available for the Joomla! system.

Read the review

Latest Articles

Paypal Donation

If you use this module on your site please donate a small amount.
Any donation amount appreciated.

VM Live Product Search

Recommended Reading

For those interested in extending there knowledge of Joomla! & VirtueMart Packt Publishing has an excellent range of help & how to books.
Listed below are some I can recommend.
Simply click on the images to be taken directly to their web shop.

Mastering Joomla! 1.5 Extension and Framework Development
Mastering Joomla! 1.5 Extension and
Framework Development : 2nd Edition

by James Kennard.
Read the review

Building job sites with Joomla!
Building job sites with Joomla!
by Santonu Kumar Dhar.
Learning Joomla! 1.5 Extension Development Learning Joomla! 1.5 Extension Development
by Joseph L. LeBlanc.
Read the review
Joomla! E-Commerce with VirtueMart
Joomla! E-Commerce with VirtueMart
by Suhreed Sarkar.

Read the review
Joomla! 1.5 Site Blueprints Joomla! 1.5 Site Blueprints
by Timi Ogunjobi.

Joomla! 1.5 JavaScript jQuery Joomla! 1.5 JavaScript jQuery
by Jose Argudo Blanco.
Read the review
Joomla! Social Networking with JomSocial Joomla! Social Networking with JomSocial
by Kwasi Boateng & Beatrice A. Boateng.

Joomla! 1.5 Multimedia Joomla! 1.5 Multimedia
by Allan Walker.

Joomla! Web Security Joomla! Web Security
by Tom Canavan.

Mastering Joomla! 1.5 Extension and Framework Development Mastering Joomla! 1.5 Extension and Framework Development : 2nd Edition
by James Kennard.

Joomla! Template Design: Create your own professional-quality templates with this fast, friendly guide Joomla! Template Design: Edition 2 - Create your own professional-quality templates with this fast, friendly guide
by Tessa Blakeley Silver.

Magento: Beginner's Guide
Magento: Beginner's Guide by William Rice
is a must for anyone trying the
open-source e-Commerce solution.

Read the review

GJC Web Design UK Joomla & VirtueMart how to, tips, tricks, coding examples, html, php, tutorial, 101, useful hints, help

A collection of help articles and coding examples for Joomla & Virtuemart

Belgium, VirtueMart & Joomla Web Design England UK Britain & Germany

Joomla, VirtueMart, how to, tips, tricks, coding examples, html, php, tutorial, 101, useful hints, help



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