VirtueMart Forum

VirtueMart 2 + 3 + 4 => Plugins: Payment, Shipment and others => Topic started by: maxxer on June 24, 2013, 10:12:51 AM

Title: Store additional payment info in the cart?
Post by: maxxer on June 24, 2013, 10:12:51 AM
Hi.
I'm trying to develop a custom shipment plugin. I need to store a checkbox value into the shipment options. In my table definition I created this element, and it gets created correctly. The problem is: how do I handle this information in cart?

According to administrator/components/com_virtuemart/plugins/vmpsplugin.php:onSelectCheck the method, and its relative plgVmOnSelectCheckShipment for shipment plugins, can be used to (quoting dev comments) 
QuoteThis event is fired after the shipment method has been selected. It can be used to store additional payment info in the cart
(weight_countries.php and vmpsplugin.php).

Now that I'm reading the code I'm having troubles in understanding WHERE this additional information can be stored. The VirtueMartCart model doesn't seem to have room for adding this information.

Did I miss something?
thanks
Title: Re: Store additional payment info in the cart?
Post by: K&K media production on June 25, 2013, 21:38:44 PM
you must store it in extra shipment plugin table like #__virtuemart_shipment_plg_weight_countries
Title: Re: Store additional payment info in the cart?
Post by: maxxer on June 26, 2013, 08:45:10 AM
I know that, thanks, but during the purchase you have no way to store this information.

When the user chooses the shipping  the plgVmOnSelectCheckShipment method is called. In that method you only have the VirtueMartCart object, which AFAIK doesn't have room to store additional information. How do I bring my additional information from the shipment selection page to the order store, where that table is written?

thanks
Title: Re: Store additional payment info in the cart?
Post by: K&K media production on June 26, 2013, 21:21:05 PM
Take a look to the other plugins. Maybe payment plg authorizenet...there are input fields

and take a look here
http://dev.virtuemart.net/projects/virtuemart/wiki/Shipper_Plugins
Title: Re: Store additional payment info in the cart?
Post by: alatak on June 27, 2013, 11:20:47 AM
Hello
QuoteI'm trying to develop a custom shipment plugin. I need to store a checkbox value into the shipment options. In my table definition I created this element, and it gets created correctly. The problem is: how do I handle this information in cart?

You can save the infos in the session for example.
Title: Re: Store additional payment info in the cart?
Post by: maxxer on June 28, 2013, 09:12:55 AM
Quote from: kkmediaproduction on June 26, 2013, 21:21:05 PM
Take a look to the other plugins. Maybe payment plg authorizenet...there are input fields

and take a look here
http://dev.virtuemart.net/projects/virtuemart/wiki/Shipper_Plugins
thanks for the suggestion, I will check out. In the meantime I already implemented using session, but I didn't like the solution.