[TYPO3-commerce] $GLOBALS['TSFE']->set_no_cache() --> bad practice --> why using it?

Franz Koch typo.removeformessage at fx-graefix.de
Wed Aug 29 16:15:33 CEST 2007


Again me,

in the basket quickView the two links to the full basket and to the 
checkout are not allowed to be cached and therefore use the 'no_cache' 
option. This is a) bad practice and b) not necessary, as the checkout 
and the basket plugins are of type USER_INT and therefore normally not 
cached - right? So let's gain some performance back and don't apply the 
no_cache parameter to the links:

--- change lines 322 and 323 from class.tx_commerce_pi2.php -----------
from:
$basketArray['###URL###'] = 
$this->pi_linkTP_keepPIvars_url(array(),0,1,$this->conf['basketPid']);
	    $basketArray['###URL_CHECKOUT###'] = 
$this->pi_linkTP_keepPIvars_url(array(),0,1,$this->conf['checkoutPid']);

to:
$basketArray['###URL###'] = 
$this->pi_linkTP_keepPIvars_url(array(),1,1,$this->conf['basketPid']);
	    $basketArray['###URL_CHECKOUT###'] = 
$this->pi_linkTP_keepPIvars_url(array(),1,1,$this->conf['checkoutPid']);
-----------------

When modifying the class anyway, you could add the missing definition 
for the marker '###BASKET_ITEMS###' which is set in the main basket but 
not in the quickView. The marker doesn't provide the article list but 
the item count of the basket:

-----
$basketArray['###BASKET_ITEMS###'] = $this->basket->getItemsCount();
-----

Should I put that to bugtracker, or is it ok here as it is done within 
15 seconds ;)

Btw. the function getItemsCount seems to be wrong - I currently only 
have 1 item in the stock, but it counts 3 items (I guess delivery and 
payment).

--
Kind regards,
Franz Koch


More information about the TYPO3-project-commerce mailing list