How can I get the order comments text box at checkout to have some text in it by default (but still be editable)?
How can I get the order comments text box at checkout to have some text in it by default (but still be editable)?
Mods: Admin Activity Report || PO Box Ban || Empty Cart Manager || Autoresponder+ || Zip Validator || Desktop Data || SRiC
Why? If your customer doesn't change the default text, that default text will show up on your orders ... the same for everyone ... is that what you want?
To set it ...
/includes/modules/pages/checkout_shipping/header_php.php
Find this:
add this on a new line below it:Code:if (isset($_SESSION['comments'])) { $comments = $_SESSION['comments']; }and then edit your checkout_shipping.php language file and add a new define for TEXT_DEFAULT_ORDER_COMMENTS, containing whatever default text you want to show.Code:if (!isset($comments) && defined('TEXT_DEFAULT_ORDER_COMMENTS')) $comments = TEXT_DEFAULT_ORDER_COMMENTS;
.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donations always welcome: www.zen-cart.com/donate
Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.
Thanks for your reply DrByte. The reason I want this is because I'm planning to offer an optional free product with every order. This product will be a PDF. I'm going to set this product up as document-general so it can't be added to cart and state on its product page that if you would like this, then to request it in the order comments field at checkout. So I thought I would put some default text in there and they can always remove it if they don't want the PDF. Then after their order is done, I'll email them the PDF if they requested it. Hope that makes sense.
Basically I just want to offer customers a free downloadable product with their orders but I want them to have to go through checkout in order to get it. I'm hoping it will prove to be an incentive to buy something. If you can think of a better method to do this, PLEASE let me know. Thanks.
Mods: Admin Activity Report || PO Box Ban || Empty Cart Manager || Autoresponder+ || Zip Validator || Desktop Data || SRiC
Go ahead and see how well it works.
.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donations always welcome: www.zen-cart.com/donate
Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.
Thanks doc, the code works great (providing a couple of braces are added):
Code:if (!isset($comments) && defined('TEXT_DEFAULT_ORDER_COMMENTS')) { $comments = TEXT_DEFAULT_ORDER_COMMENTS; }
Mods: Admin Activity Report || PO Box Ban || Empty Cart Manager || Autoresponder+ || Zip Validator || Desktop Data || SRiC
Ok, somehow I managed to break the checkout cart when I tried this. Now when I select "Go to Checkout" from the shopping cart I end up with a blank page.
Anyone got any ideas? www.lensrent.ca
login: test1@test.com
password:test1
I duplicated the files before I made the code changes -- tried the code and it didn't work so I deleted altered files and renamed the duplicates back to the originals.
Just to be clear, I made the following code changes:
includes/modules/pages/checkout_shipping/header_php.php
Removed (actually I commented it out with //):
Added:Code:if (isset($_SESSION['comments'])) { $comments = $_SESSION['comments']; }
andCode:if (!isset($comments) && defined('TEXT_DEFAULT_ORDER_COMMENTS')) { $comments = TEXT_DEFAULT_ORDER_COMMENTS; }
includes/languages/english/MY_TEMPLATE/checkout_shipping.php
Added:
Seemed simple enough.Code:define('TEXT_DEFAULT_ORDER_COMMENTS', 'Please enter your requested rental dates here');
Zen Cart v1.3.8a/v1.3.8 with pure_black template.
BTW - first post but I have been reading everyone's posts --- YOU GUYS/GALS ROCK!
Mods: Admin Activity Report || PO Box Ban || Empty Cart Manager || Autoresponder+ || Zip Validator || Desktop Data || SRiC
That was an ADD not replace -- DAMN. Thank you.
And I found the source of the error -- I checked the server logs (using CPanel) and for some reason I was saying the css file didn't exist -- I SWEAR I never touched it.
File does not exist: http://lensrent.ca/includes/template...stylesheet.css
Overwrote it with a backup copy and all is fine now, go figure.
Anyway just for others the Pinned tip at the top of the page is the key for these problems...
Getting a BLANK PAGE? Here's the answer ...
http://tutorials.zen-cart.com/index.php?article=82
FWIW - I have tried this every way I can figure. Adding the code to includes/modules/pages/checkout_shipping/header_php.php kills the page too.
OK - I did get it to work and it wasn't a "code" issue it was an operator issue. When I duplicated the files I used Cyberduck's duplicate function and simple accepted the appended file name. So something like header_php.php became header_php (18:05:09 6:43 PM).php
Apparently this didn't work out so well. After some testing I found that the appended file name was being pulled... my solution -- I did something like zzz_header_php.php -- worked like a charm.![]()
Bookmarks