如果有人点击结账,它应该检查小计是否大于或等于,如果它满足条件它应该成功重定向到结账页面,否则它应该重定向到购物车页面

我已在catalog / controller / checkout / cart.php中添加了此代码

here is my code

$this->data['stotal'] = 1000;

if ($this->cart->getSubtotal() <= $this->data['stotal'] ){
$this->session->data['error'] = 'Minimum amout should be 1000 to checkout';
$this->redirect($this->url->link('checkout/cart'));

$this->data['checkout'] = false;
} else {
        $this->data['checkout'] = $this->url->link('checkout/checkout', '', 'SSL');

    }

i am getting this error

“页面没有正确重定向”

如果我评论重定向网址,然后它重定向到主页,但“最低限度应该是1000结账”消息保持很长时间,它只在我点击关闭图标后

Note: i am trying this in 1.5+ not in 2.0