Just a couple of little code suggestions for the next release. Rather than editting the tpl_main_page file, could you add the following code to the includes/modules/pages/checkout_confimation/header_php.php file, right at the end, after the breadcrumb definitions
Code:
if (FEC_ONE_PAGE == 'true' && FEC_CHECKOUT_CONFIRMATION_TEXT_SWITCH == 'true') {
$za_onload_array[] = "document.checkout_confirmation.submit();";
}
This will automatically add the javascript to the body tag on load.
Also, it is worth noting here, that if a customer has javascript disabled, which is less common, but still possible with today's users, this page will never submit. To get round this, it may be worth also changing the tpl_checkout_confirmation_default file as follows:
Code:
<?php if (FEC_ONE_PAGE == 'true' && FEC_CHECKOUT_CONFIRMATION_TEXT_SWITCH == 'true') {
echo '<div style="text-align:center; color:#ff0000; font-weight:bold; padding-top:30px;">' . FEC_CHECKOUT_CONFIRMATION_TEXT . '</div>';
?>
<div class="centerColumn" id="checkoutConfirmDefault">
<?php } else { ?>
<div class="centerColumn" id="checkoutConfirmDefault">
<?php } ?>
CHANGE TO
Code:
<?php if (FEC_ONE_PAGE == 'true' && FEC_CHECKOUT_CONFIRMATION_TEXT_SWITCH == 'true') { ?>
<script type="text/javascript">
document.write("<style>#checkoutConfirmDefault { visibility:hidden; }</style><div style=\"text-align:center; color:#ff0000; font-weight:bold; padding-top:30px;\"><?php echo FEC_CHECKOUT_CONFIRMATION_TEXT; ?></div>");
</script>
<?php } ?>
<div class="centerColumn" id="checkoutConfirmDefault">
This will hide the page if hide page is selected in the admin settings, AND javascript is enabled. If Javascript is disabled, then the standard page is still displayed.
These have been tested in FireFox, IE 6 & 7 but should be tested in all browsers before adding the code to this module.
Hope these help.
Absolute
Bookmarks