• Resolved thwbaur

    (@thwbaur)


    Hi all,

    I am trying to add a custom MC4WP sign-up checkbox to the checkout page of my WPSC webshop. Unfortunately it seems that upon purchase no account is added to the MC list.

    Since the WPSC form is a rather complicated one, I suspect this uses an out-of-the-box way of sending the the user e-mail adress. So how does the MC4WP plugin “detect” the e-mail adress in the form? Does it need a label or name tag to recognise the field?

    If necessery I can post the form code but beware, it’s huge…

    Best regards!

    Thomas

    https://www.ads-software.com/plugins/mailchimp-for-wp/

Viewing 2 replies - 1 through 2 (of 2 total)
  • mother.of.code

    (@imazed)

    The Mother of Code

    Hi thwbaur,

    Our plugin detects fields that it should take into account by it’s name field prefix. That means that if you have a field that looks like this:

    <input name="email" />

    You will have to change it to look like this:

    <input name="mc4wp-email" />

    You can find more info about this in our Knowledge Base. Hope that helps!

    Thread Starter thwbaur

    (@thwbaur)

    Hi Ines,

    Thank you very much for your reply. The current e-mail field is quite a complex thing for me, see:

    <?php
                }elseif( $wpsc_checkout->checkout_item->unique_name == 'billingemail'){ ?>
                   <?php $email_markup =
                   "<div class='wpsc_email_address'>
                      <p class='" . wpsc_checkout_form_element_id() . "'>
                         <label class='wpsc_email_address' for='" . wpsc_checkout_form_element_id() . "'>
                         " . __('Enter your email address', 'wpsc') . "
                         </label>
                      <p class='wpsc_email_address_p'>
    
                      " . wpsc_checkout_form_field();
    
                       if(wpsc_the_checkout_item_error() != '')
                          $email_markup .= "<p class='validation-error'>" . wpsc_the_checkout_item_error() . "</p>";
                   $email_markup .= "</div>";

    I am not sure where to put the name=”mc4wp-email”. also, by changing the field name, does the rest of the code still recognise the input?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Adding checkbox to WPSC checkout form’ is closed to new replies.