VirtueMart Forum

VirtueMart 2 + 3 + 4 => Plugins: Payment, Shipment and others => Topic started by: FDT on July 29, 2019, 10:08:28 AM

Title: integrate Insurance into the onepagecheckout
Post by: FDT on July 29, 2019, 10:08:28 AM
Hello,
If it possible integrate Insurance into the onepagecheckout plugin here prntscr.com/ok70fs ? In the plugin we want to set the value as a percentage and in the shop cart the buyer can check the checkbox. If buyer choose the insurance, then our percentage is added to the final amount. if he doesn't want it, nothing is added. Plus, the name itself at the shop cart should be with reference to familiarization with the terms of insurance. Waiting for reply
Title: Re: integrate Insurance into the onepagecheckout
Post by: StefanSTS on July 29, 2019, 15:52:19 PM
I don't think, that will be easy to add into VM or VirtuePlanet OPC, it is acually independent from the cart extension you use.

You need a switch in the tax/rules calculation function. The switch has to react on the status of your calculation rule/insurance checkbox. I don't think there is a hook for that yet.
If I would need that, I guess I would ask iStraxx if they could develop a plugin for me or add it to the core to avoid future hickups.

You can probably also achieve the display of that by adding a calculation rule and show the added value only if the checkbox is ticked, but that will be messy with the prices in DB. So I would not recommend to tweak it looking right in the views.
A maybe better idea would be to add a trigger to change the/add a shopper group on checking that checkbox. And then define that rule only for that triggered shopper group.

Just a few ideas thrown in
Stefan