Interesting. My understanding of the COWOA mod is that the customer still gets logged in normally with a session and a created account, but because they don’t enter a password at sign-up, there’s no way for them to login again once that session expires. During this “login”, various links are hidden such as ‘logout’ and ‘my account’. More importantly, and this has only just occurred to me, I believe the customer is automatically logged off on returning to the checkout success page, thus quite a problem.
In that case, I would like to use an ‘if’ statement on tpl_login_default.php to not display the COWOA option if a download is in the cart.
This is the code which displays the COWOA option:
PHP Code:
<?php
if ($_SESSION['cart']->count_contents() > 0) { ?>
<fieldset>
<legend>Checkout Without Account</legend>
<?php echo TEXT_RATHER_COWOA; ?>
<div class="buttonRow forward">
<?php echo "<a href=\"" . zen_href_link(FILENAME_NO_ACCOUNT, '', 'SSL') . "\">"; ?>
<?php echo zen_image_button(BUTTON_IMAGE_CONTINUE, BUTTON_CONTINUE_ALT); ?></a></div>
<br class="clearBoth" />
</fieldset>
<?php } ?>
The product ID of my download is 191. So could I wrap something like this around it:
PHP Code:
<?php
$products = $_SESSION['cart']->get_products();
$founddownload = false;
for ($i=0; $i<sizeof($products); $i++) {
if ( $products[$i]['id'] == 191 ) {
$founddownload = true;
}
}
if ( $founddownload == false ) {
if ($_SESSION['cart']->count_contents() > 0) { ?>
<fieldset>
<legend>Checkout Without Account</legend>
<?php echo TEXT_RATHER_COWOA; ?>
<div class="buttonRow forward">
<?php echo "<a href=\"" . zen_href_link(FILENAME_NO_ACCOUNT, '', 'SSL') . "\">"; ?>
<?php echo zen_image_button(BUTTON_IMAGE_CONTINUE, BUTTON_CONTINUE_ALT); ?></a></div>
<br class="clearBoth" />
</fieldset>
<?php }
}
?>