public function cleancart() {
$cartClass = hikashop_get('class.cart');
if($cartClass->hasCart())
$cartClass->delete($cartClass->cart->cart_id);
$url = JRequest::getVar('return_url','');
if(empty($url)) {
$url = JRequest::getVar('url','');
$url = urldecode($url);
} else {
$url = base64_decode(urldecode($url));
}
if(HIKASHOP_J30){
$plugin = JPluginHelper::getPlugin('system', 'cache');
$params = new JRegistry(@$plugin->params);
$options = array(
'defaultgroup' => 'page',
'browsercache' => $params->get('browsercache', false),
'caching' => false,
);
$cache = JCache::getInstance('page', $options);
//$cache_key = JUri::getInstance()->toString();
$cache->clean();
}
if(empty($url)) {
echo '<html><head><script type="text/javascript">history.go(-1);</script></head><body></body></html>';
exit;
}
if(strpos($url, 'tmpl=component') !== false || strpos($url, 'tmpl-component') !== false) {
if(!empty($_SERVER['HTTP_REFERER'])) {
$app = JFactory::getApplication();
$app->redirect($_SERVER['HTTP_REFERER']);
} else {
echo '<html><head><script type="text/javascript">history.back();</script></head><body></body></html>';
exit;
}
}
if(hikashop_disallowUrlRedirect($url))
return false;
$this->setRedirect($url);
}