• Hello,

    I was wondering if there is anyway to display the shopping cart in my template without using the widget. I am talking the full cart, as in the way the “new improved SC widget” is displayed.

    I am a bit of a control freak, and I dislike using widgets for this reason, however the functionality of having the cart in the sidebar could be quite useful. Having a way to call this function without using a widget would be very helpful.

    Thanks again for the awesome and unbelievably free plugin.

Viewing 11 replies - 1 through 11 (of 11 total)
  • Thread Starter jtimar

    (@jtimar)

    After some digging around I found some advice that I mangled into a wordpress function as follows:

    // eShop Cart
    function limelight_eshopcart()
    {
    echo display_cart($_SESSION[‘shopcart’.$blog_id],’true’, get_option(‘eshop_checkout’));
    }

    Very basic, and it did work to display the cart, but it would be much better if I could make it so the cart only appeared when it had something in it. I tried this, as I saw suggested in another thread:

    // eShop Cart
    function limelight_eshopcart()
    {
    if(isset($_SESSION[‘shopcart’.$blog_id]))
    {
    echo display_cart($_SESSION[‘shopcart’.$blog_id],’true’, get_option(‘eshop_checkout’));
    }
    }

    but that caused it to not display at all. Any suggestions?

    Anonymous User

    (@anonymized-3085)

    I would have thought control freaks would love widgets, as it gives them more control!

    No widgets cannot be used other than via the widget interface, and this one in particular would be difficult to include by any other means, sorry.

    Thread Starter jtimar

    (@jtimar)

    What about my second post above? It’s working, sort of, as in it does display the cart….

    Anonymous User

    (@anonymized-3085)

    set the 4th variable to ‘widget’ and see if that helps.

    Thread Starter jtimar

    (@jtimar)

    Sorry, but I’m pretty dumb with things like this, which is the fourth variable?

    Anonymous User

    (@anonymized-3085)

    display_cart($_SESSION['shopcart'.$blog_id],'true', get_option('eshop_checkout'),'widget')

    Thread Starter jtimar

    (@jtimar)

    Unfortunately that didn’t make a difference. Oh well.

    Anonymous User

    (@anonymized-3085)

    well you are trying to do something it wasn’t coded for ??

    Hey,

    The mistake in the code is pretty obvious, if anyone is still interested in this. You haven’t defined $blog_id; just add “global $blog_id;” to the beginning of your function and it works great.

    Peace,
    Steve

    Anonymous User

    (@anonymized-3085)

    LOL, so simple I missed it.

    Thread Starter jtimar

    (@jtimar)

    I tired to follow this thread and edited my code so it looks like this:

    // eShop Cart
    function limelight_eshopcart()
    {
    global $blog_id;
    if(isset($_SESSION['shopcart'.$blog_id]))
    {
    echo display_cart($_SESSION['shopcart'.$blog_id],'true', get_option('eshop_checkout'),'widget');
    }
    }

    but still nothing is displayed with that code.

    This version still works, though of course it displays the cart at all times, not just when it has something in it, which is not the desired behaviour.

    // eShop Cart
    function limelight_eshopcart()
    {
    echo display_cart($_SESSION['shopcart'.$blog_id],'true', get_option('eshop_checkout'));
    }
Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘[Plugin: eShop] Display shopping cart in sidebar WITHOUT using widgets’ is closed to new replies.