Hi!
I want to keep cookies for the baskets a few days.
I am using the parameters in the file ini.php:
[B]session.cookie_lifetime 864000
session.gc_maxlifetime 172800
session.use_cookies On On
session.use_only_cookies Off
session.use_trans_sid 1[/B]
When I put the product to cart, I have cookies “[B]sid[/B]” and “[B]sid_key[/B]”. Cookie “[B]sid_key[/B]” disappears, if you close your browser. And the basket disappears too, if the user is not logged in.
I look at the file oxbasket.php.
Functions:
protected function _save()
{
if ( $this->_canSaveBasket() ) {
if ( $oUser = $this->getBasketUser() ) {
//first delete all contents
//#2039
$oSavedBasket = $oUser->getBasket( 'savedbasket' );
$oSavedBasket->delete();
//then save
foreach ( $this->_aBasketContents as $oBasketItem ) {
// discount or bundled products will be added automatically if available
if ( !$oBasketItem->isBundle() && !$oBasketItem->isDiscountArticle() ) {
$oSavedBasket->addItemToBasket( $oBasketItem->getProductId(), $oBasketItem->getAmount(), $oBasketItem->getSelList(), true, $oBasketItem->getPersParams() );
}
}
}
}
}
public function deleteBasket()
{
$this->_aBasketContents = array();
$this->getSession()->delBasket();
if ($this->getConfig()->getConfigParam( 'blPsBasketReservationEnabled' )) {
$this->getSession()->getBasketReservations()->discardReservations();
}
// merging basket history
if ( !$this->getConfig()->getConfigParam( 'blPerfNoBasketSaving' ) ) {
$this->_deleteSavedBasket();
}
}
I want to keep cart in cookies or a database, if the user is not logged in. How can I do this?
Thank you!