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

  1. ajira86
    Posted 3 years ago #


    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?


  2. ajira86
    Posted 3 years 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);

    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
    Plugin Author

    Posted 3 years ago #

    Hi, This is fixed in version 3.0.1. Thanks!

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • User Meta Manager
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic