Share via E-Mail
Share on Google Buzz
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



E-junkieGuru
E-Junkie Crew
Posts: 3734


We've got a slight improvement in the recommended syntax, incorporating Jezd's contribution and our cart's jQuery support:

function EJEJC_config() {
EJEJC_POSTCALL=true;
}
function EJEJC_shown() {
items=EJEJC_cartsize();
if (items== null) {items = 0};
jQuery("#itemsInCart").attr("innerHTML",
items+" Items<BR/>$"+EJEJC_cartamt().toFixed(2)+" total");
}

Then just place this in your page wherever you want the minicart to appear:

<div id="itemsInCart"></div>

Now, if anyone's worked out how to get that minicart DIV to display on page load, rather than only appearing after the main cart has been viewed, feel free to share the approach you devised here.


#
POSTED ON: July 26, 2011 @ 14:11 GMT -7
MODIFIED ON: August 8, 2011 @ 18:24 GMT -7




bunkbedking
member
Posts: 139


Hi

I have this code

<script type="text/javascript">
<!--
function EJEJC_lc(th) { return false;}
function EJEJC_config() {
EJEJC_POSTCALL=true;
EJEJC_OPACITY = 30;
EJEJC_HEIGHT = 500;
EJEJC_WIDTH = 750;
EJEJC_BRDRCOLOR = "#00f";
EJEJC_CDAYS = 61;
}
function EJEJC_shown() {
jQuery("#state1").attr("innerHTML", "Enter <b>SHIPPING ZIP CODE<\/b>");
}
// -->
</script>

not sure how to integrate the mini card code ?


#
POSTED ON: August 6, 2011 @ 15:11 GMT -7




E-junkieGuru
E-Junkie Crew
Posts: 3734


The code you have, plus the minicart code, would look like this when put together:

<script type="text/javascript">
<!--
function EJEJC_lc(th) { return false;}
function EJEJC_config() {
EJEJC_POSTCALL=true;
EJEJC_OPACITY = 30;
EJEJC_HEIGHT = 500;
EJEJC_WIDTH = 750;
EJEJC_BRDRCOLOR = "#00f";
EJEJC_CDAYS = 61;
}
function EJEJC_shown() {
jQuery("#state1").attr("innerHTML", "Enter <b>SHIPPING ZIP CODE<\/b>");
if (items== null) {items = 0};
jQuery("#itemsInCart").attr("innerHTML",
items+" Items<BR/>$"+EJEJC_cartamt().toFixed(2)+" total");
}
// -->
</script>

Then just place this in your page wherever you want the minicart to appear:

<div id="itemsInCart"></div>


#
POSTED ON: August 8, 2011 @ 13:46 GMT -7




bunkbedking
member
Posts: 139


Struggling to make it work

see

http://bunkbedking.com/more-bunk-beds-rustic

- no mini cart - but code is as above

What am I doing wrong?

also, do you have a link to a web site where it is working so I can see it in action?


#
POSTED ON: August 8, 2011 @ 14:52 GMT -7




E-junkieGuru
E-Junkie Crew
Posts: 3734


Whoops, my bad; in my July 26 post providing the updated minicart syntax (now fixed), somehow I omitted this line:

items=EJEJC_cartsize();

Thus, your version of the code should look like this:

<script type="text/javascript">
<!--
function EJEJC_lc(th) { return false;}
function EJEJC_config() {
EJEJC_POSTCALL=true;
EJEJC_OPACITY = 30;
EJEJC_HEIGHT = 500;
EJEJC_WIDTH = 750;
EJEJC_BRDRCOLOR = "#00f";
EJEJC_CDAYS = 61;
}
function EJEJC_shown() {
jQuery("#state1").attr("innerHTML", "Enter <b>SHIPPING ZIP CODE</b>");
items=EJEJC_cartsize();
if (items== null) {items = 0};
jQuery("#itemsInCart").attr("innerHTML",
items+" Items<BR/>$"+EJEJC_cartamt().toFixed(2)+" total");
}
// -->
</script>


#
POSTED ON: August 8, 2011 @ 18:25 GMT -7




bunkbedking
member
Posts: 139


working now - but as soon as you navigate away from the page, it disappears


#
POSTED ON: August 11, 2011 @ 22:00 GMT -7




E-junkieGuru
E-Junkie Crew
Posts: 3734


Yes, as we have explained previously here, the minicart does not appear in a page until the main cart has already been viewed once from that page. You or a developer you'd hire may be able to write some custom javascript to solve that problem. We only present this minicart code as-is, as an unofficial, unsupported hack that our Lead Developer whipped up as a fun side project many years ago but hasn't touched since.


#
POSTED ON: August 15, 2011 @ 19:52 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
Google Checkout Certified Integration
Slam the Online Scam