• Resolved halfebjones

    (@halfebjones)


    Hi team,

    I’m having an issue where, when creating a new listing, the location and category lists aren’t coming up and people cannot fill them out. I have made sure to make a large library for both but no options are coming up and available when they start typing into the field.

    The page I need help with: [log in to see the link]

Viewing 10 replies - 1 through 10 (of 10 total)
  • I have the same problem in canal telegram

    • This reply was modified 3 years, 8 months ago by mordiben.
    Plugin Support Rafiz Sejim

    (@rafizsejim)

    Greetings @mordiben and @halfebjones

    We are sorry for the trouble. Would you try adding the following code in Appearance > Theme Editor > functions.php?

    function directorist_bulk_term_update(){
    	if( get_option( 'directorist_bulk_term_update_for_v7' ) ) return;
     
    	$terms = [ ATBDP_CATEGORY, ATBDP_LOCATION ];
    	foreach( $terms as $term ) {
    		$term_data = get_terms([
    			'taxonomy'   => $term,
    			'hide_empty' => false,
    			'orderby'    => 'date',
    			'order'      => 'DSCE',
    			]);
    		if( !empty( $term_data ) ) {
    			foreach( $term_data as $data ) {
    				$old_data = get_term_meta( $data->term_id, '_directory_type', true );
    				if( !empty( $old_data ) ){
    					foreach( $old_data as $single_data ){
    					if( ! is_numeric( $single_data ) ){
    						$term_with_directory_slug = get_term_by( 'slug', $single_data, 'atbdp_listing_types' );
    						$id = $term_with_directory_slug->term_id;
    						update_term_meta( $data->term_id, '_directory_type', [ $id ] );
    					}
    					}
    				}
    			}
    		}
    	}
    	update_option( 'directorist_bulk_term_update_for_v7', 1 );
    }
     
    add_action( 'init', 'directorist_bulk_term_update' );

    Let me know if that doesn’t resolve the issue.

    Regards,

    Hello,
    I am also having the same issue even after adding the above code to functions.php – getting “no results found” on page that contains [directorist_all_categories].

    Any ideas?

    The fix does not work for me either.

    Plugin Support Rafiz Sejim

    (@rafizsejim)

    Again very sorry for that! @jochen2016 @harv27

    Would you mind checking with the following code?

    add_action( 'wp_loaded', 'directorist_bulk_term_update' );
     
    function directorist_bulk_term_update(){
    	if( get_option( 'directorist_bulk_term_update_v7' ) ) return;
     
    	$terms = [ ATBDP_CATEGORY, ATBDP_LOCATION ];
    	foreach( $terms as $term ) {
    		$term_data = get_terms([
    			'taxonomy'   => $term,
    			'hide_empty' => false,
    			'orderby'    => 'date',
    			'order'      => 'DSCE',
    			]);
    		if( !empty( $term_data ) ) {
    			foreach( $term_data as $data ) {
     
    				$old_data = get_term_meta( $data->term_id, '_directory_type', true );
     
    				$results = is_array( $old_data ) ? $old_data[0] : $old_data;
     
    				if( !empty( $results ) ){
     
    					if( is_array( $old_data ) ){
    						foreach( $old_data as $single_data ){
     
    							if( ! is_numeric( $single_data ) ){
    								$term_with_directory_slug = get_term_by( 'slug', $single_data, 'atbdp_listing_types' );
    								$id = $term_with_directory_slug->term_id;
    								update_term_meta( $data->term_id, '_directory_type', [ $id ] );
    							}
    						}
    					}else{
    						if( ! is_numeric( $old_data ) ){
    							$term_with_directory_slug = get_term_by( 'slug', $old_data, 'atbdp_listing_types' );
    							$id = $term_with_directory_slug->term_id;
    							update_term_meta( $data->term_id, '_directory_type', [ $id ] );
    						}
    					}
     
    				}else{
    					update_term_meta( $data->term_id, '_directory_type', [ default_directory_type() ] );
    				}
    			}
    		}
    	}
    	update_option( 'directorist_bulk_term_update_v7', 1 );
    }

    Regards,

    This works. Many thanks, Rafiz!

    Thank you for the quick response, Rafiz! It works.

    Thread Starter halfebjones

    (@halfebjones)

    I added the fix and now the lists are populating, however, they aren’t bringing up any of the items I add to categories or locations.

    Same here.
    Its really frustrating

    using avada theme and for some reason the widgets are not picking up the category slug – they are only using the %atbdp_listing_types% but working fine everywhere else? any ideas please on how to fix

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Category and Locations lists not propagating’ is closed to new replies.