THELIA Forum

Welcome to the THELIA support and discusssion forum

Announcement

Rejoignez la communauté sur le Discord Thelia : https://discord.gg/YgwpYEE3y3

Offline


Hi,
I'm trying to add some additional fields to the cartitems stored in session but without having them also saved in the database; I found the Action/Cart.php function that consumes CartEvents  -addItem; i commented all save and set function but cartitems are still saved to db and session. Where is this happening ? and where is the session being saved ? Any suggestions are highly appreciated.

Offline


The customer cart is persistent across sessions, and the cart items are always stored in the database. The session is only storing a token, to bring up the cart from the database when needed (see Thelia\Core\HttpFoundation\Session\Session::getSessionCart() method).

To add additonal field to a cartItem, just write a module which manages your additional fields in its own table, with a foreign key to the cartItem table, and write the related loops and hook to display these items in the front-office template.

More information about modules here: http://doc.thelia.net/en/documentation/ … index.html


OpenStudio Toulouse

Offline