Hey guys. I got a half working solution for the issues raised when enabling Paypal Pro and (presumably) any other PSP option.
A drop down list is created, with, in my scenario, Protx and Paypal.
If the user selects Protx, the CC fields below still show and are * as mandatory, even though they are not. Customers were entering their credit card details into those fields, clicking next, going to Protx then phoning up going mad "who did I give my card details to, now Protx is asking for them too?!?" yada yada yada. So, this idea dawned on me.
If Protx is selected, it (should) hide the CC fields, if Paypal Pro is selected in the list, the CC details fields are displayed. I spoke with Paul from support, and he managed to draw the following code up for me. The only issues is, when the page first loads, the CC fields are shown, even though Protx is selected as default. If the user selects Paypal, the fields still show, as expected. However, if they then go from Protx to Paypal back to Protx, the fields are hidden, as expected. So, my question is - how do I get the fields to be hidden when the page first loads at checkout and Protx is set as default? Here's the magic:
- in Design | Text dialog click on 'Go to'
- enter 1951 into ID and click OK
- enter the following text into Current Value field:
- click OK
- on Design tab, select page type 'Checkout Page 2'
- scroll down to the following lines:
- after these lines insert the following lines:
- the next line is
- insert the following lines after it
- after these lines there is a 'block if' block. After the closing
</block> insert the following lines:
And that's it! Any suggestions on how to hide the fields when the page first loads?
Cheers,
Grant
A drop down list is created, with, in my scenario, Protx and Paypal.
If the user selects Protx, the CC fields below still show and are * as mandatory, even though they are not. Customers were entering their credit card details into those fields, clicking next, going to Protx then phoning up going mad "who did I give my card details to, now Protx is asking for them too?!?" yada yada yada. So, this idea dawned on me.
If Protx is selected, it (should) hide the CC fields, if Paypal Pro is selected in the list, the CC details fields are displayed. I spoke with Paul from support, and he managed to draw the following code up for me. The only issues is, when the page first loads, the CC fields are shown, even though Protx is selected as default. If the user selects Paypal, the fields still show, as expected. However, if they then go from Protx to Paypal back to Protx, the fields are hidden, as expected. So, my question is - how do I get the fields to be hidden when the page first loads at checkout and Protx is set as default? Here's the magic:
- in Design | Text dialog click on 'Go to'
- enter 1951 into ID and click OK
- enter the following text into Current Value field:
Code:
<select name='PAYMENTMETHOD' size="1" onChange="javascript:HideCCDetails(this)" >
- on Design tab, select page type 'Checkout Page 2'
- scroll down to the following lines:
Code:
<actinic:variable name="OrderRequiresPayment" /> <table border="0" cellspacing="2" cellpadding="2" class="checkout">
Code:
<script language=javascript type='text/javascript'> function hideDiv() { if (document.getElementById) { // DOM3 = IE5, NS6 document.getElementById('CCDetails').style.visibility = 'hidden'; } else { if (document.layers) { // Netscape 4 document.CCDetails.visibility = 'hidden'; } else { // IE 4 document.all.CCDetails.style.visibility = 'hidden'; } } } function showDiv() { if (document.getElementById) { // DOM3 = IE5, NS6 document.getElementById('CCDetails').style.visibility = 'visible'; } else { if (document.layers) { // Netscape 4 document.CCDetails.visibility = 'visible'; } else { // IE 4 document.all.CCDetails.style.visibility = 'visible'; } } } function HideCCDetails(selectObj) { if (selectObj.options[selectObj.selectedIndex].value == "10005") { showDiv(); } else { hideDiv(); } } </script>
Code:
<actinic:variable name="CheckoutPrompt" value="Payment Method Selection" if="%3cactinic%3avariable%20name%3d%22PaymentPrompt000Visible%22%20%2f%3e" />
Code:
</table> <div id="CCDetails"> <table border="0" cellspacing="2" cellpadding="2" class="checkout">
</block> insert the following lines:
Code:
</table> </div> <table border="0" cellspacing="2" cellpadding="2" class="checkout">
Cheers,
Grant
Comment