Post by sonnynobucks » Fri Apr 08, 2011 10:05 am

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

Scott Danielson
e: scott@splinterg.com


New member

Posts

Joined
Wed Jul 29, 2009 7:19 am


Post by grgr » Sun Apr 10, 2011 4:24 pm

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.

-
Image Image Image
VIEW ALL EXTENSIONS * EXTENSION SUPPORT * WEBSITE * CUSTOM REQUESTS


User avatar
Active Member

Posts

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

Users browsing this forum: No registered users and 19 guests