Currency after price (yet again :-( )

Homepage Forums WP Travel Currency after price (yet again :-( )

This topic contains 9 replies, has 3 voices, and was last updated by  Support Team 4 months, 3 weeks ago.

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #7936

    strifer
    Participant

    Hello guys,
    I am trying to put the currency symbol after the value, to have it shown like this: “8 500 Kč” (the space between thousands would be a great nice-to-have).

    I have found an older inquiry on this topic, but the link of the code to put in links to a 404 page 🙁

    Thank you so much!

    A.

    #7979

    Support Team
    Keymaster

    Hello @strifer,

    you can use the following code in your child theme’s functions.php file to get the currency amount in your requested format :

    function wp_travel_customize_sale_price_display( $s, $c, $d ) {
    	return sprintf( esc_html__('%1s %2s', 'wp-travel' ),  $c , number_format( $d, 0, '.', ' ' ) );
      }
      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' ), $c , number_format( $d, 0, '.', ' ' ) );
    	  // return $s;
    	}
    	return sprintf( esc_html__('%1s %2s', 'wp-travel' ), $c , number_format( $d, 0, '.', ' ' ) );
      }
      add_filter( 'wp_travel_itinerary_price', 'wp_travel_customize_price_display', 99, 3 );

    If you have any queries/issues further, please feel free to write back to us.

    Best Regards !!

    #9677

    vdhmmo
    Participant

    Hello,

    I have the same question. But seems like the code does’nt work anymore. Can you please check again?
    I’m using
    Plugin: WP Travel 1.7.9
    Theme: Travel Log 1.2.3

    Your plugin still works perfectly.
    Hope to hear from you soon. Thank you so much!

    #9678

    vdhmmo
    Participant

    By the way, can you help me add thousand separator in price by “,”? For example: 10,890,000 đ

    #9679

    vdhmmo
    Participant

    The previous code I found in support forum about “Add comma between the trips price” and “Currency symbol position” almost only works on Trip Page, not affect on Cart Page and Checkout Page.
    It would be great if the code was updated to not conflict each other.
    Thanks again. I always support wptravel.
    I’m considering to upgrade addons for my travel website.

    #9791

    Support Team
    Keymaster

    Hello @vdhmmo,

    First of all thank you very much for the appreciations and support. Hoping for the same love and support in the future as well.

    Now regarding your query, please add below given code by going to your child themes’s functions.php file.

    https://pastebin.com/vRj2fVzp

    Hope this helps.

    If you have any query further please let us know.

    Thank you.

    Regards!!

    #9793

    vdhmmo
    Participant

    Yes, it’s work great.
    1. But can you please take a look at “Post Filter Section” => “Trip Types/Trip Locations”?
    Screenshot: https://prnt.sc/mbgqgu

    2. I read about Multiple Trips function here: http://wptravel.io/documentations/wp-travel-utilities/multiple-trips-cart-checkout/configurations/
    Is that works with Inventory Option? I mean, in single trip page, multiple trips with different fixed departure will show up on the booking tab. Customer just click on the trip they want and filling the booking form (skip cart enabled).
    http://wptravel.io/documentations/wp-travel-utilities/inventory-option/inventory-option-for-particular-pricing/

    If it’s a custom feature that requires developer involvement, please quote me.
    Thanks for your support.

    #9804

    Support Team
    Keymaster

    Hello @vdhmmo,

    Glad that the code worked.

    As for the post filter section, to make the price appear with the comma and the currency symbol behind requires higher code customization.

    So if you want then you can hire our professional developer so that you get what you want.

    To hire a developer please refer to below given link:

    http://wptravel.io/hire-wordpress-customizer/

    Actually, it is multi checkout feature which is applicable for both single and multiple prices.

    If you enable this feature then you can add as many no of trips as you can in the cart page. Once you book a trip then “View Cart ” option will appear on the single trip page. If you decide to book another trip again then you can go to that trip and book. Now both the trips will be on the cart page along with their prices.

    This is feature will be only available through the use of WP Travel Utilities addon.

    Link:

    http://wptravel.io/downloads/wp-travel-utilities/

    Doc link:

    http://wptravel.io/documentations/wp-travel-utilities/multiple-trips-cart-checkout/

    Hope this clears the confusion.

    Best Regards!!

    #9815

    vdhmmo
    Participant

    I’ll try Utilities addon first.
    Thanks again. Great support team!

    #9839

    Support Team
    Keymaster

    Hello @vdhmmo,

    Yes, please do try and let us if you find any confusion further.

    Also, thank you very much for the appreciations :).

    Further, we would really appreciate if you dropdown your valuable review for our plugin by following the link given below:

    https://wordpress.org/support/plugin/wp-travel/reviews/

    Thank you.

    Regards!!

Viewing 10 posts - 1 through 10 (of 10 total)

You must be logged in to reply to this topic.