This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use the new forum.
Home » legacy support » symfony 1.2 » Maybe my session doesn't work
Maybe my session doesn't work [message #97943] Fri, 23 April 2010 14:18
xd1986  is currently offline xd1986
Messages: 3
Registered: April 2010
Junior Member
myuser class:
class myUser extends sfBasicSecurityUser
{
public function getShoppingCart()
{
if (!$this->getAttribute('shopping_cart'))
{
$this->setAttribute('shopping_cart', new sfShoppingCart(sfConfig::get('app_cart_tax')));

}

return $this->getAttribute('shopping_cart');
}
}
it's my action:
public function executeAdd($request)
{

$product = VgProductPeer::retrieveByPk($request->getParameter('id'));
$item = new sfShoppingCartItem('VgProduct', $request->getParameter('id'));
$item->setQuantity($request->getParameter('quantity'));
$item->setPrice($product->getPriceVat());



$this->shopping_cart = $shopping_cart;
$this->items = $shopping_cart->getItems();



the problem was that every time when i refreshed the page it would set a new shopping cart for me , so i think when i refreshed the page $this-getUser() was changed, it wasn't kept, who can tell me whether it's the problem about session?
i just followed the cook book of symfony to create the shopping cart but it doesn't work, why?

[Updated on: Fri, 23 April 2010 14:20]

Previous Topic:How to arrange data from multiple tables
Next Topic:a modal popup from updater?
Goto Forum:
  

powered by FUDforum - copyright ©2001-2004 FUD Forum Bulletin Board Software