Esempio n. 1
0
    $cart['last_visited'][$this->get['products_id']] = $this->get['products_id'];
    //$GLOBALS['TSFE']->fe_user->setKey('ses', $this->cart_page_uid, $cart);
    //$GLOBALS['TSFE']->fe_user->storeSessionData();
    tx_mslib_cart::storeCart($cart);
    //last visited eof
    if (isset($this->get['clear_list'])) {
        //$cart=$GLOBALS['TSFE']->fe_user->getKey('ses', $this->cart_page_uid);
        require_once \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('multishop') . 'pi1/classes/class.tx_mslib_cart.php';
        $mslib_cart = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_mslib_cart');
        $mslib_cart->init($this);
        $cart = $mslib_cart->getCart();
        $cart['last_visited'] = array();
        $cart['last_visited'][$this->get['products_id']] = $this->get['products_id'];
        //$GLOBALS['TSFE']->fe_user->setKey('ses', $this->cart_page_uid, $cart);
        //$GLOBALS['TSFE']->fe_user->storeSessionData();
        tx_mslib_cart::storeCart($cart);
    }
    unset($cart['last_visited'][$this->get['products_id']]);
}
if ($this->ms['MODULES']['CACHE_FRONT_END'] && !$this->ms['MODULES']['CACHE_TIME_OUT_PRODUCTS_DETAIL_PAGES'] || isset($this->get['tx_multishop_pi1']['cart_item']) && !empty($this->get['tx_multishop_pi1']['cart_item'])) {
    $this->ms['MODULES']['CACHE_FRONT_END'] = 0;
}
if ($this->ms['MODULES']['CACHE_FRONT_END']) {
    $options = array('caching' => true, 'cacheDir' => $this->DOCUMENT_ROOT . 'uploads/tx_multishop/tmp/cache/', 'lifeTime' => $this->ms['MODULES']['CACHE_TIME_OUT_PRODUCTS_DETAIL_PAGES']);
    $Cache_Lite = new Cache_Lite($options);
    $string = md5($this->cObj->data['uid'] . '_' . $this->HTTP_HOST . '_' . $this->server['REQUEST_URI'] . $this->server['QUERY_STRING']);
}
if (!$this->ms['MODULES']['CACHE_FRONT_END'] || !($output_array = $Cache_Lite->get($string))) {
    $output_array = array();
    // custom hook that can be controlled by third-party plugin
    if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/scripts/front_pages/products_detail.php']['productsDetailsPageJSHook'])) {
Esempio n. 2
0
 function emptyCart()
 {
     unset($this->cart['products']);
     //$GLOBALS['TSFE']->fe_user->setKey('ses', $this->cart_page_uid, $this->cart);
     //$GLOBALS['TSFE']->fe_user->storeSessionData();
     tx_mslib_cart::storeCart($this->cart);
 }