E-Junkie Forum http://www.e-junkie.com/bb/ E-Junkie Forum RSS en-us Copyright 2013, 19.5 Degrees. All rights reserved. webmaster@e-junkie.com webmaster@e-junkie.com Mon, 15 Sep 2008 19:48:28 GMT Wed, 19 Jun 2013 08:11:36 GMT 681 E-JUNKIE 5 E-Junkie Forum http://www.e-junkie.com/bb/ http://www.e-junkie.com/ej/logo.gif 290 104 Post #3 http://www.e-junkie.com/bb/topic/2860/pg/0#post7714 http://www.e-junkie.com/bb/topic/2860/pg/0#post7714 Mon, 15 Sep 2008 19:48:28 GMT
<script language="javascript" type="text/javascript">
<!--
function EJEJC_lc(th) { return false; }
// -->
</script>
<script type="text/javascript" src="https://www.e-junkie.com/ecom/box.js"></script>


...or here's the same part from the View Cart code we issue currently:


<script language="javascript" type="text/javascript">
<!--
function EJEJC_lc(th) { return false; }
document.write("<scr"+"ipt src='" + document.location.protocol + "//www.e-junkie.com/ecom/box.js' type='text/javascript'></scr"+"ipt>");
// -->
</script>


You can use either version of code; the only difference is that the newer version automatically determines if your page is using HTTP or HTTPS and will load the box.js accordingly, so that your HTTP pages (the vast majority of cases) will load box.js into browser cache and read all future references to box.js from that cached copy (= improved page-load performance), whereas if your pages happen to use HTTPS, that would necessarily redownload a fresh copy of box.js for every reference (= slower load performance).

The older version of our code just used the latter (HTTPS) behavior in all cases, so just in case the code was placed in a secure page it wouldn't trigger any secure-encryption warnings in the buyer's browser, but that also impairs page-load performance unnecessarily in the vast majority of HTTP pages (if you don't know whether your pages are HTTP or HTTPS, then they are almost certainly HTTP, as HTTPS is kinda a pain to set up). Note that none of this has anything to do with security or encryption of the buyer's private/payment data, as that is always secure-encrypted during Checkout automatically using HTTPS and regardless of anything else.

In either case, if you are adding lines for config() and shown() functions to apply cart customization, those lines would go just before the "// -->" lines in the examples above.]]>
E-junkie Discussions; E-junkieGuru
Post #2 http://www.e-junkie.com/bb/topic/2860/pg/0#post7714 http://www.e-junkie.com/bb/topic/2860/pg/0#post7714 Sun, 14 Sep 2008 23:06:29 GMT
SNIPPET 1 is part of code we used to provide. Anyway, you only need it once per page.
SNIPPET 2 is what we provide currently and you only need it once per page.
SNIPPET 3 is not something we provide but if you use config() and shown() functions, you only need them once.

B
The JavaScript part of the VIEW CART code (that's what these snippets are) can go anywhere in the page.

C
box.js line loads the code which makes our inline cart works. EJEJC_lc function is a blank function which ensures that buyer does not prematurely open a pop-up cart by clicking on the button before page is loaded.

config and shown function are used for cart customization. config() function can include various lines of code to modify cart's appearance and behavior. It is called BEFORE the cart is rendered. It can also include a line of code to call the shown() function AFTER the cart is rendered and shown() function can include any code you want to change cart's appearance or anything pretty much.

For more information about this, see cart customization section in the help page.]]>
E-junkie Discussions; E-junkieChef
Post #1 http://www.e-junkie.com/bb/topic/2860/pg/0#post7714 http://www.e-junkie.com/bb/topic/2860/pg/0#post7714 Sun, 14 Sep 2008 19:28:26 GMT
Can you answer each of these questions for each code snippet below in with this context in mind:

I put multiple Add To Cart and multiple Show Cart buttons on each page of my site next to each item I sell.

A - How many times do we need to put it on a page?
B - Where do we put it on the page in relation to the other ejunkie code?
C - What is its purpose?

SNIPPET 1:
<script type="text/javascript" src="https://www.e-junkie.com/ecom/box.js"></script>

SNIPPET 2:
function EJEJC_lc(th) { return false; }
document.write("<scr"+"ipt src='" + document.location.protocol + "//www.e-junkie.com/ecom/box.js' type='text/javascript'></scr"+"ipt>");

SNIPPET 3:
function EJEJC_lc(th)
function EJEJC_config()
function EJEJC_shown()


Also, I dont have the code SNIPPET 2 on my pages but everything seems to work? What am I missing by not having this?]]>
E-junkie Discussions; lemonbar