I want to add a continue shopping button when the cart is empty. I found the place in Product > Cart that I think does this ie
if(empty($desc) && $desc != '0'){
$this->params->set('msg',$emptyText);
I then added the custom code that does the job fine but alas is shows the button weather or not the $emptyText is displayed. I would have thought that as it is nested in the if statement that appears to control the display of "The Cart is empty" that it would only appear when that does, and not all the time.
if(empty($desc) && $desc != '0'){
$this->params->set('msg',$emptyText);
$config =& hikashop_config();
$continueShopping = $config->get('continue_shopping', '');
if(!empty($continueShopping)) {
global $Itemid;
$url_itemid='';
if(!empty($Itemid)){
$url_itemid='&Itemid='.$Itemid;
}
if(strpos($continueShopping,'Itemid') === false) {
if(strpos($continueShopping,'index.php?') !== false) {
$continueShopping .= $url_itemid;
}
}
if(!preg_match('#^https?://#',$continueShopping)) $continueShopping = JURI::base().ltrim($continueShopping,'/');
echo '<div style="float: right;">'.$this->cart->displayButton(JText::_('CONTINUE_SHOPPING'),'continue_shopping',$this->params,JRoute::_($continueShopping),'window.location=\''.JRoute::_($continueShopping).'\';return false;','id="hikashop_checkout_shopping_button"').'</div>';
}
}