• Camelia Support Team - WP Estate
    May 28, 2015 at 1:25 pm #109403

    In our theme City—> Area are the only connected taxonomies.

    For connect more taxonomies is required new code.

    We recommend you to take as example the relation between our taxonomies State-Area.

    The code for relation between our taxonomies State-Area is in property.php line 967-

    these are the filters and functions used to sort areas by city

    ///////////////////////////////////////////////////////////////////////////////////////////////////////////

    // Tie area with city

    ///////////////////////////////////////////////////////////////////////////////////////////////////////////

    
    add_action( 'property_area_edit_form_fields', 'property_area_callback_function', 10, 2);
    
    add_action( 'property_area_add_form_fields', 'property_area_callback_add_function', 10, 2 );
    
    add_action( 'created_property_area', 'property_area_save_extra_fields_callback', 10, 2);
    
    add_action( 'edited_property_area', 'property_area_save_extra_fields_callback', 10, 2);
    
    add_filter('manage_edit-property_area_columns', 'ST4_columns_head');
    
    add_filter('manage_property_area_custom_column','ST4_columns_content_taxonomy', 10, 3);

    ———-

    Can you please explain where you have added the ajax codes for showing areas corresponding to a particular city.

    This is done via javascript – look into control.js around line 900

    ////////////////////////////////////////////////////////////////////////////////////////////
    
    ///city-area-selection
    
    ///////////////////////////////////////////////////////////////////////////////////////////
    
    $('#filter_city li').click(function(event){
    
    event.preventDefault();
    
    var pick, value_city, parent, selected_city, is_city, area_value;
    
    value_city = String( $(this).attr('data-value2') ).toLowerCase();
    
    $('#filter_area li').each(function(){
    
    is_city = String ( $(this).attr('data-parentcity') ).toLowerCase();
    
    is_city = is_city.replace(" ","-");
    
    area_value = String ( $(this).attr('data-value') ).toLowerCase();
    
    if(is_city === value_city || value_city === 'all' ){
    
    $(this).show();
    
    }else{
    
    $(this).hide();
    
    }
    
    });
    
    });

    Thanks

You must be logged in to reply to this topic.

Contact Us

We're not around right now. But you can send us an email and we'll get back to you, asap.