- This topic has 27 replies, 3 voices, and was last updated 4 years, 7 months ago by
wensolutions.
-
AuthorPosts
-
May 13, 2019 at 5:36 am #14706
Support Team
KeymasterHello @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.
May 13, 2019 at 7:10 am #14716oligo11
ParticipantHi, 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?
ThanksMay 13, 2019 at 8:05 am #14722Support Team
KeymasterHello @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.
May 13, 2019 at 8:23 am #14724oligo11
ParticipantThank 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;
May 13, 2019 at 8:26 am #14725oligo11
ParticipantEven 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;
May 13, 2019 at 8:45 am #14728Support Team
KeymasterHello @oligo11,
The code that we have provided is working as you can see below given screenshot:
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.
May 13, 2019 at 8:48 am #14729oligo11
ParticipantI 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 youMay 13, 2019 at 8:51 am #14730oligo11
ParticipantSorry, yes it works on the trip page, but not on the front page
May 14, 2019 at 4:37 am #14752Support Team
KeymasterHello @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.
May 14, 2019 at 6:40 am #14754oligo11
ParticipantThat’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
May 14, 2019 at 10:10 am #14766wensolutions
KeymasterHello @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.
May 14, 2019 at 10:11 am #14767oligo11
ParticipantFine, thank you very much.
Best regards
OliMay 14, 2019 at 11:15 am #14771wensolutions
Keymaster -
AuthorPosts
- The forum ‘WP Travel Pro’ is closed to new topics and replies.