Post by bonehead1 » Sun Feb 19, 2012 8:35 am

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!

Newbie

Posts

Joined
Sun Feb 19, 2012 8:28 am

Post by grgr » Sun Feb 19, 2012 5:35 pm

Add this to your shipping module.

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

Image Image Image Image Image Image Image Image


User avatar
Active Member

Posts

Joined
Mon Mar 28, 2011 4:08 pm
Location - UK

Post by bonehead1 » Tue Feb 21, 2012 8:04 am

grgr wrote:Add this to your shipping module.

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

Newbie

Posts

Joined
Sun Feb 19, 2012 8:28 am

Post by jzuverza » Fri Mar 09, 2012 7:28 am

Can anyone tell me where to put that code?
My php skills need some help.

Thanks in advance.

Newbie

Posts

Joined
Thu Mar 08, 2012 6:53 am

Post by parkookk » Tue Jan 22, 2013 9:54 pm

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. ???

New member

Posts

Joined
Thu Jan 17, 2013 11:56 pm
Location - london

Post by jadeye » Mon Feb 18, 2013 5:49 pm

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

Imagehttp://nwg.co.il/
“Compassion is the basis of morality.”
― Arthur Schopenhauer


New member

Posts

Joined
Sun Jul 15, 2012 12:35 am
Who is online

Users browsing this forum: No registered users and 5 guests