Share via E-Mail
Share on Twitter
Share on Facebook
E-junkie Blog
E-junkie FaceBook Page
E-junkie @ Twitter

E-junkie Ecommerce Forums » E-junkie Discussions

Tag Cloud for this topic:

minicart



frouboy
member
Posts: 8


is ejunkie considering implementing a mini cart so that my customers can see how many items (and the value of) are in the cart without having to open the cart.


#
POSTED ON: January 15, 2009 @ 14:08 GMT -7




E-junkieGuru
E-Junkie Crew
Posts: 4948


There is an unofficial hack you can use to show cart item quantity and total in your page.

On every page where you want this displayed, add this to your View Cart code, just before the "// -->" line:

function EJEJC_config() {
EJEJC_POSTCALL=true;
}
function EJEJC_shown() {
document.getElementById('itemsInCart').innerHTML=EJEJC_cartsize()+" Items : Total $"+EJEJC_cartamt();
}

If you already have EJEJC_config or EJEJC_shown, just add the extra line shown above before the final "}" -- apparently that line got linewrap-broken here, but it should be one long, unbroken line from "document." to "cartamt();". You can of course customize the part that says " Items : Total $" with whatever text or HTML you wish (but avoid using any "double quote" characters -- you can use 'single quotes' instead).

Then in your page body wherever you want the cart items/total displayed, just insert this:

<div id='itemsInCart'></div>


#
POSTED ON: January 15, 2009 @ 15:12 GMT -7
MODIFIED ON: March 12, 2009 @ 14:01 GMT -7




speck2000
member
Posts: 1


Tyson,
Is it possible to get <div id='itemsInCart'></div> to show without having to click on an e-junkie related button? Right now on my website it only shows cart information on website after I click an e-junkie related button and then close the lightbox.

Thanks,
Josh


#
POSTED ON: March 17, 2009 @ 07:53 GMT -7




E-junkieGuru
E-Junkie Crew
Posts: 4948


I did say it was an unofficial hack. :^)

I don't know of any way to display the itemsInCart div contents automatically before the cart is rendered, but I might guess there could be some way to do that with JavaScript?

I'll assign this to the attention of our Lead Developer, in case he has a solution to offer.


#
POSTED ON: March 17, 2009 @ 19:25 GMT -7




Tim
member
Posts: 1


Thank you for the Hack, but for some reason it is not displaying the total right. In my shopping cart I have a total of $104.00 and 51 items but in the div it displays the correct amount of items but the total is $0. What are your thoughts on this?

Thanks,


#
POSTED ON: April 6, 2009 @ 07:59 GMT -7




nobo
member
Posts: 5


I have the same issue. The # of items is fine but no total :(


#
POSTED ON: May 18, 2009 @ 14:17 GMT -7




nobo
member
Posts: 5


any solution? anybody?


#
POSTED ON: May 31, 2009 @ 13:14 GMT -7




E-junkieGuru
E-Junkie Crew
Posts: 4948


We have been unable to reproduce the $0 problem in testing. If someone could provide the URL of a page where the $0 display is happening, we can examine that particular case. Note that the minicart status display can only show a full Item Total before shipping/tax/discounts have been factored in.


#
POSTED ON: June 24, 2009 @ 14:22 GMT -7
MODIFIED ON: June 24, 2009 @ 14:24 GMT -7




nobo
member
Posts: 5


Hi Tyson
I'm using a fat.free.cart and it's working fine itself. When adding your hack minicart shows always $0
thank you
nobo


#
POSTED ON: June 24, 2009 @ 14:43 GMT -7




E-junkieGuru
E-Junkie Crew
Posts: 4948


Note this will only work with an E-junkie Cart; I don't think it should work with a FatFreeCart.com cart. Although the two carts appear and behave similarly from a buyer's viewpoint, they are actually completely different and unrelated in how they operate under the skin.


#
POSTED ON: June 24, 2009 @ 15:03 GMT -7




nobo
member
Posts: 5


exactly what I was thinking. thanks for clarifying that


#
POSTED ON: June 24, 2009 @ 15:13 GMT -7




blacklabel
member
Posts: 6


For some reason it does not show the 0 on the price. Say the total is 17.90 is show 17.9. Here is the link to my site www.blacklabelprinting.com

Any help would be greatly appreciated.


#
POSTED ON: January 19, 2010 @ 23:21 GMT -7




nobo
member
Posts: 5


blacklabel what cart are you using? E-junkie Cart or Fat Free Cart?


#
POSTED ON: January 20, 2010 @ 15:26 GMT -7




Jezd
member
Posts: 5


Hi, all working fine here but we need a html 'onload refresh' type thing for the cart to work pre rendering - did you ask your Lead Devloper?

I am sure there must be a method for doing this.

Cheers

Jez

E-junkieGuruI did say it was an unofficial hack. :^)

I don't know of any way to display the itemsInCart div contents automatically before the cart is rendered, but I might guess there could be some way to do that with JavaScript?

I'll assign this to the attention of our Lead Developer, in case he has a solution to offer.


#
POSTED ON: December 8, 2010 @ 13:56 GMT -7




E-junkieGuru
E-Junkie Crew
Posts: 4948


If you're handy with JavaScript, our Lead Developer says you can use the functions EJEJC_cartsize(); and EJEJC_cartamt(); at will, to get the number of items and the cart total respectively. The amount currently does not reflect discounts but that'll be fixed shortly.


#
POSTED ON: December 9, 2010 @ 19:49 GMT -7




Jezd
member
Posts: 5


Slight update to help formatting :-

function EJEJC_config() { EJEJC_POSTCALL=true; }
function EJEJC_shown() {
items=EJEJC_cartsize();
if (items== null) {items = 0};
document.getElementById('itemsInCart').innerHTML=items+" Items <BR/>£"+EJEJC_cartamt().toFixed(2)+" total";
}

This gets rid of null value and helps currency format, results of an emply cart :-

0 Items
£0.00 total

Still struggling to get html values on initial page load.

Jez


#
POSTED ON: December 28, 2010 @ 17:58 GMT -7
MODIFIED ON: December 28, 2010 @ 17:58 GMT -7




Jezd
member
Posts: 5


E-junkieGuruIf you're handy with JavaScript, our Lead Developer says you can use the functions EJEJC_cartsize(); and EJEJC_cartamt(); at will, to get the number of items and the cart total respectively. The amount currently does not reflect discounts but that'll be fixed shortly.


can you check with you DEV guy as those functions quoted are returning errors and only available after EJEJC_shown has been run - has he got example code?

thanks

Jez


#
POSTED ON: February 18, 2011 @ 20:26 GMT -7
MODIFIED ON: February 18, 2011 @ 20:27 GMT -7




E-junkieGuru
E-Junkie Crew
Posts: 4948


Note those functions would not be used in cart customization code, although they do depend on having our cart's box.js script loaded into your page (via the <script> portion of our View Cart code); you would need to write your own custom javascript to call those functions and output cart items/total onload within your page.


#
POSTED ON: February 20, 2011 @ 16:24 GMT -7




robleger
member
Posts: 17


yarg. so close... only the last bit is missing!
how to automatically initialize the mini cart on page load...
too bad my javascript knowledge ends exactly there :(


#
POSTED ON: May 4, 2011 @ 13:50 GMT -7




E-junkieGuru
E-Junkie Crew
Posts: 4948


If you'd like to hire a programmer to help you set that up, we can recommend the competent, E-junkie-experienced developers listed here:
http://www.e-junkie.com/ej/developer-directory.htm


#
POSTED ON: May 4, 2011 @ 15:05 GMT -7


« PREVIOUS  1  2  NEXT »

You must be logged in to make a post. Please click here to login.

30 Day Money Back Guarantee PayPal Certified Integration 2Checkout Shopping Cart Sell with ClickBank Authorize.Net shipping cart
Slam the Online Scam