multiple product with unique input name for checkout using authorize.net

  • Profile Image
    themenpen
    Asked on February 07, 2012 at 10:57 PM

    I am trying to create multiple items for checking out using the authorize.net gateway. I want to combine some items that have check boxes with some other items that would be a radio button selection. to make a radio button and a checkbox independent of eachother requires a unique input name. If I change the input name my form will not process the transaction to authorize.net however it will live calculate properly but I get an error upon submission. any ideas how to use both checkboxes and radio buttons together for a "shopping cart" setup; 

  • Profile Image
    NeilVicente
    Answered on February 08, 2012 at 02:12 AM

    It is not possible to have checkboxes and radio buttons in a single payment tool. Once you have provided an option for a product, all other products will use checkboxes.

    I believe your goal is to have the shipping options use a radio button instead of a checkbox. Is that correct?

    I'll try to work on a JavaScript solution for your problem - to make the checkboxes for shipping options behave like radio buttons so that only one option can be selected at once.

    I'll get back to you when I find a solution.

  • Profile Image
    themenpen
    Answered on February 08, 2012 at 08:55 AM

    thanks, that's exactly the application, I want to select several products but then select only one shipping option using a radio button.

  • Profile Image
    NeilVicente
    Answered on February 09, 2012 at 09:20 AM

    This is what I came up with:

    1.  Copy this script and paste it anywhere in your site's source code, preferrably between the body tags.
    2.  In your form's source code, find the input tags for the shipping options (there are a total of 5).

    3.  Insert onclick="clearOther(this)" right before the closing for all five checkbox options. For example:

    <input class="form-checkbox" type="checkbox" id="input_16_1023" name="q16_selectColor16[][id]" value="1023" onclick="clearOther(this)" />

    4.  Save your webpage

    Click here to see this solution in action.

    Please do test this solution first (using a test credit card, if not a real one) before making it live. We need to make sure that the total price are reflected correctly in the transaction page.

    Let me know how it goes from here on out. Thanks!

  • Profile Image
    themenpen
    Answered on February 09, 2012 at 09:49 PM

    Perfect! Thanks a ton!