Support » Plugin: WP eCommerce » How do I display cart information in a custom theme?

  • Hi. I’m using e-commerce 3.8.9 and building it into a custom theme.

    So far, I’ve managed to install it and get it basically working. I’ve made a sample product and I can view a page for it.

    I’d like to display cart information on any given page. Most ecommerce sites, including getshopped have an element at the top of the page that says something like “view cart”, and might show the number of items in a cart.

    In a custom theme, how to I display something like this?

    Are there any re-usable code snippets offered by e-commerce or anyone?


Viewing 2 replies - 1 through 2 (of 2 total)
  • Hey,

    The plugin comes with a widget you can use to do this:

    Appearance > Widgets:

    Drag “Shopping Cart” into the sidebar area. If you want it in the header, you’ll need to make a widget holder in the header area yourself.

    So in your header.php file you’d have something like
    <?php dynamic_sidebar(‘Shopping Cart’); ?>

    Then in your functions.php, you’d need to register the sidebar using:

    register_sidebar(array(‘name’=>’Shopping Cart’,
    ‘before_widget’ => ”,
    ‘after_widget’ => ”,
    ‘before_title’ => ‘<!–‘,
    ‘after_title’ => ‘–>’,

    Hope that helps.

    I don’t have a strong understanding of how widgets work, but also I’m creating a custom theme that I want to look a certain way. I’m not giving the site owner the option to control the appearance, so I’m not using widgets.

    Also, the site won’t have a sidebar.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How do I display cart information in a custom theme?’ is closed to new replies.