Page 1 of 1

How to require minimum order total?

Posted: Sun Feb 19, 2012 8:35 am
by bonehead1
I have searched the forums before posting this so please excuse me if this has been discussed and I have overlooked it.

I am using v1.5.1.3

I have cloned and modified the Pickup From Store shipping module to create a Local Delivery shipping module and they both work perfectly as is. However, I would like to require a minimum order total amount (before taxes, if possible) in order for them to be able to select Local Delivery.

I have looked on the boards and noticed there is a countProducts() function but I am unable to find one that would be something like orderTotal(). Is this a built in function or does it need to be coded? In which file would I add this in order to compare orderTotal() to my minimum order total requirement? I'm going to be hard coding the minimum total with something like if(orderTotal() > 25).

Current I have a simple note below the Local Delivery option that says not to choose it if your order total is below $25.

I know PHP very well so once I now where this needs to be placed it shouldn't be a problem...

Thanks!

Re: How to require minimum order total?

Posted: Sun Feb 19, 2012 5:35 pm
by grgr
Add this to your shipping module.

if ($this->cart->getSubTotal() < '100') {
$status = FALSE;
}

Re: How to require minimum order total?

Posted: Tue Feb 21, 2012 8:04 am
by bonehead1
grgr wrote:Add this to your shipping module.

if ($this->cart->getSubTotal() < '100') {
$status = FALSE;
}
Worked perfect -- thank you!

Re: How to require minimum order total?

Posted: Fri Mar 09, 2012 7:28 am
by jzuverza
Can anyone tell me where to put that code?
My php skills need some help.

Thanks in advance.

Re: How to require minimum order total?

Posted: Tue Jan 22, 2013 9:54 pm
by parkookk
Me too I have found shipping_method.tpl in catalogue/view/theme/default/template/checkout
but I don't know where to put it??
I would appreciate if anyone helps. ???

Re: How to require minimum order total?

Posted: Mon Feb 18, 2013 5:49 pm
by jadeye
Hey guys,

It is in the same folder just a different file: confirm.tpl

catalogue/view/theme/default/template/checkout/confirm.tpl

Line 46 (at least on mine site):

<?php if ($this->cart->getSubtotal() >= XXX) { ?>
<div class="payment"><?php echo $payment; ?></div>
<?php } else { ?>
<div class="warning">Minimum Order on this site is XXX $</div>
<?php } ?>

Hope this helped you.

JadeYe