<?php

namespace YSquare\GiftCert\Controller;

use OxidEsales\Eshop\Core\Registry;

class UserController extends UserController_parent {

    public function render()
    {
        $viewConfig = $this->getViewConfig();

        if(!$viewConfig->isGiftcertBusinessCleanBasket()) {
            Registry::getUtilsView()->addErrorToDisplay("YS_GIFTCERT_BUSINESS_NOT_UNIQUE_BASKET_ERROR", false, false, null, 'basket');
            Registry::getUtils()->redirect(Registry::getConfig()->getShopHomeUrl() . 'cl=basket', false, 302);
        }

        return parent::render();
    }

}
