To check if it is the cart page you can use the following code in your View class:
PHP Code:
/**
* Check if the widget is visible.
*
* @return boolean
*/
protected function isVisible()
{
return parent::isVisible() && $this->isAllowedPage();
}
protected function isAllowedPage()
{
$controller = \XLite::getController();
return !$controller->isCheckoutLayout() && ($controller->getTarget() !== 'cart');
}
This way you don't need any checks in the template of your menu widget - isVisible() method will make it disappear on checkout and cart pages.