VirtueMart Forum

VirtueMart 2 + 3 + 4 => Plugins: Payment, Shipment and others => Topic started by: chinsen on February 25, 2014, 10:28:29 AM

Title: Is private $_numeric_code = 0; needed in currencydisplay.php?
Post by: chinsen on February 25, 2014, 10:28:29 AM
Hi all,

For a while I've been having a problem with a payment plug-in I had made for a local bank (Sampath Bank) which worked fine on older versions of virtuemart. Every time the consumer tried to checkout with the selected payment option, I started getting the following error

QuoteFatal error: Cannot access private property CurrencyDisplay::$_numeric_code in /home/mumsinco/public_html/plugins/vmpayment/sampathpay/sampathpay.php on line 157

After looking around I discovered that the newer version of currencydisplay.php had a line on line 36 which the older version did not

private $_numeric_code = 0;

Upon deleting that line, everything works fine with the payment option plug-in.

I'm just wondering what reason that line was added for, and if by removing am I negatively affecting something else?

Thanks guys!
Title: Re: Is private $_numeric_code = 0; needed in currencydisplay.php?
Post by: Milbo on February 26, 2014, 16:59:47 PM
Interesting, what do you mean by "older version of virtuemart?" Seems your plugin is using the $_numeric_code, which is set to private, because it belongs to the currency. Just remove this in your code to rely on the db data.