Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Archive /

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

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

Add shopping cart to all pages.


Go to End


5 Posts   3186 Views

Avatar
ScottiouS

Community Member, 54 Posts

28 September 2007 at 4:15pm

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();
}

Avatar
Fuzz10

Community Member, 791 Posts

28 September 2007 at 11:10pm

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 ?

Avatar
ScottiouS

Community Member, 54 Posts

28 September 2007 at 11:41pm

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.

Avatar
Fuzz10

Community Member, 791 Posts

28 September 2007 at 11:44pm

Ah !! Thanks a million for resolving this.

Avatar
ScottiouS

Community Member, 54 Posts

28 September 2007 at 11:57pm

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 :)