Shopp & Authorize.net JavaScript validation workaround

Shopp 1.1.5 was recently released with a lovely bug that makes the Authorize.net payment module fail. This particular bug effects JavaScript validation of the credit card field. Since the JavaScript source is compressed, it’s very difficult to debug, so I’m not exactly sure why it’s failing. Here is a quick workaround to get you back in action.

I’m going to assume you’re using theme templates, if not, do that and then come back. First, open “checkout.php” and look for this:

<?php if (shopp('checkout','card-required')): ?>

Just above that, add a couple of new lines and then paste in the following:

<!-- a hack to make credit card validation work? -->
<input type="hidden" name="paymethod" value="credit-card" />

It should look something like this now:

<!-- a hack to make credit card validation work? -->
<input type="hidden" name="paymethod" value="credit-card" />

<?php if (shopp('checkout','card-required')): ?>

Start a fresh session on your site and see test it out.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Notify me of followup comments via e-mail. You can also subscribe without commenting.