Jump to:

2081 Posts in 1001 Topics by 452 members

E-Commerce Modules

SilverStripe Forums » E-Commerce Modules » How to extend info stored in the Cart?

Discuss about the various e-commerce modules available:
Ecommerce, SS Shop, SilverCart and SwipeStripe
Alternatively, have a look the shared mailinglist.

Moderators: martimiz, Nicolaas, Sean, frankmullenger, biapar, Willr, Ingo, Jedateach, swaiba, simon_w

Page: 1
Go to End
Author Topic: 648 Views
  • mattconfusion
    Avatar
    Community Member
    48 Posts

    How to extend info stored in the Cart? Link to this post

    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

  • Bambii7
    Avatar
    Community Member
    254 Posts

    Re: How to extend info stored in the Cart? Link to this post

    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 138

    Hope that helps

  • mattconfusion
    Avatar
    Community Member
    48 Posts

    Re: How to extend info stored in the Cart? Link to this post

    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?

  • mattconfusion
    Avatar
    Community Member
    48 Posts

    Re: How to extend info stored in the Cart? Link to this post

    I must add I did not use Product Variations but rather custom classes I made.

  • mattconfusion
    Avatar
    Community Member
    48 Posts

    Re: How to extend info stored in the Cart? Link to this post

    changed my ecommerce source to branch "BURNBRIGHT_DBCART", so shopping cart is really different and now IT IS in the database, suggestion again?

    648 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.