Page 1 of 1

Need to select payment type based on order amount

Posted: Fri Apr 08, 2011 10:05 am
by sonnynobucks
Hello,

I need to be able to "not show" payment options if the total cart amount is above a set limit. I am looking at the payment.tpl and founded the area I need to modify. My question is total amount variable accessible in this template and if so what data structure is it in?

Scott

Re: Need to select payment type based on order amount

Posted: Sun Apr 10, 2011 4:24 pm
by grgr
I need to do this aswell so this is what I have done to acheive it.

You need to edit the appropriate file in ..\catalog\model\payment

The files all seem to follow the same formatting so should work for any of them

You need to add these lines:
if ($this->cart->getSubTotal() > '100')
$status = FALSE;
Directly above:
$method_data = array();

if ($status) {
$method_data = array(
'id' => 'cod',
'title' => $this->language->get('text_title'),
'sort_order' => $this->config->get('cod_sort_order')
);
}

return $method_data;
}
}
?>

This will prevent the payment method from showing if the sub total is greater than £100.