disabled and enabled checkout button
-
- Posts: 9
- Joined: Fri Feb 19, 2016 10:51 pm
disabled and enabled checkout button
how to disable checkout button when user hasn't choose the item?
but when user has choose an item the checkout button will active again.
thanks
but when user has choose an item the checkout button will active again.
thanks
Re: disabled and enabled checkout button
You mean, the checkout button in the menu bar?
-
- Posts: 9
- Joined: Fri Feb 19, 2016 10:51 pm
Re: disabled and enabled checkout button
yes leo, how can i do that?leo wrote:You mean, the checkout button in the menu bar?
Re: disabled and enabled checkout button
Are you sure you want this?
If your customer adds products to the cart, but decides to continue the payment later and logs off, when he comes back, he cannot use the checkout button, although he has already products in his cart. This could be confusing for him.
If your customer adds products to the cart, but decides to continue the payment later and logs off, when he comes back, he cannot use the checkout button, although he has already products in his cart. This could be confusing for him.
-
- Posts: 9
- Joined: Fri Feb 19, 2016 10:51 pm
Re: disabled and enabled checkout button
yeah i know leo, but i want to give a tryleo wrote:Are you sure you want this?
If your customer adds products to the cart, but decides to continue the payment later and logs off, when he comes back, he cannot use the checkout button, although he has already products in his cart. This could be confusing for him.
so, when costumer hasn't adds product to the cart they can't use the checkout button, but if costumer has adds product to the cart they can access the checkout button.
please help me
Re: disabled and enabled checkout button
Modify catalog/template/defult/module/navigation.tpl to
then add to the end of catalog/template/default/shred/add_to_cart.tpl:
add to catalog/extension/module/navigation.php:
below
this:
and below
this line:
This should do the trick.
Code: Select all
<a href="<?php echo $account; ?>"><?php echo $text_account; ?></a>
<?php if (@$login) { ?>
<a href="<?php echo $login; ?>"><?php echo $text_login; ?></a>
<?php } else { ?>
<a href="<?php echo $logout; ?>"><?php echo $text_logout; ?></a>
<?php } ?>
<a href="<?php echo $cart; ?>"><?php echo $text_cart; ?></a>
<a href="<?php echo $checkout; ?>" class="<?php echo ($enable_checkout ? 'enabled' : 'disabled'); ?>"><?php echo $text_checkout; ?></a>
</div>
</div>
<script type="text/javascript"><!--
$(document).ready(function(){
$("#bar a:last").css("border-right","0px");
});
//--></script>
<script type="text/javascript"><!--
$(".b > a").on("click", function(event){
if ($(this).hasClass("disabled")) {
event.preventDefault();
}
});
//--></script>
Code: Select all
<script type="text/javascript"><!--
$(".add > .button").on("click", function(event){
$('.b > a').removeClass("disabled");
});
//--></script>
below
Code: Select all
$config =& $this->locator->get('config');
Code: Select all
$cart =& $this->locator->get('cart');
Code: Select all
$view->set('cart', $url->href('cart'));
Code: Select all
$view->set('enable_checkout', $cart->hasProducts());
-
- Posts: 9
- Joined: Fri Feb 19, 2016 10:51 pm
Re: disabled and enabled checkout button
thanks leo
Re: disabled and enabled checkout button
You are welcome.
Please use postreply and not quote.
Please use postreply and not quote.
Re: disabled and enabled checkout button
Hi Leo, was this fix added to the default template or does it still have to be applied manually?leo wrote: ↑Thu Dec 06, 2018 10:09 amHi, this phenomenal belly fat burners suggestion is not a fix, just a modification.
You have to add it manually.
Last edited by Dubrey on Wed Oct 11, 2023 5:58 am, edited 2 times in total.
Re: disabled and enabled checkout button
Hi, this is not a fix, just a modification.
You have to add it manually.
You have to add it manually.