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.

Archive /

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

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

Add shopping cart to all pages.


Reply


5 Posts   2804 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, 787 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, 787 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 :)