This topic has 8 replies, 4 voices, and was last updated 9 years by Abe.

  • Author
  • #21486
     omtr
    Participant

    Hi SQ,

    i have a problem with multiple value (checkboxes) matching. In your FAQ it is stated that multiple value checkboxes are calculated in addition, e.g. for interests every matching checkbox is counting with the value defined in the $kleo_config[‘matching_fields’][‘multiple_values’] located in the child theme’s function.php. so far, so good.

    but actually it seems that a multiple checkbox is only counted if _all_ values match.
    let’s say that “Interests” is counted with a value of 10, then it does not matter if one, two or all checkboxes do not match. if only one single checkbox is different, the score is reduced by 20 (not 10), two or three mismatching checkboxes have the same effect. can you tell me where the coded for multiple value calculation is located so i can understand it and maybe change it for my purposes?

    p.s. there seems to be a bug in your multiple select dropdown fields. obviously only one value can be selected.

    #21512
     Catalin
    Moderator

    Hello,

    First, please update the theme to the latest version.

    Then take a look at

    ../wp-content\themes\sweetdate\custom_buddypress\bp-functions.php

    and there you will find:

    COPY CODE
    
    function compatibility_score() {}
    

    You can copy this function to your functions.php file from your child theme and modify it as you need.

    Let me know if this works for you,

    Thank you,
    Catalin

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #21581
     omtr
    Participant

    Hi Catalin,

    thanks for your quick response. i already updated to the new version. as far as i understand the compatibility_score() function, it is already coded the way i want to have it: every match on multiple checkboxes is added to the score. at least that is what the coded is supposed to do. Unfortunately the multiple checkboxes do not have any effect on my score. to finde the reason, i tried several different member searches and tried changes the target member profile interests. but the result is always the same: the score does not change. btw: single value fields work perfectly!

    COPY CODE
    add_action('after_setup_theme','kleo_my_match'); 
    
    //If we want to match by members sex. values: 0|1
    $kleo_config['matching_fields']['sex_match'] = 0;
    function kleo_my_match() {
      global $kleo_config;
      $kleo_config['matching_fields']['starting_score'] = 1;
      //required for initial match. If the sex preference matches it will continue to the specified fields below
      $kleo_config['matching_fields']['sex'] = 'I am a';
      $kleo_config['matching_fields']['looking_for'] = 'Looking for a';
      //sex percentage
      $kleo_config['matching_fields']['sex_percentage'] = 49;
      //single value fields like select, textbox,radio
      $kleo_config['matching_fields']['single_value'] = array ( 
        'Marital status' => 10, 
        'Country' => 10, 
        'City' => 5,
        'Profession' => 10,
        'Annual Income' => 10,
        'Education' => 10,
        'Political Views' =>5,
        'Religion' => 20,
        'Weight Type' => 5,
        'Ethnicity' => 15
      ); 
      //multiple values fields like multiple select or checkbox 
      $kleo_config['matching_fields']['multiple_values'] = array (
        'Interests' => 5
      );
    }

    sex, marital status, country and city are set for scoring and i get a perfect 75 when i do a search. but Interests do not have any impact.

    obviously there are a lot of people in this forum who have the same problem – i hope that there is a simple answer for me.

    thanks in advance, i appreciate your help! your are doing a great job.

    #36442
     topdog
    Participant

    I am having the same problem. I see that the support team hasn’t responded to your last post in July. Did you find a fix for this?

    It’s driving me crazy why this isn’t working since all the support threads I’ve read claim that it’s supposed to.

    #36776
     Abe
    Keymaster

    Hi topdog,

    you need the latest version installed and your field name should be added inside this array like the example
    $kleo_config[‘matching_fields’][‘multiple_values’] = array (
    ‘My field name with multiple choice type’ => 10,
    );

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

    #36801
     topdog
    Participant

    Abe,

    I have the latest theme enabled and my code is formatted as you have described. I actually opened a separate thread related to my issue after I posted on this thread: .

    I’d appreciate any assistance you can provide. I can give you FTP access if necessary.

    #36985
     Abe
    Keymaster

    Do you have two profiles with one value that is chosen on both?

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

    #37022
     topdog
    Participant

    Yes. One of the fields is called My Interests and has checkboxes for various interests. On the admin account I have checked all of them. On the dummy accounts, I have check just a few of them.

    When I test the matching score, it only gives me credit for the single variable matches and not the multiple variable matches as it’s supposed to do.

    I opened another support thread for this but haven’t heard back in over 4 days. I posted by code on that thread which is hear:

    #37418
     Abe
    Keymaster

    Closing this topic. continuing here https://archived.seventhqueen.com/forums/topic/matching-fields-multiple-values-not-working#post-37416

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

Viewing 9 posts - 1 through 9 (of 9 total)

The topic ‘Multiple Checkbox: not partial match?’ is closed to new replies.

Log in with your credentials

Forgot your details?