Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » Add shopping cart to all pages.

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, biapar, Willr, Ingo, simon_w

Page: 1
Go to End
Author Topic: 2763 Views
  • ScottiouS
    Avatar
    Community Member
    54 Posts

    Add shopping cart to all pages. Link to this post

    In case anyone was wondering (as I was) how to make the cart display on all pages, and not just on pages that are a "Product" or "Product Group" type page, here's how.

    First of all you need to of course have the <% include Cart %> or <% include ProductMenu %> in your Page.ss template somewhere.

    Then just add the following to the Page.php under the Page class...

       /**
        * Returns the shopping cart
        */
       function Cart(){
          return Order::ShoppingCart();
       }

  • Fuzz10
    Avatar
    Community Member
    787 Posts

    Re: Add shopping cart to all pages. Link to this post

    Hi...

    I can't get the shopping cart to work at all , got any tips ?

    Installed the module and it seems to work , but when I try adding products to the cart, it just refreshes the page and doesn't do anything. Maybe a session / cookie related issue , but I can't figure it out.

    I know the commerce-module is beta , but it is supposed to work out of the box , right ?

  • ScottiouS
    Avatar
    Community Member
    54 Posts

    Re: Add shopping cart to all pages. Link to this post

    The shopping cart module wont work with the latest beta framework. Need to use version 2.02b
    You are right though, it is a session problem in the latest framework. This was fixed today and a new version should be available real soon.

  • Fuzz10
    Avatar
    Community Member
    787 Posts

    Re: Add shopping cart to all pages. Link to this post

    Ah !! Thanks a million for resolving this.

  • ScottiouS
    Avatar
    Community Member
    54 Posts

    Re: Add shopping cart to all pages. Link to this post

    Just to clarify, the problem was in the shopping cart module, not the latest framework. The shopping cart module just needed to be reworked to run on it correctly. Glad to help

    2763 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.