Jigoshop minicart

jigoshop-minicart

Jan 31, 2012 Tips & Trick 9 7608 Views

Recently I was working on an e-Commerce WordPress theme and I needed to add a minicart on top. The e-Commerce plugin I used for that theme was jigoshop and they provide only a widget cart and a full page, so I came with a solution. The code is bellow:

<?php echo sprintf(_n('%d item - ', '%d items - ', jigoshop_cart::$cart_contents_count, 'avtdr'), jigoshop_cart::$cart_contents_count); echo jigoshop_cart::get_cart_total(); ?> <a href="<?php echo sprintf(jigoshop_cart::get_checkout_url()) ?>" class="button" ><?php _e('Checkout', 'avtdr') ?></a> <a href="<?php echo sprintf(jigoshop_cart::get_cart_url()) ?>" class="button" ><?php _e(' View Cart ', 'avtdr') ?>
Share this on: Facebook // Twitter // Delicious // Digg // Reddit // Stumbleupon

9 Comments for "Jigoshop minicart"


Dany

Posted on Thursday 19th April, 2012, 5:46am

Reply

Hello,
I’m french,
Where to copy the code ?
Create new widget ??

Thank you

    Alex Gurghis

    Posted on Thursday 19th April, 2012, 2:03pm

    Reply

    Add it in the place you want to have the minicart. In my case it’s in header.php

Devin Halladay

Posted on Monday 30th July, 2012, 11:49pm

Reply

Sweet, thanks!

Daniel Pomlett

Posted on Wednesday 29th August, 2012, 4:00pm

Reply

Legend. Exactly what I was looking for. Thanks.

Alba

Posted on Thursday 13th September, 2012, 5:27pm

Reply

Thanks!!!

I’ve done a widget, adding this in functions.php:

if ( function_exists(‘wp_register_sidebar_widget’) )
{
wp_register_sidebar_widget(__(‘id’), “Name of the widget”, ‘name_of_the_method’);
}

And then, the method:

function name_of_the_method() {
echo sprintf(_n(‘%d item – ‘, ‘%d items – ‘, jigoshop_cart::$cart_contents_count, ‘avtdr’), jigoshop_cart::$cart_contents_count);
echo jigoshop_cart::get_cart_total();
?>
<a href="” class=”button” >
<a href="” class=”button” >
<?php
}

Samrat Khan

Posted on Sunday 25th November, 2012, 5:44pm

Reply

Good… very good

Jin

Posted on Wednesday 30th January, 2013, 1:33am

Reply

Can you give me a descriptive explanation on how to do this?

Jesse

Posted on Friday 15th February, 2013, 11:52am

Reply

Awesome man, thanks!

Is exactly what I needed to put the # of items in cart on page. Much appreciated

Martin

Posted on Friday 5th April, 2013, 1:48pm

Reply

Alex, thank you. But i have some issues.

I use WordPress with Pagelines and Jigoshop. I would like to insert your mini cart php in a widget. So I installed the »Executable PHP widget« and inserted there:

| CHECKOUT | VIEW CART

The widget I draged in the Pagelines Universal Sidebar.

The problem is that the counter just counts exactly when you add the same product, but when you add another product the cart_total is not correct, it shows to much money. The items are OK.

Any idea?

kraftpapermag.com
user: kraft
pw: papermag

Thank you

Martin

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

2013 © Alex Gurghis | All Rights Reserved
Top
background