I have made some modifications to the header code, as you can see from the code
I want to show the checkout and cart button when products or vouchers in cart and
only show the account button if customer logged in.
Now problem is that everything works fine but these buttons work when conditions are
met but need page fresh to reload the elements. Can someone please tell me
the ajax code to bake into the php to refresh only these buttons when conditions are met and
hide when condition not met.
Fading them in like the notification bar. I got a $10 dollar budget.
thank you in advance
Code: Select all
<!-- checks if product in cart and if yes shows checkout and cart button -->
<ul class="main_menu">
<?php if ($this->cart->hasProducts()) { ?>
<li><a id="top-checkout" href="<?php echo $checkout; ?>"><?php echo $text_checkout; ?></a></li>
<li><a id="top-cart" href="<?php echo $cart; ?>"><?php echo $text_cart; ?></a></li>
<?php } else { ?>
<!-- checks if voucher in cart and if yes shows checkout and cart button -->
<?php if ($this->cart->hasProducts() || (isset($this->session->data['vouchers']) && $this->session->data['vouchers'])) { ?>
<li><a id="top-checkout" href="<?php echo $checkout; ?>"><?php echo $text_checkout; ?></a></li>
<li><a id="top-cart" href="<?php echo $cart; ?>"><?php echo $text_cart; ?></a></li>
<?php } ?>
<?php } ?>
<!-- END -->
<!-- checks if customer is logged in and if yes shows account button -->
<?php if ($logged) { ?>
<li><a id="top-account" href="<?php echo $account; ?>"><?php echo $text_account; ?></a></li>
<?php } ?>
<!-- END -->