News:

Support the VirtueMart project and become a member

Main Menu

Shopper Fields showing in Bill to Address

Started by nascent, July 15, 2013, 11:16:46 AM

Previous topic - Next topic

nascent

Hi,

Virtuemart 2.0.22
Joomla 2.5.11

I have created several Shopper fields that I want to show on the registration and account administration forms, but do not want to show under the Bill to address in the Account Order Information and Invoices.
I want the bill to address to show the same fields as the ship to address, but different values if the user chooses 2 different addresses.

I have created template overrides of ...path.../components/com_virtuemart/views/orders/tmpl/details_order.php and ...path.../components/com_virtuemart/views/orders/view.html.php
In view.html.php around line 85 is:

$userFieldsModel = VmModel::getModel('userfields');
$_userFields = $userFieldsModel->getUserFields(
'account'
, array('captcha' => true, 'delimiters' => true) // Ignore these types
, array('delimiter_userinfo','user_is_vendor' ,'username','password', 'password2', 'agreed', 'address_type') // Skips
);
$orderbt = $orderDetails['details']['BT'];
$orderst = (array_key_exists('ST', $orderDetails['details'])) ? $orderDetails['details']['ST'] : $orderbt;

I noticed that in the _virtuemart_userfields table the fields that I want to show have a 1 in the 'sys' column, so I tried modifying the above code to


$userFieldsModel = VmModel::getModel('userfields');
$_userFields = $userFieldsModel->getUserFields(
'account'
, array('captcha' => true, 'delimiters' => true, 'sys'=> false) // Ignore these types
, array('delimiter_userinfo','user_is_vendor' ,'username','password', 'password2', 'agreed', 'address_type') // Skips
);
$orderbt = $orderDetails['details']['BT'];
$orderst = (array_key_exists('ST', $orderDetails['details'])) ? $orderDetails['details']['ST'] : $orderbt;



But that had no effect. I also tried adding the list of field names that I didn't want to show to the "//Skips" line, but that didn't work either.
Any suggestions gratefully received.

cheers,
nascent