1835 Posts in 473 Topics by 403 members
E-Commerce Module
SilverStripe Forums » E-Commerce Module » How to extend info stored in the Cart?
Discuss the E-Commerce Module.
Moderators: martimiz, Nicolaas, Howard, Sean, Ryan M., biapar, Willr, Ingo, Jedateach, swaiba
|
Page:
1
|
Go to End | |
| Author | Topic: | 424 Views |
-
How to extend info stored in the Cart?

1 September 2010 at 8:22pm
How can I store additional data in the cart, by an extension or somthing? I looked at the module trying to figure out the data model (using also an old graph by the previous releases of e-commerce) but could not come up with anything. I'm using the 0.61 beta
-
Re: How to extend info stored in the Cart?

2 September 2010 at 12:54pm
What are you trying to store? I read somewhere on the google code project the cart variables were going to be stored in the database not in sessions....
The current session logic is inside ecommerce/code/model/ShoppingCart.php
you can see the functions add_item() around line 138Hope that helps
-
Re: How to extend info stored in the Cart?

2 September 2010 at 7:05pm
I'm trying to have additional info in the Cart, info i take from my extended product class. For example, storing in a row of the cart the color, dimension and other variablesi have in the extended product, stuff like that. If I' getting this in the right way, I would have to extend something like ProductExtended_OrderItem... but first question: how I have to write all the functions found in classes such as Product_OrderItem?
Having made this, I would have to modify the function addItem at line 407 to have it handle my ProductExtended model. But how I can do it without patching the original code? I could do a custom class like MyShoppigCart and have silverstripe look on it with usecustomclass like Object::useCustomClass('ShoppingCart', 'MyShoppingCart', true);
Would it work? any other ways? -
Re: How to extend info stored in the Cart?

2 September 2010 at 7:23pm
I must add I did not use Product Variations but rather custom classes I made.
-
Re: How to extend info stored in the Cart?

2 September 2010 at 8:02pm
changed my ecommerce source to branch "BURNBRIGHT_DBCART", so shopping cart is really different and now IT IS in the database, suggestion again?
| 424 Views | ||
|
Page:
1
|
Go to Top |


