WordPress.org

Ready to get started?Download WordPress

Forums

User Meta Manager
[resolved] Conflict with Woocommerce (3 posts)

  1. ajira86
    Member
    Posted 11 months ago #

    Hello,

    I use the Woocommerce plugin and in parallel your User Meta Manager plugin. All was working perfectly but I noticed something :

    When user finish an order with Woocommerce, all custom metadata entered by user who order disapear. And this even if I remove any edit form from frontend.

    Can you help me to solve it?

    http://wordpress.org/plugins/user-meta-manager/

  2. ajira86
    Member
    Posted 11 months ago #

    If found a way where function umm_update_profile_fields rewrite metadata value even if no form called.

    I add condition to check if umm_nonce exists before rewriting data like this :

    function umm_update_profile_fields(){
        global $current_user;
        $saved_profile_fields = (!umm_get_option('profile_fields')) ? array() : umm_get_option('profile_fields');
        $the_user = ((isset($_REQUEST['user_id']) && !empty($_REQUEST['user_id'])) && current_user_can('add_users')) ? $_REQUEST['user_id'] : $current_user->ID;
    
        if(isset($_REQUEST['umm_nonce'])) {
    		foreach($saved_profile_fields as $field_name => $field_settings):
    			$field_value = (isset($_REQUEST[$field_name])) ? addslashes(htmlspecialchars(trim($_REQUEST[$field_name]))) : '';
    			update_user_meta($the_user, $field_name, $field_value);
    		endforeach;
        }
    }

    Woocommerce call this function (indirectly) for its metadata update (billing & shipping informations) at end of checkout.

    Can someone check if this fix is relevant ?

  3. President McCheese
    Member
    Plugin Author

    Posted 11 months ago #

    Hi, This is fixed in version 3.0.1. Thanks!

Reply

You must log in to post.

About this Plugin

About this Topic