Jump to content


  • Content count

  • Joined

  • Last visited

Profile Information

  • Real Name
    Chris Peka
  1. cdpuk

    One Page Checkout Support

    For the benefit of anyone getting the same error as in my earlier post, this is how I sorted it: Open protx_direct.php and find // create card detail entry form $js = '..snip..'; and either take out the line breaks or after the statement add $js = str_replace(array("\r", "\n"), "", $js); for a more human readable solution. The line breaks were breaking the AJAX response. -Chris
  2. cdpuk

    One Page Checkout Support

    Hi all, I'm trying to get this working with the Protx Direct (a.k.a SagePay) module, and I get an error about setting the payment method (the JavaScript "please contact itwebexperts" one). I've poked around a bit and the cause seems to be when the credit card type field is passed back through an AJAX request. If I modify onepage_checkout.php so that after for ($i=0, $n=sizeof($confirmation['fields']); $i<$n; $i++) { I add if ($confirmation['fields'][$i]['title'] == 'Credit Card Type:') { continue; } then the remaining input fields for Protx Direct are displayed, but obviously this is useless without the card selection field. So the problem is caused by the following being sent back through the AJAX request: <tr><td width="10"><img src="images/pixel_trans.gif" border="0" alt="" width="10" height="1"></td><td class="main">Credit Card Type:</td><td><img src="images/pixel_trans.gif" border="0" alt="" width="10" height="1"></td><td class="main"><select name="protx_direct_cc_type" onchange="protx_update_fields(this.value);"><option value="UKE">Electron</option><option value="MC">Mastercard</option><option value="SOLO">Solo</option><option value="MAESTRO">Switch / Maestro</option><option value="VISA">Visa</option><option value="DELTA">Visa Delta</option></select><script type="text/javascript"> $(function() { var cctype = document.getElementsByName("protx_direct_cc_type"); protx_update_fields(cctype[0].value); }); function protx_update_fields(value) { if (value == "AMEX" || value == "SOLO" || value == "MAESTRO") { $(".protx_hidden").css("visibility",""); } else { $(".protx_hidden").css("visibility", "hidden"); } } </script></td><td width="10"><img src="images/pixel_trans.gif" border="0" alt="" width="10" height="1"></td></tr> I'm sure the problem is being caused by the fact that this field includes JavaScript code, but I simply don't know enough to understand why this is causing an error when selecting the Protx payment method. If nobody has any ideas I may forward this on to itwebexperts. This is a great contribution, but unfortunately no good unless it plays nicely with other modules. Thanks, Chris