No orders below for example 300


No avatar

2005-07-30 00:04

How can I make shure no orders below 300 are stored? I want the user to get an error message if trying to check out with a order value below 300.

I tried doing this with Java Script:
Added this to orders_basket.tpl row 2
<form name='myForm' action='?p=$p&amp;akcja=zapisz' method='post' onSubmit='return checkminimum($aBasket[fSummary])'>

with the following Java Scripe defined:
function checkminimum( total ){
if(total < 300.0) {
alert("An error message...");
return false;
return true;

This seemed to work. But has the bug that when someone hits the update button and has below 300 in his basket he also gets the error message and is not possible to update his cart.

Anyone that can pint me in the right direction or give me a solution to this problem? ;-)


No avatar

2005-07-30 14:54

I skipped the js aproach and tried to to it in plugins/taxAndDiscount/actions_client.php since I'm using that plugin. The problem is that my variable aBasked seems empty, how do I fill it with the fSummary value. Or if there is an other way to get hold of the ordervalue? The only thing that seems to exist allready in that function is $iOrder. Anybody?

What I've done:
if( $p == 'delivery' ){
global $aBasket;
if( $aBasket['fSummary'] < 300.0 ) {
echo "<script> alert(\"Keep shopping untill you reach ordervalue of 300\"); document.location = \"index.php?p=basket\" </script>";

Back to top
about us | contact