Helcim Logo Support & Tutorials

© Copyright 2006-2019 Helcim Inc.

All Rights Reserved.

Cart & Software Integration » WooCommerce »

Multiple Currencies in WooCommerce

By default, the Helcim Commerce plugin for WooCommerce supports a single merchant account and currency. However, you can modify the plugin in order to support both CAD + USD by following the steps below.

Modification Instructions

  • Modify the plugin's php file.

    • The file is called (class-wc-commerce-helcim.php) and it should be located at: wp-content/plugins/helcim-commerce-for-woocommerce/class-wc-commerce-helcim.php depending on your WordPress and WooCommerce installation.

    • The code to modify should be found approx. at line 335 (see "Original Plugin Code" sample to the right)

    • Modify the php with the new code (see sample on the right)

    • Enter your USD Helcim Commerce API Terminal Id as pat of the php code, where it says “CHANGE_TO_USD_TERMINAL_ID”

  • Test a transaction in each currency before going to production.

Code Samples

Original Plugin Code PHP

// SET DEFAULT
$helcim_args = array(
	'accountId' => $this->accountId,
	'apiToken' => $this->apiToken,
	'transactionType' => $this->transactionType,
	'terminalId' => $this->terminalId,
	'test' => $this->isTest(),
	'ecommerce' => 1,
	'cvvIndicator' => 1,
	'ipAddress' => $ipAddress
);

Modified Plugin Code PHP

// SET DEFAULT
$helcim_args = array(
	'accountId' => $this->accountId,
	'apiToken' => $this->apiToken,
	'transactionType' => $this->transactionType,
	'terminalId' => (get_woocommerce_currency() == 'CAD' ? $this->terminalId : CHANGE_TO_USD_TERMINAL_ID),
	'test' => $this->isTest(),
	'ecommerce' => 1,
	'cvvIndicator' => 1,
	'ipAddress' => $ipAddress
);