Bug in Homepage Sortable

Homepage Forums WP Travel Pro Bug in Homepage Sortable

Viewing 13 posts - 16 through 28 (of 28 total)
  • Author
    Posts
  • #14706
    Support Team
    Keymaster

    Hello @oligo11,

    Glad we could help you.

    Now to change the currency formatting please add below-given code in your child theme functions.php file.

    function wp_travel_customize_sale_price_display( $s, $c, $d ) {
      return sprintf( esc_html__('%1s %2s', 'wp-travel' ), number_format( $d , 2 ), $c );
    }
    add_filter( 'wp_travel_itinerary_sale_price', 'wp_travel_customize_sale_price_display', 99, 3 );
    
    function wp_travel_customize_price_display( $s, $c, $d ) {
      global $wp_travel_itinerary;
      if ( $wp_travel_itinerary && $wp_travel_itinerary->is_sale_enabled() ) {
         return  sprintf( esc_html__(' %1s %2s', 'wp-travel' ), number_format( $d , 2 ), $c );
         return $s;
      }
      return sprintf( esc_html__('%1s %2s', 'wp-travel' ), number_format( $d , 2 ), $c );
    }
    add_filter( 'wp_travel_itinerary_price', 'wp_travel_customize_price_display', 99, 3 );

    Hope this helps.

    Thank you.

    #14716
    oligo11
    Participant

    Hi, thank you very much!
    I am going to try that but I can’t access to my site admin. Did you make any change in the WP core?
    ERR_CONNECTION_TIMED_OUT is the error message from the browsers?
    Thanks

    #14722
    Support Team
    Keymaster

    Hello @oligo,

    No, we have not changed anything and we are in no position to do so. Instead, we highly recommend the user to change their credentials after the issue is resolved.

    Regarding your issue, once increase the execution time in the php.ini file and verify the issue. If this does not resolve the issue then please contact your host and report the issue.

    Thank you.

    #14724
    oligo11
    Participant

    Thank you, it came back to normal, couldn’t understand why.

    Now, I did paste the code in my function.php child theme file but not change on the front page.
    Here under is my full function.php file

    <?php
    /**
     *Recommended way to include parent theme styles.
     *(Please see http://codex.wordpress.org/Child_Themes#How_to_Create_a_Child_Theme)
     */  
    
      add_action( 'wp_enqueue_scripts', 'pleased_pro_child_style' );
      function pleased_pro_child_style() {
    	wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
    	wp_enqueue_style( 'child-style',get_stylesheet_directory_uri() . '/style.css',array('parent-style'));
    }
    
    function pleased_pro_sortable_sections_customize($sections) {
    	$sections = array(
                'banner'    => esc_html( 'Banner', 'pleased-pro' ),
                'about'     => esc_html( 'About Us', 'pleased-pro' ),
                'gallery'   => esc_html( 'Gallery', 'pleased-pro' ),
                'package'   => esc_html( 'Package', 'pleased-pro' ),
                'offer'     => esc_html( 'Offer', 'pleased-pro' ),
                'service'   => esc_html( 'Services', 'pleased-pro' ),
                'testimonial' => esc_html( 'Testimonial', 'pleased-pro' ),
                'blog'      => esc_html( 'Blog', 'pleased-pro' ),
                'contact'   => esc_html( 'Contact', 'pleased-pro' ),
            );
    	return $sections;
    
    }
    
    add_filter( 'pleased_pro_sortable_sections', 'pleased_pro_sortable_sections_customize' );
    /**
     *Your code goes below
     */
    
    if ( ! function_exists( 'pleased_pro_render_package_section' ) ) :
      /**
       * Start package section
       *
       * @return string package content
       * @since Pleased Pro 1.0.0
       *
       */
       function pleased_pro_render_package_section( $content_details = array() ) {
            $options = pleased_pro_get_theme_options();
            $package_content_type  = $options['package_content_type'];
    
            if ( empty( $content_details ) ) {
                return;
            } ?>
    
            <div id="luxury-room" class="page-section">
                    <div class="wrapper">
                        <div class="section-header align-center">
                            <?php if ( ! empty( $options['package_sub_title'] ) ) : ?>
                                <span class="section-subtitle"><?php echo esc_html( $options['package_sub_title'] ); ?></span>
                            <?php endif; 
    
                            if ( ! empty( $options['package_title'] ) ) : ?>
                                <h2 class="section-title"><?php echo esc_html( $options['package_title'] ) ?></h2>
                            <?php endif; ?>
                        </div><!-- .section-header -->
    
                        <div class="section-content">
                            <div class="grid">
    
                                <?php foreach ( $content_details as $content ) : ?>
                                    <div class="grid-item">
                                        <article class="has-featured-image" style="background-image: url('<?php echo esc_url( $content['image'] ); ?>');">
                                            <div class="overlay"></div>
                                            <div class="entry-container">
                                                <header class="entry-header">
                                                    <h2 class="entry-title"><a href="<?php echo esc_url( $content['url'] ); ?>"><?php echo esc_html( $content['title'] ); ?></a></h2>
                                                </header>
    
                                                <?php if ( ! in_array( $package_content_type, array( 'page', 'post', 'category' ) ) ) : 
                                                    $enable_sale     = get_post_meta( $content['id'], 'wp_travel_enable_sale', true );
                                                    $trip_price      = wp_travel_get_trip_price( $content['id'] );
                                                    $sale_price      = wp_travel_get_trip_sale_price( $content['id'] );
                                                    $trip_per        = wp_travel_get_price_per_text( $content['id'] );
                                                    $settings        = wp_travel_get_settings();
                                                    $currency_code   = ( isset( $settings['currency'] ) ) ? $settings['currency'] : '';
                                                    $currency_symbol = wp_travel_get_currency_symbol( $currency_code );
                                                ?>
                                                    <div class="trip-entry-meta">
                                                       <div class="price-meta">
                                                            <span class="trip-price">                       
                                                                <?php 
                                                                echo esc_html( $currency_symbol ) . ' ';
                                                                echo ( true == $enable_sale && $sale_price ) ? esc_html( $sale_price ) : esc_html( $trip_price );
                                                                ?>
                                                            </span><!-- .trip-price -->
                                                            <span><?php printf( esc_html__( '/ %s', 'pleased-pro' ), $trip_per ); ?></span><!-- .trip-price -->
                                                        </div>
                                                    </div><!-- .entry-meta -->
                                                <?php endif; ?>
                                            </div><!-- .entry-container -->  
                                        </article>   
                                    </div><!-- .grid-item -->
                                <?php endforeach; ?>
    
                            </div><!-- .grid -->
                            <?php if ( ! empty( $options['package_btn_title'] ) && ! empty( $options['package_btn_url'] ) ) : ?>
                                <a href="<?php echo esc_url( $options['package_btn_url'] ); ?>" class="btn btn-primary"><?php echo esc_html( $options['package_btn_title'] ); ?></a>
                            <?php endif; ?>
                        </div><!-- .section-content -->
                    </div><!-- .wrapper -->
                </div><!-- #luxury-room -->
    
      /**
       * Symbole monnaie placé après le prix
       *
       */
    
    function wp_travel_customize_sale_price_display( $s, $c, $d ) {
      return sprintf( esc_html__('%1s %2s', 'wp-travel' ), number_format( $d , 2 ), $c );
    }
    add_filter( 'wp_travel_itinerary_sale_price', 'wp_travel_customize_sale_price_display', 99, 3 );
    
    function wp_travel_customize_price_display( $s, $c, $d ) {
      global $wp_travel_itinerary;
      if ( $wp_travel_itinerary && $wp_travel_itinerary->is_sale_enabled() ) {
         return  sprintf( esc_html__(' %1s %2s', 'wp-travel' ), number_format( $d , 2 ), $c );
         return $s;
      }
      return sprintf( esc_html__('%1s %2s', 'wp-travel' ), number_format( $d , 2 ), $c );
    }
    add_filter( 'wp_travel_itinerary_price', 'wp_travel_customize_price_display', 99, 3 );
            
        <?php }
    endif;
    #14725
    oligo11
    Participant

    Even in placing the code in the beginning it’s not working

    <?php
    /**
     *Recommended way to include parent theme styles.
     *(Please see http://codex.wordpress.org/Child_Themes#How_to_Create_a_Child_Theme)
     */  
    
    function wp_travel_customize_sale_price_display( $s, $c, $d ) {
      return sprintf( esc_html__('%1s %2s', 'wp-travel' ), number_format( $d , 2 ), $c );
    }
    add_filter( 'wp_travel_itinerary_sale_price', 'wp_travel_customize_sale_price_display', 99, 3 );
    
    function wp_travel_customize_price_display( $s, $c, $d ) {
      global $wp_travel_itinerary;
      if ( $wp_travel_itinerary && $wp_travel_itinerary->is_sale_enabled() ) {
         return  sprintf( esc_html__(' %1s %2s', 'wp-travel' ), number_format( $d , 2 ), $c );
         return $s;
      }
      return sprintf( esc_html__('%1s %2s', 'wp-travel' ), number_format( $d , 2 ), $c );
    }
    add_filter( 'wp_travel_itinerary_price', 'wp_travel_customize_price_display', 99, 3 );
    
      add_action( 'wp_enqueue_scripts', 'pleased_pro_child_style' );
      function pleased_pro_child_style() {
    	wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
    	wp_enqueue_style( 'child-style',get_stylesheet_directory_uri() . '/style.css',array('parent-style'));
    }
    
    function pleased_pro_sortable_sections_customize($sections) {
    	$sections = array(
                'banner'    => esc_html( 'Banner', 'pleased-pro' ),
                'about'     => esc_html( 'About Us', 'pleased-pro' ),
                'gallery'   => esc_html( 'Gallery', 'pleased-pro' ),
                'package'   => esc_html( 'Package', 'pleased-pro' ),
                'offer'     => esc_html( 'Offer', 'pleased-pro' ),
                'service'   => esc_html( 'Services', 'pleased-pro' ),
                'testimonial' => esc_html( 'Testimonial', 'pleased-pro' ),
                'blog'      => esc_html( 'Blog', 'pleased-pro' ),
                'contact'   => esc_html( 'Contact', 'pleased-pro' ),
            );
    	return $sections;
    
    }
    
    add_filter( 'pleased_pro_sortable_sections', 'pleased_pro_sortable_sections_customize' );
    /**
     *Your code goes below
     */
    
    if ( ! function_exists( 'pleased_pro_render_package_section' ) ) :
      /**
       * Start package section
       *
       * @return string package content
       * @since Pleased Pro 1.0.0
       *
       */
       function pleased_pro_render_package_section( $content_details = array() ) {
            $options = pleased_pro_get_theme_options();
            $package_content_type  = $options['package_content_type'];
    
            if ( empty( $content_details ) ) {
                return;
            } ?>
    
            <div id="luxury-room" class="page-section">
                    <div class="wrapper">
                        <div class="section-header align-center">
                            <?php if ( ! empty( $options['package_sub_title'] ) ) : ?>
                                <span class="section-subtitle"><?php echo esc_html( $options['package_sub_title'] ); ?></span>
                            <?php endif; 
    
                            if ( ! empty( $options['package_title'] ) ) : ?>
                                <h2 class="section-title"><?php echo esc_html( $options['package_title'] ) ?></h2>
                            <?php endif; ?>
                        </div><!-- .section-header -->
    
                        <div class="section-content">
                            <div class="grid">
    
                                <?php foreach ( $content_details as $content ) : ?>
                                    <div class="grid-item">
                                        <article class="has-featured-image" style="background-image: url('<?php echo esc_url( $content['image'] ); ?>');">
                                            <div class="overlay"></div>
                                            <div class="entry-container">
                                                <header class="entry-header">
                                                    <h2 class="entry-title"><a href="<?php echo esc_url( $content['url'] ); ?>"><?php echo esc_html( $content['title'] ); ?></a></h2>
                                                </header>
    
                                                <?php if ( ! in_array( $package_content_type, array( 'page', 'post', 'category' ) ) ) : 
                                                    $enable_sale     = get_post_meta( $content['id'], 'wp_travel_enable_sale', true );
                                                    $trip_price      = wp_travel_get_trip_price( $content['id'] );
                                                    $sale_price      = wp_travel_get_trip_sale_price( $content['id'] );
                                                    $trip_per        = wp_travel_get_price_per_text( $content['id'] );
                                                    $settings        = wp_travel_get_settings();
                                                    $currency_code   = ( isset( $settings['currency'] ) ) ? $settings['currency'] : '';
                                                    $currency_symbol = wp_travel_get_currency_symbol( $currency_code );
                                                ?>
                                                    <div class="trip-entry-meta">
                                                       <div class="price-meta">
                                                            <span class="trip-price">                       
                                                                <?php 
                                                                echo esc_html( $currency_symbol ) . ' ';
                                                                echo ( true == $enable_sale && $sale_price ) ? esc_html( $sale_price ) : esc_html( $trip_price );
                                                                ?>
                                                            </span><!-- .trip-price -->
                                                            <span><?php printf( esc_html__( '/ %s', 'pleased-pro' ), $trip_per ); ?></span><!-- .trip-price -->
                                                        </div>
                                                    </div><!-- .entry-meta -->
                                                <?php endif; ?>
                                            </div><!-- .entry-container -->  
                                        </article>   
                                    </div><!-- .grid-item -->
                                <?php endforeach; ?>
    
                            </div><!-- .grid -->
                            <?php if ( ! empty( $options['package_btn_title'] ) && ! empty( $options['package_btn_url'] ) ) : ?>
                                <a href="<?php echo esc_url( $options['package_btn_url'] ); ?>" class="btn btn-primary"><?php echo esc_html( $options['package_btn_title'] ); ?></a>
                            <?php endif; ?>
                        </div><!-- .section-content -->
                    </div><!-- .wrapper -->
                </div><!-- #luxury-room -->        
        <?php }
    endif;
    #14728
    Support Team
    Keymaster

    Hello @oligo11,

    The code that we have provided is working as you can see below given screenshot:

    http://prntscr.com/nnu3wq

    So in your side, the issue must have raised due to the cache. So please once clear the cache and verify the issue.

    Thank you.

    #14729
    oligo11
    Participant

    I just did but no incidence.

    Can you tell me if the way I put the code in my function.php file is correct please?
    Thank you

    #14730
    oligo11
    Participant

    Sorry, yes it works on the trip page, but not on the front page

    #14752
    Support Team
    Keymaster

    Hello @oligo11,

    The front page section is controlled from the theme so the code that we provided did not work. It will only work for a trip single page.

    However, we have fixed the issue in the front page as well.

    Please verify.

    Thank you.

    #14754
    oligo11
    Participant

    That’s great! Thank you very much indeed.

    Last question for now: can you tell me where I could change the name “/unit” by “/unité” for the supplements: https://prnt.sc/no952r

    And also here as well if it’s possible to put the currency symbol after the price.

    Thank you

    #14766
    wensolutions
    Keymaster

    Hello @oligo11,

    The issue is noted as the known issue and it will be fixed in the coming updates of the plugin.

    Hoping for your kind co-operation.

    Thank you.

    #14767
    oligo11
    Participant

    Fine, thank you very much.
    Best regards
    Oli

    #14771
    wensolutions
    Keymaster

    Hello @oligo11,

    Let us know if you have any issues further.

    Thank you.

Viewing 13 posts - 16 through 28 (of 28 total)
  • You must be logged in to reply to this topic.