Minimum order in money value

culda_a

Avatar: culda_a

2008-09-10 21:02

is there a way to set a minimum value that you have to buy from the shop... let's say That the minimum value is 20 euro ... is there a way to restrict orders that are under 20 euro?

» Quick.Cart v3.x

Makaron

Avatar: Makaron

2008-09-11 10:06

You can try in this way.. Edit file core/orders.php and below function checkFields paste new function which look like that:


  
function checkMinSummary$aForm ){
    if(
      ( 
$_SESSION['fOrderSummary'.LANGUAGE] > MINIMAL_VALUE )
    )
      return 
true;
    else
      return 
false;
  } 
// end function checkMinSummary


In file action_client/p.php find line:

if( $oOrder->checkFields$_POST ) === true ){


and change it to:

if( $oOrder->checkFields$_POST ) === true ){
   if( 
$oOrder->checkMinSummary$_POST ) === true ){


and find line:


}
else{
   
$sOrder $oTpl->tbHtml'messages.tpl''REQUIRED_FIELDS' );
}


and change it to:


}
else{
   
$sOrder $oTpl->tbHtml'messages.tpl''MIN_SUMMARY' );
}
}
else{
   
$sOrder $oTpl->tbHtml'messages.tpl''REQUIRED_FIELDS' );
}


After that just edit file templates/messages.tpl and make new block MIN_SUMMARY and declare in it error which You want to show to Your users..

lateNIGHT

No avatar

2009-12-21 20:41

i edited all required files but i get this error
Fatal error: Call to undefined method Orders::checkMinSummary() in ...\actions_client\p.php on line 103

I think is something wrong with orders.php

I don`t know where to put function checkMinSummary. I can`t find function checkFields in orders.php

Can somebody help me?

beholder

Avatar: beholder

2009-12-22 04:04

checkFields is pretty much there.. no idea where are you looking for it.

Back to top
about us | contact