1 / 13
Dec 2014

My Wordpress site keeps messing with my button code, for instance it converts it from:-



<a href="https://www.e-junkie.com/ecom/gb.php?c=cart&i=1243574&cl=128058&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>



To



<a class="ec_ejc_thkbx" href="https://www.e-junkie.com/ecom/gb.php?c=cart&i=1243574&cl=128058&ejc=2" target="ejejc"><img src="http://www.e-junkie.com/ej/ejadd_to_cart.gif" alt="Add to Cart" border="0" /></a>



Which screws it up, makes it open in another page, not remember previous items etc. Could that be happening to you too?



I don't have the foggiest idea why it's doing this though.

Thanks. My code does not change when I paste it. That leads me to believe the issue is somewhere else. But I have not a clue. May need to hire someone. The in-page pop up tend to convert better....

Paste the code, flick over to the visual editor, then flick back to HTML, are you certain it is the same?

Weird. Yes, Wordpress is somehow commenting out some of the code:



<!--

function EJEJC_lc(th) { return false; }

// -->



I do not know what the solution is.

I do not either. As a workaround do all your editing in HTML view and never switch to visual. I tried a plugin to disable auto formatting but that didn't solve the issue for me either. If you do find anything please let me know.

Ryan,

The button code in your page looks correct, and works correctly when I copy and paste it from your page into a blank test page, so something else must be going on. Might your page be loading a script that opens a new window/tab for all external links?



Bucko,

Looks like your WP editor may be stripping away the onClick= attribute from our standard button code after you paste it in. We recommend using the Raw HTML plugin for WP to prevent that sort of thing; you should be able to search for and install this plugin from your WP Admin panel, or you can download it from here to install manually if you prefer:

http://wordpress.org/extend/plugins/raw-html/

Actually that code is fine. But Wordpress for whatever reason is having Javascript errors. Maybe a problem with a plugin or my theme.

E-junkieGuru

Bucko,

Looks like your WP editor may be stripping away the onClick= attribute from our standard button code after you paste it in. We recommend using the Raw HTML plugin for WP to prevent that sort of thing; you should be able to search for and install this plugin from your WP Admin panel, or you can download it from here to install manually if you prefer:

http://wordpress.org/extend/plugins/raw-html/





Tried it, didn't work, html is still getting garbled every time I switch from visual editor to HTML.

Ryan,

Could be a conflict between our box.js cart script and some other JS your page is loading. Whenever the overlay-style cart can't be displayed for any reason, the buttons work in "fallback" mode by opening a popup window/tab to display the cart, so that seems to be what's happening for you. Sometimes conflicts can be resolved by simply rearranging the order that scripts load into your page; otherwise, you can remove the other scripts one by one until you find which one resolves the problem when removed. Note that the SCRIPT portion of your View Cart code can be moved anywhere you wish in the page, even up into the page HEAD; just take care to keep that block of code together in its original order -- i.e., with the box.js line after the function EJEJC_lc(th) { return false; } part.



Bucko,

Have you tried saving directly from HTML view after you paste the code, without switching back to the visual editor first? The tips on this help page may help you get the code pasted in exactly where you want it:

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

Thanks Tyson. The problem is clearly my theme or a plugin, not E-Junkie. The code and the entire page works on my other blogs but not that one.



I got a developer working on it. Will report back.



Ryan

E-junkieGuruRyan,

Bucko,

Have you tried saving directly from HTML view after you paste the code, without switching back to the visual editor first? The tips on this help page may help you get the code pasted in exactly where you want it:

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





Yes, that works as a workaround, it's not ideal but it'll do. Don't get me wrong here I'm not blaming the Ejunkie guys this is clearly Wordpress screwing things up :)



I notice there's a pro version of that plugin you linked to that supposedly cures the problem completely (I'm not sure what the free, non-pro version is actually supposed to do) but it's 15 dollars and given that I tried a bunch of other plugins that were supposed to fix this problem and didn't I don't feel keen on shelling out to try it.

It turns out there was a very simple solution. I have a VERY old Google Analytics plugin and somehow the GA code was messing with the E-Junkie code. When I disabled the GA Plugins the E-Junkie cart opened up as a pop up as usual.



Thanks!



Ryan