WordPress.org

Forums

WP eCommerce
How do I display cart information in a custom theme? (3 posts)

  1. bobdobbs
    Member
    Posted 2 years ago #

    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?

    Thanks.

    http://wordpress.org/extend/plugins/wp-e-commerce/

  2. AliasEll
    Member
    Posted 2 years ago #

    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.

  3. bobdobbs
    Member
    Posted 2 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WP eCommerce
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic