• Hey, I’m passing some php variables to the buy button like this:
    echo "[wp_cart_button name='" . $act_t . " - " . $ticket['ticket_title'] . "' price='" . $ticket['ticket_cost'] . "']";

    Which displays on the page correctly and the code looks right.

    All the buttons generated with this php code are causing this same error, (Error! The price field may have been tampered. Security check failed.)
    but I have no other way to build these buy buttons.

Viewing 3 replies - 1 through 3 (of 3 total)
  • I don’t think the problem is the way you are building the button. The problem is the contents of the name field.

    The cart checks that the price hasn’t been tampered with by comparing the hash_one field with a hash it generates using the price and product_tmp_two (which, as you can see, is the name). Unfortunately, there is a bug that means this fails if the name contains certain characters. I have established that putting the £ sign in the name causes this to fail. In your case, I’m guessing it is the – character.

    Having done some debugging, the problem is to do with html encoding. When the hash is generated, a name field of “£5 donation” becomes “£5 donation”. However, when it is checked, it uses “£5 donation”. The two hashes therefore don’t match.

    Plugin Author mra13

    (@mra13)

    We have worked on expanding the supported symbols in the product name parameter. This should solve the issue you reported. Please upgrade the plugin to the new version when you can.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Error! The price field may have been tampered. Security check failed.’ is closed to new replies.