Hello
I am not good enough in PHP. Please help.
I have additional user-fields like ROOM and others...
I need to display in confirmation mail value of field ROOM from DB if value is not empty (if user is filled in some data)
How to do it?
This has been explain on here b4.. please use the search
basically the display in the email just uses a loop
you have to do a check on each value inside the loop
i.e if(!empty($value->my_value)){
echo $value->my_value;
}
After a lot of hour I found solution, but I cannot order them in my needs. They are displayed in mail in order set in VM Shopper Field List configuration
It there a way to order them?
The code and order is shown below but order is messed up in confirmation e-mail. I found this but I cannot modify it for my needs: http://forum.virtuemart.net/index.php?topic=131881.msg455400#msg455400
<?php
foreach ($this->userfields['fields'] as $field) {
if (!empty($field['value'])) {
if ($field['name']=='first_name') {
echo $field['value'];
}
if ($field['name']=='middle_name') {
echo ' ' . $field['value'];
}
if ($field['name']=='last_name') {
echo ' ' . $field['value'] . '<br/>';
}
if ($field['name']=='phone_2') {
echo 'Телефон: ' . $field['value'] . '<br/>';
}
if ($field['name']=='virtuemart_hood_id') {
echo 'кв. ' . $field['value'] . ', ';
}
if ($field['name']=='virtuemart_street_id') {
echo 'ул. ' . $field['value'] . ', ';
}
if ($field['name']=='virtuemart_block_id') {
echo 'бл. ' . $field['value'] . ', ';
}
if ($field['name']=='virtuemart_entrance_id') {
echo 'вх. ' . $field['value'] . ', ';
}
if ($field['name']=='virtuemart_floor_id') {
echo 'ет. ' . $field['value'] . ', ';
}
if ($field['name']=='virtuemart_apartament_id') {
echo 'ап. ' . $field['value'];
}
if ($field['name']=='zip') {
echo '<br/>' . $field['value'] . ' ';
}
if ($field['name']=='city') {
echo $field['value'] . '<br/>';
}
}
}
?>