mcbsolutions Posted June 11, 2003 Share Posted June 11, 2003 Hi, Could someone please advise how to modify the order form to display the order contents on the ccbyfax form instead of "Purchase From Store Name" I'm not sure if this is possible. Also, I am wondering if its possible to display the comments field from checkout_confirmation.php? Thanks for any help! :) Steve Quote Link to comment Share on other sites More sharing options...
64sp Posted June 11, 2003 Author Share Posted June 11, 2003 Hi Steve The full product list can definately be bought through to the form easily and I am fairly sure the order comments can too. I will write the amended code today and post it to the forum. 64SP Quote *************************************** I've been contemplating thinking about thinking *************************************** Link to comment Share on other sites More sharing options...
64sp Posted June 11, 2003 Author Share Posted June 11, 2003 To replace the "Purchase from STORE_NAME" and replace it with the product details: In catalog/includes/modules/payment/ccbyfax.php insert the following code: for ($i=0, $n=sizeof($order->products); $i<$n; $i++) { $printfaxform_button_string .= tep_draw_hidden_field('productqty' . $i, $order->products[$i]['qty']) . tep_draw_hidden_field('productname' . $i, $order->products[$i]['name']); } $printfaxform_button_string .= tep_draw_hidden_field('numprods', $n) . tep_draw_hidden_field('comments', $order->info['comments']); at approximately line 131 between: tep_draw_hidden_field('email', $order->customer['email_address']); and: return $printfaxform_button_string; Then in /catalog/ccbyfax_form.php replace at approximately line 81: echo $HTTP_POST_VARS['desc']; with: for ($i=0, $n=$HTTP_POST_VARS['numprods']; $i<$n; $i++) { echo $HTTP_POST_VARS['productqty' . $i] . ' x ' . $HTTP_POST_VARS['productname' . $i] . '<br>'; } If you also want to add the order comments somewhere, I have already sent the POST_VAR in the code at the top so just add: echo $HTTP_POST_VARS['comments']; In an appropriate place on the form. I have only taken across the product qty and product name in the code at the top but it should be easy for you to add other product fields such as 'model' or 'price' if you follow the same logic. I dont intend to add this to the next version release (unless everyone thinks I should !) because the form is not intended as a full faxable order form (obviously you get that electronically in admin) but only as a credit card submission form and hencesummary details only are needed. Hope this helps. simon (64sp) Quote *************************************** I've been contemplating thinking about thinking *************************************** Link to comment Share on other sites More sharing options...
mcbsolutions Posted June 11, 2003 Share Posted June 11, 2003 Thanks much Simon! Works great! :D I wish I knew how to code PHP better, but this is how I learn. I somehow forgot that I get all the order info in admin as well. Doh! Anyway, it is nice that i got the order comments to appear in my form. This may be asking for too much but is it possible to get line breaks to appear in the comments field? Example: The customer enters comments like this: Comment line 1Comment Line 2 Comment Line 3 I would like it to appear as such in my form, yet it appears like: Comment line 1 Comment Line 2 Comment Line 3 Thanks again Simon! Steve Quote Link to comment Share on other sites More sharing options...
64sp Posted June 12, 2003 Author Share Posted June 12, 2003 Hi Steve Just change: echo $HTTP_POST_VARS['comments']; to: echo nl2br($HTTP_POST_VARS['comments']); and heh presto ! Glad I could help, I have absolutely no formal training in PHP either and have learnt (what little I know) from others in the osc forums and from just experimenting !! Quote *************************************** I've been contemplating thinking about thinking *************************************** Link to comment Share on other sites More sharing options...
Guest Posted June 12, 2003 Share Posted June 12, 2003 Thanxs works fine in 2.2ms. Quote Link to comment Share on other sites More sharing options...
mcbsolutions Posted June 12, 2003 Share Posted June 12, 2003 Thank you sir! :D What PHP I know is self taught as well, mainly from learning from those on this board like yourself. Someday I'll have to look up what n12br really means so I have a better understanding. :roll: But thanks again, Steve Quote Link to comment Share on other sites More sharing options...
Guest Posted June 13, 2003 Share Posted June 13, 2003 i tried to install this contribution on 2.2 and i get the following eror Fatal error: Cannot redeclare _sess_open() (previously declared in C:wwwmajesticsoundsstorecatalogincludesfunctionssessions.php:18) in C:wwwmajesticsoundsstorecatalogincludesfunctionssessions.php on line 18 when i go to print the order form ?any one else having this problem Quote Link to comment Share on other sites More sharing options...
Guest Posted June 13, 2003 Share Posted June 13, 2003 I am thinking of adding this module on my site. I have a question: Does the ENTIRE Credit Card number and other details appear on the fax form? If so, isn't it dangerous since it would be faxed openly? Any help on this is GREATLY appreciated! Thanks for the module! Quote Link to comment Share on other sites More sharing options...
mcbsolutions Posted June 13, 2003 Share Posted June 13, 2003 Does the ENTIRE Credit Card number and other details appear on the fax form? Hi, I currently take credit card payments only through Paypal. I do not have SSL installed on my site yet, but will soon. However, I do have a merchant account so I can process cards taken by phone or fax offline. I use this mod and with only these payment options, the credit card number is left blank, which allows the customer to print it out, fill it in, sign, and fax to me. My guess is you need the credit card payment module activated for it to complete it. Even then, if you don't want it completed, it's very easy just to comment out the lines that make that happen. If so, isn't it dangerous since it would be faxed openly? Ahh credit cards and security. I guess you could say it's dangerous to fax a credit card number to any business, if you don't really know who is on the receiving end. Most cards offer some type of buyer protection these days. And on second thought, is this any more dangerous than handing your credit card to a waiter who disappears with it for 15 minutes? :shock: Most merchant account providers charge lower rates for those companies who only take payments by phone or fax. Online transactions cost more - the reason - higher risk of fraud. In addition, all an SSL connection does is secure the transmission of data from the customer's browser to your server. Once it is stored on your server, the data is at risk of being viewed. This is why when I get SSL, I won't store the credit card data on my server for long. Even if you have taken steps to secure your server as tight as a drum, there's no such thing as 100% security on the internet IMO - your web host provider could access it if they really wanted to. Granted he/she probably won't, but you get my point. I hope that helps. Steve Quote Link to comment Share on other sites More sharing options...
Guest Posted June 13, 2003 Share Posted June 13, 2003 Thanks Steve for your reply :) I aske dif it was "dangerous" to fax the credit card info through a fax because of fear of third parties being able to view it or intercept the information. I own a hosting company, so I have SSL on my server and use 2Checkout.com for my credit card transactions (will be moving to merchant account in near future). I have not used the phone/fax option yet, so I was not sure how the security worked in this case. Is there a way to SSL secure the fax machine? lol. Thanks again for your thorough response! Quote Link to comment Share on other sites More sharing options...
mcbsolutions Posted June 13, 2003 Share Posted June 13, 2003 Your welcome Dee. I don't want to get too off topic here, but I did find an interesting read on this here: http://www.connotech.com/FAXBIBL.HTM#Toc!1 Yes fax transmissions can be intercepted, but one needs special equipment to do so. I've been receiving credit card info by fax for years and millions of other businesses do so every day. I have not had a problem to my knowledge. The point is I think many people are still afraid to punch in their credit card while online, and believe that faxing is a safer route. My goal is not to lose those customers, thus I implemented this great mod. :) Is there a way to SSL the fax machine? Yes there are secure faxing solutions out there, encryptors you can buy. But I think the sender needs to have the equipment, not just the receiver. I may be wrong, because I am no means an expert in this area. I personally don't lose sleep over someone intercepting a fax sent by a customer. What would keep me up at night however, is knowing that credit card data is stored on my server. This can open one up for liability. I would much rather have it stored here in my file cabinet. :wink: Steve Quote Link to comment Share on other sites More sharing options...
Guest Posted June 13, 2003 Share Posted June 13, 2003 is there any one who would be able to help me with my problem on this contribution Fatal error: Cannot redeclare _sess_open() (previously declared in C:wwwmajesticsoundsstorecatalogincludesfunctionssessions.php:1 in C:wwwmajesticsoundsstorecatalogincludesfunctionssessions.php on line 18 Quote Link to comment Share on other sites More sharing options...
Guest Posted June 14, 2003 Share Posted June 14, 2003 Your welcome Dee. I don't want to get too off topic here, but I did find an interesting read on this here: http://www.connotech.com/FAXBIBL.HTM#Toc!1 Yes fax transmissions can be intercepted, but one needs special equipment to do so. I've been receiving credit card info by fax for years and millions of other businesses do so every day. I have not had a problem to my knowledge. The point is I think many people are still afraid to punch in their credit card while online, and believe that faxing is a safer route. My goal is not to lose those customers, thus I implemented this great mod. :) Is there a way to SSL the fax machine? Yes there are secure faxing solutions out there, encryptors you can buy. But I think the sender needs to have the equipment, not just the receiver. I may be wrong, because I am no means an expert in this area. I personally don't lose sleep over someone intercepting a fax sent by a customer. What would keep me up at night however, is knowing that credit card data is stored on my server. This can open one up for liability. I would much rather have it stored here in my file cabinet. :wink: Steve Thanks so much Steve for your wonderful posts! I've learned so much from you already :) Thank you! :D Quote Link to comment Share on other sites More sharing options...
64sp Posted June 16, 2003 Author Share Posted June 16, 2003 Hi Adrian, Sorry wasn't ignoring your post...just been away a few days. Could I just confirm are you using 2.2ms1 or a later snapshot of 2.2 ? This contribution was only really written and tested on ms1 although I believe via this forum that others have it working on snapshots ? I think the problem is caused by the fact that in the ccbyfax_form.php I have included application_top.php so that I had access to all of the file names, table names, languages etc that are defined in it. application_top.php itself includes the sessions.php file which starts the session. So it would appear that when you got to open the fax form page to print, the session tries to re-open (via application_top.php) and causes an error. I dont understand though why it works on some installs and not on others...maybe later snapshots have changed the session logic ?? Any comments anyone ?...or maybe different versions of PHP handle things differently ? Can someone with better session knowledge than me help ? I suppose a work around would be to not include application_top.php in ccbyfax_form.php but to manually "include" the relevant code from it yourself.....but ommit the session bits and any other irrelevant bits, because actually the ccbyfax_form.php page gets most of its information through the POST_VARS and needs little information (mainly just the language files) via application_top.php from the rest of osc. Unless anyone has any better ideas or suggestions or solutions maybe I should look at doing that in the next version. Quote *************************************** I've been contemplating thinking about thinking *************************************** Link to comment Share on other sites More sharing options...
mcbsolutions Posted June 16, 2003 Share Posted June 16, 2003 I'm not sure if this will solve your problem or has anything to do with it, but one thing I've noticed in newer snapshots is that filenames are no longer defined in application_top.php. There is a separate file now called filenames.php. Steve Quote Link to comment Share on other sites More sharing options...
64sp Posted June 17, 2003 Author Share Posted June 17, 2003 I have just uploaded a new version. v1.2 adds the ability to produce a printable fax form from the account_history_info page for orders where ccbyfax was the chosen payment method. Note: My claim "where ccbyfax was the chosen payment method" is not bomb proof - When an order has been completed, OSC only records the text title of the payment method in the orders table as previously defined in the constant MODULE_PAYMENT_CCBYFAX_TEXT_TITLE in /catalog/includes/languages/english/modules/payment/ccbyfax.php. Therefore when deciding for each order in account_history_info.php whether to create a "produce fax form" button I could not use "if ($order->info['payment_method'] == MODULE_PAYMENT_CCBYFAX_TEXT_TITLE)" because if you were to change the definition of that constant at a later date the buttons would no longer get produced for previous orders (because they would no longer be equal). I have therefore defined a search substring of "Fax" (or language equivalent) and used that to test if the payment_method contains the search substring before outputting a button. This assumes that even if you change the title constant you would always keep the word fax in it, seeing as faxing is the whole point of the module ! - Please advise if my solution doesn't work for you or if you have any better ideas ! I have also made some minor changes to the other files: - Some minor cosmetics on the fax form. - Changed the titles of the module to fit inside the 32 character max of the payment_type field of the order table - Added to the email footer to let them know they can print a form from account history. This module is still only written for and tested on ms1. Quote *************************************** I've been contemplating thinking about thinking *************************************** Link to comment Share on other sites More sharing options...
64sp Posted June 17, 2003 Author Share Posted June 17, 2003 Sorry...very rude of me :oops: not to say..... Thanks to all in this forum for comments and suggestions that have led to this latest (improved :?: ) version. Keep them coming and it'll keep improving ! :D :D Quote *************************************** I've been contemplating thinking about thinking *************************************** Link to comment Share on other sites More sharing options...
kooyan Posted June 21, 2003 Share Posted June 21, 2003 I use your fax contribution the first time, I downloaded it (MS 1). Everything seems to work only if I press the button Generate form I get this failure Fatal error: Call to undefined function: tep_href_link() in /homepages/23/d22152063/htdocs/webshop/catalog/ccbyfax_form.php on line 34 Can you please help me??? Stefan Fritsche Quote Link to comment Share on other sites More sharing options...
kooyan Posted June 21, 2003 Share Posted June 21, 2003 I deleted in http://www.klosterbrauerei.net/webshop/cat...cbyfax_form.php </style> <script language="javascript" type="text/javascript"> window.resizeTo(600, 550); </script> and it worked, one more thing it shows now in the formular for the fax Number: Fax Nummer: MODULE_PAYMENT_CCBYFAX_FAXTO instead of the number which I used??? HTH Stefan Fritsche Quote Link to comment Share on other sites More sharing options...
kooyan Posted June 21, 2003 Share Posted June 21, 2003 OK, this one works now: Fax Nummer: MODULE_PAYMENT_CCBYFAX_FAXTO this was my mistake, but I still had to delete this http://www.klosterbrauerei.net/webshop/cat...cbyfax_form.php </style> <script language="javascript" type="text/javascript"> window.resizeTo(600, 550); </script> or I get the failure :?: Fatal error: Call to undefined function: tep_href_link() in /homepages/23/d22152063/htdocs/webshop/catalog/ccbyfax_form.php on line 34 Quote Link to comment Share on other sites More sharing options...
64sp Posted June 23, 2003 Author Share Posted June 23, 2003 </style> <script language="javascript" type="text/javascript"> window.resizeTo(600, 550); </script> This block of code (as you probably know) just resizes the new browser window to fit the size of the cc form (and so that the new window does not overlay completely the window the shop is in, so that it is obvious to the customer that a new window has been opened for the form). I dont know enough about javascript to know why this code should cause a problem with the tep_href_link() function which is used to produce the link to the privacy page. For this function to be undefined would indicate that application_top.php is not being included, but why would a self contained javascript effect the php code that has already been executed above it ? Is my javascript wrong does anyone know ? Maybe the problem is browser specific or effected by browser security settings ? Any suggestions anyone ? In the meantime kooyan, you will have to leave this code out or find an alternative way to resize the window. Sorry I cant be of more help just now :( Quote *************************************** I've been contemplating thinking about thinking *************************************** Link to comment Share on other sites More sharing options...
kooyan Posted July 8, 2003 Share Posted July 8, 2003 It is not a big problem, I can live with that :) . Thanks for your work. Stefan Fritsche klosterbrauerei.com Quote Link to comment Share on other sites More sharing options...
Guest Posted July 8, 2003 Share Posted July 8, 2003 is it poss to have the customer invoice # also show up on the fax form and maybe there merchandise or am i reaching now Quote Link to comment Share on other sites More sharing options...
64sp Posted July 8, 2003 Author Share Posted July 8, 2003 Adrian If you look a few pages back on this thread you will see the code additions needed to add the customers product information to the form. Also you will find an explanation of why the invoicec/order number cannot be added to the form...because the form is produced before the order is added to the database and an invoice number allocated. Thanks Simon Quote *************************************** I've been contemplating thinking about thinking *************************************** Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.