• Resolved rebeccamantel

    (@rebeccamantel)


    I would like to add like in checkout a checkbox in edit profile to subscribe or unsuscribe to newsletter it should be something like the following but not for checkout but for edit profile

    $user_id = get_current_user_id();
    $user_email = get_user_meta( $user_id, ‘billing_email’, true );
    global $wpdb;

    // look up for email in wp_3_wysija_user
    $added = $wpdb->query(“SELECT * FROM wp_3_wysija_user WHERE email LIKE ‘$dodany_email’ AND status = ‘1’ ;”);
    $il=count($added);

    if(($added!=1)){
    echo ‘<div id=”mailpoet_checkout_field”>’;
    //echo apply_filters(‘mailpoet_woocommerce_subscribe_checkout_title’, ‘<h3>’.__(‘Subscribe to Newsletter’, ‘mailpoet_woocommerce’).'</h3>’);
    woocommerce_form_field(‘mailpoet_checkout_subscribe’, array(
    ‘type’ => ‘checkbox’,
    ‘class’ => array(‘mailpoet-checkout-class form-row-wide’),
    ‘label’ => htmlspecialchars(stripslashes($checkout_label)),
    ), $checkout->get_value(‘mailpoet_checkout_subscribe’));
    echo ‘</div>’;
    }

    this code is for the checkout how can i change the values for the edit page thank you

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘checkbox in user edit profile’ is closed to new replies.