VirtueMart Forum

VirtueMart 2 + 3 + 4 => Administration & Configuration => Topic started by: jimpett81 on March 10, 2017, 17:41:30 PM

Title: cart fields
Post by: jimpett81 on March 10, 2017, 17:41:30 PM
Hi,

I have a rather unique request/need that I am hoping you can assist with.

We are looking to use sagepay in our cart - which on the face of it is fine -but I have an issue with the cart fields.

We only use a full name field in the cart and sagepay needs a first and second name to process payments.

Also our backend system needs the full name field to process the orders in to the database.

Could we have a system that separates the name field in to first and second name and puts them in to the two fields that sage require?

I realise this is a little odd but the only other solution I can see is having all three fields in the cart, I am open to any suggestions that allow me to get this to work.

Thanks,

James
Title: Re: cart fields
Post by: lindapowers on March 10, 2017, 21:49:11 PM
If you use CSVIpro there is an option to combine different fields in to one or completely the opposite so maybe you could play with it to achieve what you want.

We combine first and second name for our exported file for shipment.

Ofc this depends if exporting the orders to CSV or XML if not I believe you should modify the payment plugin to create the same effect and never change the VM core.

Regards
Title: Re: cart fields
Post by: GJC Web Design on March 10, 2017, 22:36:57 PM
it is a bit hit and miss ( what happens when they fill in George W. Bush for example) so you need to "prepare" the $vm_full_name..
e.g. remove all but the last space
but in your Sage pay

$names = explode(' ',$vm_full_name);

then first is $names[0]  and last is names[1]