Delete a comma 2

Home Forums Calendar Products Events Calendar PRO Delete a comma 2

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #1093383
    Birgit Bauer
    Participant

    Hello,
    I had a conversation on this topic before: https://theeventscalendar.com/support/forums/topic/delete-a-comma/

    Now I could get into the problem but the solution didn’t work.
    I edited the code and finally deleted all commas inside this area .. but the comma is still displayed:

    		/**
    		 *  Returns the full address of an event along with HTML markup.  It
    		 *  loads the full-address template to generate the HTML
    		 */
    		public function fullAddress( $post_id = null, $includeVenueName = false ) {
    			global $post;
    			if ( ! is_null( $post_id ) ) {
    				$tmp_post = $post;
    				$post     = get_post( $post_id );
    			}
    			ob_start();
    			tribe_get_template_part( 'modules/address' );
    			$address = ob_get_contents();
    			ob_end_clean();
    			if ( ! empty( $tmp_post ) ) {
    				$post = $tmp_post;
    			}
    
    			return $address;
    		}
    
    		/**
    		 *  Returns a string version of the full address of an event
    		 *
    		 * @param int|WP_Post The post object or post id.
    		 *
    		 * @return string The event's address.
    		 */
    		public function fullAddressString( $postId = null ) {
    			$address = '';
    			if ( tribe_get_address( $postId ) ) {
    				$address .= tribe_get_address( $postId );
    			}
    
    			if ( tribe_get_city( $postId ) ) {
    				$address .= tribe_get_city( $postId );
    			}
    
    			if ( tribe_get_region( $postId ) ) {
    				$address .= tribe_get_region( $postId );
    			}
    
    			if ( tribe_get_zip( $postId ) ) {
    				$address .= tribe_get_zip( $postId );
    			}
    
    			if ( tribe_get_country( $postId ) ) {
    				$address .= tribe_get_country( $postId );
    			}
    
    			return $address;
    		}

    here is how it looks like:
    http://screencast.com/t/h1UGI3he
    http://screencast.com/t/8wb9RwJcTk

    And here is how I did the setup for the Addres to display like we do in Austria:
    http://screencast.com/t/sLxZmwacvkc

    As you can see, the comma is set to be displayed to seperate the ZIP (PLZ) but I left the field empty because I need the ZIP to be displayed in front of the city and therefore added it to the city field.

    Any other idea where I could dlete this comma?

    Thank you!

    #1093930
    Brian
    Member

    Hi,

    Thanks for using our plugins. I can help out here, but I am limited in support customizations and might not be able to provide all the coding.

    The comma is being put there by another method in the main class.

    There is no way to change that without editing the core files, which means changes are lost on updates.

    Instead I would in this file:

    plugins/the-events-calendar/src/views/modules/meta/venue.php

    After moved to your theme here:

    your-theme/tribe-events/modules/meta/venue.php

    Following our themer’s guide:

    https://theeventscalendar.com/knowledgebase/themers-guide/

    And instead of this:

    <?php echo tribe_get_full_address(); ?>

    Use this to get the address the way you would like:

    <?php
    $venueId = tribe_get_venue_id();
    echo tribe_get_address( $venueId );
    echo '<br>' . tribe_get_city( $venueId );
    ?>

    That would have to be changed in the list view template as well.

    plugins/the-events-calendar/src/views/list/single-event.php

    Cheers

    #1100419
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Delete a comma 2’ is closed to new replies.