Jump to content

torq

Members
  • Content count

    9
  • Joined

  • Last visited

Profile Information

  • Real Name
    A Sharp
  1. torq

    fast easy checkout

    (Posted this in the wrong forum yesterday - so here it is for fast easy checkout).... Thought I'd share my solution to the problem of currency symbols showing as a little square in the Ajax get new totals functionality. There was a previous post in this thread that suggested changing the currency symbol in Admin from £ (pound symbol) to an ascii equivalent (& # 1 6 7) - whilst this fixed the ajax function in fast easy checkout, it messed up the order confirmation emails if they were plain text emails. So my fix was as follows: In includes/classes/order_total.php, create a new function as follows: function ajaxedoutput() { $output_string = ''; if (is_array($this->modules)) { reset($this->modules); while (list(, $value) = each($this->modules)) { $class = substr($value, 0, strrpos($value, '.')); if ($GLOBALS[$class]->enabled) { $size = sizeof($GLOBALS[$class]->output); for ($i=0; $i<$size; $i++) { $ccy_formatted= eregi_replace('£', '& # 1 6 7', $GLOBALS[$class]->output[$i]['text']); $output_string .= ' <div align="right" class="main">' . $GLOBALS[$class]->output[$i]['title'] . ' ' . "\n" . $ccy_formatted . '</div>' . "\n"; } } } } return $output_string; } This function is similar to the existing output function, but it does a eregi_replace on the field that has the currency symbol in it, to replace the pound symbol with the ascii equivalent. That way, this ascii translation only happens in the ajax get new total area, and doesn't affect any other part of oscommerce. Then in checkout_confirmation2.php, call this new function if (MODULE_ORDER_TOTAL_INSTALLED) { $order_total_modules->process(); echo $order_total_modules->ajaxedoutput() ; } Note: In order for the ascii code not to be translated in the forum post to a pound symbol, I have put spaces into it - otherwise you wouldn't see what I am trying to say! You will need to remove these spaces in your php code. My new ajaxedoutput function also lists the output vertically rather than horizontally - if you want to stay horizontal, compare the new function with the existing output function and use the old tables-based layout. Also - I created a new function rather than amending the existing output function, so that I didn't mess anything up in another part of oscommerce. Hope that's useful. AS
  2. Thought I'd share my solution to the problem of currency symbols showing as a little square in the Ajax get new totals functionality. There was a previous post in this thread that suggested changing the currency symbol in Admin from £ (pound symbol) to an ascii equivalent (& # 1 6 7) - whilst this fixed the ajax function in fast easy checkout, it messed up the order confirmation emails if they were plain text emails. So my fix was as follows: In includes/classes/order_total.php, create a new function as follows: function ajaxedoutput() { $output_string = ''; if (is_array($this->modules)) { reset($this->modules); while (list(, $value) = each($this->modules)) { $class = substr($value, 0, strrpos($value, '.')); if ($GLOBALS[$class]->enabled) { $size = sizeof($GLOBALS[$class]->output); for ($i=0; $i<$size; $i++) { $ccy_formatted= eregi_replace('£', '& # 1 6 7', $GLOBALS[$class]->output[$i]['text']); $output_string .= ' <div align="right" class="main">' . $GLOBALS[$class]->output[$i]['title'] . ' ' . "\n" . $ccy_formatted . '</div>' . "\n"; } } } } return $output_string; } This function is similar to the existing output function, but it does a eregi_replace on the field that has the currency symbol in it, to replace the pound symbol with the ascii equivalent. That way, this ascii translation only happens in the ajax get new total area, and doesn't affect any other part of oscommerce. Then in checkout_confirmation2.php, call this new function if (MODULE_ORDER_TOTAL_INSTALLED) { $order_total_modules->process(); echo $order_total_modules->ajaxedoutput() ; } Note: In order for the ascii code not to be translated in the forum post to a pound symbol, I have put spaces into it - otherwise you wouldn't see what I am trying to say! You will need to remove these spaces in your php code. My new ajaxedoutput function also lists the output vertically rather than horizontally - if you want to stay horizontal, compare the new function with the existing output function and use the old tables-based layout. Also - I created a new function rather than amending the existing output function, so that I didn't mess anything up in another part of oscommerce. Hope that's useful.
  3. hi Boxtel, I too have installed a more recent version of PWA and then found that customer_id is set to 0 on the orders file for all PWA orders. I want to get to a PWA solution that sets a unique customer_id for PWA orders as well as account holder orders. You suggest going to a version prior to 1.0.2 - could you confirm that you mean version 0.910 of December 2005? Also - since I installed PWA as the first contribution of many, I'm a little nervous about trying to regress the PWA contribution back to 0.910. Any thoughts on how to simply change the more recent PWA to generate unique customer_ids on the order form (without breaking anything else!). Many thanks in advance, A
  4. Well, it ain't pretty, but I got a workround at least... 1. uncheck 'open PDF in browser' option within Acrobat Reader 2. force a unique filename for the batch_orders.pdf file by attaching a timestamp as a parameter, using onClick from the 'click here to download the pdf' link to run this javascriot: <script LANGUAGE="JavaScript"><!-- function updateLink(filename) { now = new Date(); return filename + '?' + now.getTime(); } //--></SCRIPT> the script itself is placed in batch_print_header.php Maybe no-one else has the same problem as me, but I guess the timestamp solution could help others with PDF or cache related problems, I guess.... A
  5. The test you described worked perfectly for me - no problems whatsoever....sorry that this doesn't help! A
  6. Damn - seems my problem isn't quite finished! Having set Acrobat reader to open in its own non-browser window, I now don't have the opportunity to hit the 'refresh' button to force the latest PDF to be shown - so I see what's in the browser's cache. When I had PDFs opening in a browser window, the cache problem was still there, but it was easy to hit refresh to force the new PDF to load. If the PDF opens in its own window, the only way I can get the new one to load is either to disable broswer caching totally, or to delete my temporary internet files before creating the new PDF....both of which are a bit of a pain. So I'm back to how to make PDfs within a browser window print out properly if they are only 1 page long.... again, any thoughts welcome.... A.
  7. Thanks - that wee bit of information got me thinking and I've worked out what the problem is...after your reply, I tested on Firefox and Opera - Firefox had the same problem but Opera worked great. And I noticed that Opera was ignoring the fact that in Acrobat Reader, I'd set my preferences to open the PDF inside the browser window.....so once I'd gone back to Acrobat Reader and unchecked that option (causing the PDF to open in its own, non-browser window) the printouts work fine in all browsers. Looks like its a bug in how IE and Firefox treat PDF documents....I can live with PDFs opening outside of a browser window... Thanks for the pointer! A.
  8. Hi, I've installed Batch Print center and all is fine except for one thing...if I specify a single order number to print, and I use the Invoice template or the packing slip template, the PDF looks fine on screen but prints out distorted. The distortion means that the top few lines of the header info is chopped off, and the last few lines of print are repeated. I've done some tests: If I select a range of orders, rather than a single order number, the invoice template and the packing slip template work perfectly and all pages of the PDF print out fine. Similarly, if I use the packing slip and invoice template (which creates two pages) it works fine, even if I only choose to print one of the two pages of the PDF. I've wracked my brains on this to see what the difference between the two templates is and I can't crack it - although obviously it's to with the PDF being only a single page in length. Does anyone have any suggestions on this? I'm using Acrobat Reader 7.0 if that's remotely connected to the problem.... grateful for any advice. A.
  9. Hi, I've installed Batch Print center and all is fine except for one thing...if I specify a single order number to print, and I use the Invoice template or the packing slip template, the PDF looks fine on screen but prints out distorted. The distortion means that the top few lines of the header info is chopped off, and the last few lines of print are repeated. I've done some tests: If I select a range of orders, rather than a single order number, the invoice template and the packing slip template work perfectly and all pages of the PDF print out fine. Similarly, if I use the packing slip and invoice template (which creates two pages) it works fine, even if I only choose to print one of the two pages of the PDF. I've wracked my brains on this to see what the difference between the two templates is and I can't crack it - although obviously it's to with the PDF being only a single page in length. Does anyone have any suggestions on this? I'm using Acrobat Reader 7.0 if that's remotely connected to the problem.... grateful for any advice. A.
×