7 / 7
Dec 2011

Hello. Sorry for my english :)

I'm trying to add to shopping cart several products. The code that I place the following works only with Firefox 8. In IE 8-9 and Chrome 16 in the cart is added only last item from the array. In what may be the problem?





<html>

<head>

<script src='http://www.e-junkie.com/ecom/box.js' type='text/javascript'></script>

<title>check</title>

</head>

<body>



<a href="javascript:EJEJC_multiAdd(Array('https://www.e-junkie.com/ecom/gb.php?c=cart&i=12345&cl=196248&ejc=2',

'https://www.e-junkie.com/ecom/gb.php?c=cart&i=12345&cl=196248&ejc=2','https://www.e-junkie.com/ecom/gb.php?c=cart&i=1036429&cl=196248&ejc=2'));"><img src="http://www.e-junkie.com/ej/ejadd_to_cart.gif" border="0" alt="Add to Cart"/></a>

</body>

</html>

  • created

    Dec '11
  • last reply

    Dec '11
  • 6

    replies

  • 1.3k

    views

  • 2

    users

  • 7

    links

Hm, I tested the code you provided and found that it added two items to a cart, because the first two item URLs in your code are identical. BTW, to make the URLs simpler to manage and compare, you can put each item's URL on a separate line, like so:



<a href="javascript:EJEJC_multiAdd(Array(

'https://www.e-junkie.com/ecom/gb.php?c=cart&i=12345&cl=196248&ejc=2',

'https://www.e-junkie.com/ecom/gb.php?c=cart&i=12345&cl=196248&ejc=2',

'https://www.e-junkie.com/ecom/gb.php?c=cart&i=1036429&cl=196248&ejc=2'

));"><img src="http://www.e-junkie.com/ej/ejadd_to_cart.gif" border="0" alt="Add to Cart"/></a>

Are you tested this script in different browsers?

In my case it only works in firefox.

We've tested it in every browser, so it should work. Note that EJEJC_multiAdd() is a function of our box.js cart script, so this will only work in pages where you have at least included the SCRIPT portion of our View Cart code:



<script language="javascript" type="text/javascript">

<!--

function EJEJC_lc(th) { return false; }

// -->

</script>

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



If that doesn't address the problem, please provide the URL of a page where multiAdd isn't working, so we could have a look there for ourselves to see what the problem might be in that particular case.

I posted the file on the hosting and it worked.

Previously, I ran the page from the local machine, directly from a hard drive as simple html page. In this case, the script did not work correctly. The reason for this behavior is still not clear. Do you have any suggestions about why the script works properly only on hosting?



Correctly worked script on a hosting:



http://danilalomaster.ru.swteh.ru/j.html

One more question.

Can I bypass the intermediate window, which displays information about selected products, and go directly to purchase through paypal?

E-junkie cart needs to be tested online. For the cart in your page to work correctly, the page where you paste your E-junkie cart button codes must be:



- Uploaded on a live Web site (a "local" copy of a page saved to your computer's hard drive won't work);

- Have a domain name in its URL (a URL using just a numeric IP address won't work);

- Tested in a regular Web browser (the "preview" mode built into many Web-design programs probably won't work);

- Accessed from a computer with a live Internet connection (loading the page and then going offline won't work).



Using Buy Now buttons (rather than Cart buttons) would bypass the cart and take the buyer directly to instant checkout for just one item at a time; however, these buttons cannot use features which depend on the cart to function. Please see this help page for details:

http://www.e-junkie.com/ej/help.buttons.buy-now.htm