• Hello,

    I am using WOOCS.

    I am trying to display either an exchange rate, or a second currency somewhere within the invoice.

    I am trying to do this by customizing a template and trying to use WOOCS variables, but to no avail.

    Preferably, I’d do something like:

    <td class=”price”><?php echo $item[‘order_price’]; ?></td>
    <td class=”exchangerate”><?php echo $WOOCS[‘exchange_rate’]; ?></td>
    OR
    <td class=”altprice”><?php echo $WOOCS[‘second_currency’]; ?></td>

    WOuld this be possible?

    Thank you in advance!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor kluver

    (@kluver)

    Hi @apexdigitalro,

    Presumably the exchange rate, and perhaps product prices in a second currency, are stored in the order meta and/or order item meta. To find this data you can use the following guide: Finding WooCommerce custom fields

    To get this data on your documents you can use this guide: Displaying a custom field

    Plugin Contributor Ewout

    (@pomegranate)

    Hi! This will require more than global variables, because the exchange rate will change over time and if you keep reading the latest exchange rate from the WOOCS variables, the numbers on the invoice will no longer match the exchange rate at the time of purchase.

    Instead, you will either need to read the exchange rate from the order meta (if WOOCS stores it there) and calculate the price in the second currency based on that exchange rate, OR read the price in the second currency directly from the item meta and/or order meta.

    To read order meta, you can follow this guide: Displaying a custom field

    To read item meta (which you can only do within the loop for the order items), you can use something like this (where _woocs_price is an example meta key that you will need to replace with the actual meta key if available):

    
    <?php echo wc_get_order_item_meta( $item['item_id'], '_woocs_price' ); ?>
    

    Hope that helps!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Multiple Currencies on Invoice? (WOOCS)’ is closed to new replies.