Post by nzjolly » Tue Sep 22, 2009 5:28 pm

Hi All,
does anyone know a way to have a max number of items that can be put into a single card at one time?
ie: say i wanted to have a max number of items per cart load.. of say 2 items.

maybe a message saying your cart is full.

New member

Posts

Joined
Tue Sep 01, 2009 6:52 am

Post by nzjolly » Wed Sep 23, 2009 7:01 am

1. This could possibly be better done with a proper Order Total Module
2. If you want an easy hack, you could make it a lot easier.

Try this:
EDIT: catalog/view/theme/default/template/checkout/confirm.tpl
FIND:

Code: Select all
<div id="payment"><?php echo $payment; ?></div>
REPLACE WITH:

Code: Select all
<?php if ((int)$this->cart->countProducts() > 4) { ?>
<div id="payment"><?php echo $payment; ?></div>
<?php } else { ?>
<div class="warning">You must purchase at least 5 items to checkout</div>
<?php } ?>


That's it. Only 1 file.
this might work for me, so will change this code alittle and see what occurs.

New member

Posts

Joined
Tue Sep 01, 2009 6:52 am

Post by nzjolly » Wed Sep 23, 2009 8:13 am

Code: Select all

<?php if ($comment) { ?>
  <b style="margin-bottom: 3px; display: block;"><?php echo $text_comment; ?></b>
  <div style="background: #F7F7F7; border: 1px solid #DDDDDD; padding: 10px; margin-bottom: 10px;"><?php echo $comment; ?></div>
  <?php } ?>
  <?php if ((int)$this->cart->countProducts() <5) { ?>
<div id="payment"><?php echo $payment; ?></div>
<?php } else { ?>
<div class="warning">You cannot purchase more than 4 items to checkout, this is due only to shipping cost complexity</div>
<?php } ?>
well that worked good oh...

however it would be nice to be able to stop them adding more than 4 products to the cart.
anyone got any ideas on how to do that?

New member

Posts

Joined
Tue Sep 01, 2009 6:52 am

Post by nzjolly » Fri Sep 25, 2009 4:42 am

however it would be nice to be able to stop them adding more than 4 products to the cart.
anyone got any ideas on how to do that?
anyone??

New member

Posts

Joined
Tue Sep 01, 2009 6:52 am
Who is online

Users browsing this forum: Amazon [Bot], Google [Bot], Semrush [Bot] and 58 guests