• Hi guys,

    I have a CSV file where woocommerce prices are in EUR, but the Woocommerce shop where I need to import it is in another language and respectively currency. How can I convert?

    Thanks

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author WP All Import

    (@wpallimport)

    Hi @ayo-1

    You can either use our “Adjust Prices” section: https://d.pr/i/Ci5buV, or a custom PHP function on the price element: https://www.wpallimport.com/documentation/developers/execute-php/.

    Thread Starter TheGreyRabbit

    (@ayo-1)

    That works, thanks! I didn’t see that option before you showed it to me.

    Is there a way to import prices without decimal point? I’m giving an example:

    The CSV file contains prices in EUR and each price has some cents, like EUR 10,99

    I need to import the prices in $, so having in mind that EUR 1 = $ 1,12, we have the following calculation: 10,99 x 1,12 = $12,30.

    But I need to have full numbers, like 12,01 to 12,49 should become 12, and 12,50 to 12,99 should become 13.

    I already purchased the Woocommerce pro addon, but can’t see an option to do this. Maybe there’s a trick that you can show me?

    Thanks for your time!

    Plugin Author WP All Import

    (@wpallimport)

    Hi @ayo-1

    I can see that we provided a solution for you in our ticket system. For anyone else reading this, you need to use a custom PHP function to adjust the prices instead: https://www.wpallimport.com/documentation/developers/execute-php/.

    Example function:

    function round_price( $price = null, $multiplier = 1, $nearest = .05, $minus = 0 ) {
    	$price = str_replace( ",", ".", $price );
        if ( !empty( $price ) ) {
            return ( round ( ( $price * $multiplier ) / $nearest ) * $nearest ) - $minus; 
        }
    }

    Example usage:

    [round_price({price[1]}, "1.12", "1", "0")]

    Thread Starter TheGreyRabbit

    (@ayo-1)

    It works perfectly, thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to convert currency’ is closed to new replies.