Shipping by Rules for VirtueMart
Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: Unknown Function on convert_from_currency

Unknown Function on convert_from_currency 27 Jul 2018 15:23 #1

  • icetrikes
  • icetrikes's Avatar Topic Author
  • Offline
  • Posts: 1
I'm getting an error message on the Virtuemart cart page.

Unknown function 'convert_from_currency' encountered during evaluation of rule '[small items]; Amount<=50; Shipping=convert_from_currency(25, "USD")'.

The rule that is triggering it is:

[small items]; Amount<=50; Shipping=convert_from_currency(25, "USD")
[larger items]; 50<Amount<=500; Shipping=convert_from_currency(35, "USD")
[trikes]; Amount>500; Shipping=convert_from_currency(149, "USD")

I tried this convert_to_currency as well, but I get the same error. Setting the Joomla error reporting to 'Development' doesn't change the error message.

In this case, I need to have the shipping prices in USD for US customers. The shop default currency is GBP. I've only had the extension for a day, and it is doing everything I want from expect for this. Its entirely likely that I haven't used the function correctly. I had previously tried

[small items]; Amount<=convert_from_currency(50, "USD"); Shipping=convert_from_currency(25, "USD")

which is really what I want to do; is the amount is less that 50 USD, then the shipping is 25 USD. The examples and documentation is slightly confusing because it doesn't show the effect of Currency field at the bottom of Shipment Method Information.



Joomla 3.8.10
Virtuemart 3.2.14
PHP 7.1.5
Advanced Shipping by Rules 6.2.4

Please Log in or Create an account to join the conversation.

Unknown Function on convert_from_currency 10 Sep 2018 18:12 #2

Dear John,
Sorry to hear about your problems. It seems that we have a small, but crucial typo in the documentation: In our code, we called the two conversion functions "ConvertFromCurrency" and "ConvertToCurrency" (upper-/lowercase is irrelevant, but no underscored....).

We'll add convert_from_currency and convert_to_currency in our next version (as aliases for ConvertFromCurrency and ConvertToCurrency). For now, you can simpy use ConvertFromCurrency.

Best regards,

Please Log in or Create an account to join the conversation.

  • Page:
  • 1

VM - Shopping cart


Cart empty

Login Formular