VirtueMart Forum

VirtueMart 2 + 3 + 4 => Plugins: Payment, Shipment and others => Topic started by: Anna_Bolika on January 19, 2023, 11:40:18 AM

Title: Custom Payment not selectable in VM4/J4 but in VM4/J3
Post by: Anna_Bolika on January 19, 2023, 11:40:18 AM
Hi folks

We have developed our own payment plugin. It has been running for years without any problems on Joomla 3.x.x and VM 3.

Now its time to make it fitting the new requirments: J4/VM4/PHP8

With the combination of J-3.10.11/VM4.0.12 it runs still flawless, on PHP7 and 8 now.

But not with J-4.2.6 and VM 4.0.12:
The payment methods are all displayed, but cannot be selected. After the selection and page refresh the radio button jumps back to the first payment method (with and without OPC, on PHP8 and PHP7).

I have been trying to find the error for hours - but with no luck so far. VM is not that easy to debug ;-)

Have someone a hint for me what can cause this behavior or where I've to set my focus on?
The plugins entry-file (PAYMENTNAME.php) are identical a.t.m.

Every tip is welcome.

Thanks in advance, regards
Roger
Title: Re: Custom Payment not selectable in VM4/J4 but in VM4/J3
Post by: ssc3 on January 19, 2023, 23:00:11 PM
Take a look at plgVmOnSelectedCalculatePrice

Triggers are case sensitive in Joomla 4, so

plgVmonSelectedCalculatePrice

becomes

plgVmOnSelectedCalculatePrice
Title: Re: Custom Payment not selectable in VM4/J4 but in VM4/J3
Post by: Anna_Bolika on January 20, 2023, 12:38:14 PM
Hi

Such a small detail but yet so powerfull!

I've missed this change somehow, because I did not much with J4 so far.

But this was it, thank you very much - that solved my problem!!

Have a nice weekend, cheers
Roger