7 / 7
Apr 2015

I'm changing hosts, exported then imported wordpress content, and now my cart isn't acting right. It's a flat page and not a popup cart. Here's the button code:

<a onclick="javascript:return EJEJC_lc(this);" href="https://www.e-junkie.com/ecom/gb.php?c=cart&i=920791&cl=157086&ejc=2" target="ejejc"><img class="aligncenter" alt="Add To Cart - Button Red" src="http://www.mysite/wp-content/uploads/2013/04/addtocart-red1.png" width="164" height="73" /></a>



Seems like from running into this once before, it's something about javascript? But where/what? Thanks!

  • created

    Apr '15
  • last reply

    Apr '15
  • 6

    replies

  • 1.6k

    views

  • 3

    users

  • 8

    links

If the overlay-style cart cannot work for any reason in a given page, the Cart buttons on that page should still work in "fallback" mode by displaying the cart in a popup window/tab, so that's what you're probably seeing if your View Cart code is missing or mangled somehow.



Make sure to copy your View Cart code in full directly from Seller Admin and paste at least one copy of that code into every page that has any number of Cart buttons. This code will add some javascript to your page that manages the overlay-style cart display "inside" your page. Your View Cart code is unique to you but the same for all your products, so it doesn't matter which product's button codes screen you copy it from.



We'd recommend using the Raw HTML plugin for WP to help ensure WP doesn't mangle your button code after you paste it in; you should be able to search for and install this plugin from your WP admin panel. See this help page for further tips, including a section on WP in particular:

1http://www.e-junkie.com/ej/help.site-blog.htm1

Oh, I bet I don't have the view cart code on this page. Thanks so much; I'll check it out.

Well...that didn't work. I've tested lots of things and used your help page link. I've finally had a breakthrough!



The code for the default small grey button works and gives the overlay cart:

<a href="https://www.e-junkie.com/ecom/gb.php?c=cart&i=920791&cl=157086&ejc=2" target="ejejc" class="ec_ejc_thkbx" onClick="javascript:return EJEJC_lc(this);"><img src="http://www.e-junkie.com/ej/ejadd_to_cart.gif" border="0" alt="Add to Cart"/></a>



But the code for the big red button doesn't work and gives the cart in a new tab:

<a href="https://www.e-junkie.com/ecom/gb.php?c=cart&i=920791&cl=157086&ejc=2" target="ejejc"><img class="aligncenter" src="http://www.frxbuzz.com/wp-content/uploads/2013/04/addtocart-red1.png" alt="Add To Cart - Button Red" width="164" height="73" /></a>



Excited to see one work, but is there way to fix this? I'm on a hosted site and can't use the plugin. Thanks a million.

I got it! I added this to the red button code:

class="ec_ejc_thkbx" onClick="javascript:return EJEJC_lc(this);"



Woo hoo!!!!



So the code that works is this:

<a href="https://www.e-junkie.com/ecom/gb.php?c=cart&i=920791&cl=157086&ejc=2" target="ejejc" class="ec_ejc_thkbx" onClick="javascript:return EJEJC_lc(this);"><img class="aligncenter" src="http://www.sitename.com/wp-content/uploads/2013/04/addtocart-red1.png" alt="Add To Cart - Button Red" width="164" height="73" /></a>



And the View Cart code is on the page too; as you suggested earlier it's probably necessary for this to work.



Thank you!

You found the right solution! The specific part that was missing which you've added back in was this:



onClick="javascript:return EJEJC_lc(this);





With that in place inside the button's <a> tag and the View Cart code on the page as well you're all set. Sorry you had to work on that one, the onclick attribute was mentioned in your original code back in the first post so we didn't say anything about it.

Yeah, I've been testing and switching buttons out; guessing that first one didn't work because the view cart code wasn't there. Anyway, valuable lesson and I'll file this away for future reference! Thank you!