Author Topic: cart fields  (Read 239 times)

jimpett81

  • Jr. Member
  • **
  • Posts: 66
  • A beginner
  • Skype Name: jimstomp
cart fields
« 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

lindapowers

  • Full Member
  • ***
  • Posts: 1340
  • If you're going through hell, keep going.
    • Venta de naranjas online y mandarinas
  • Skype Name: manu.gonzalez91
  • VirtueMart Version: Latest avi
Re: cart fields
« Reply #1 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
http://www.comenaranjas.com - Navel oranges and clementines from Spain

GJC Web Design

  • 3rd party VirtueMart Developer
  • Hero Member
  • *
  • Posts: 7483
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 2.6.22 & 3.2.2
Re: cart fields
« Reply #2 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]
GJC Web Design
VirtueMart and Joomla Developers - php developers http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation