[TYPO3-mvc] Basket / session question
Jan Kornblum
jan.kornblum at gmx.de
Thu Feb 14 22:59:44 CET 2013
Hi group,
while playing with extbase i try to build a "shop". I have a
ProductModel and a fe_user-session based "basket". In this basket i
want to store "individual" BasketItem-Objects (UID of ProductModel,
Amount, Price) instead of real "big" ProductModel-Objects. Storing
items into the basket and displaying the baskets content works...
Now i want the ProductController's listAction to display something like
a "isInBasket / isNotInBasket" field in the view. But i have no idea
how to do this:
- Extending the ProductModel with an "isInBasket"-Property is certainly
the wrong way, as this property depends on the fe_user-session and also
should not be persisted to the database. Independent from this, how and
where to get this property filled?
- Creating a getProductsWithCurrentBasketInformation()-method in the
ProductModel-repository, would this be a good way? But which kind of
object should this return? Wroing place, isn't it?
- Creating a not persistable ProductWithBasketInformation-Model? Maybe
extend the ProductModel class? This sound the best from above...
- And how to get the basket-information "mapped" into the
Product-Objects? Would this be part of a service?
Can anybody give me a hint for the right direction? I would be happy :)
Kind regards, Jan
More information about the TYPO3-project-typo3v4mvc
mailing list