VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: psm on May 02, 2017, 22:57:45 PM

Title: Delete address nickname from shipto address fields
Post by: psm on May 02, 2017, 22:57:45 PM
Dear all,
please how could I delete address nickname from shipto formular on checkout page? When I do it in configuration->shopper field then I cannot update shipto address formular, it is not possible to save it.

Thank you very much.
Title: Re: Delete address nickname from shipto address fields
Post by: GJC Web Design on May 02, 2017, 23:00:29 PM
if u remove it how will users set/use multiple shipping addresses?

if this doesn't matter just hide it with css
Title: Re: Delete address nickname from shipto address fields
Post by: psm on May 03, 2017, 18:25:35 PM
I think just small amount of people will use this option. Please how can I hide it by css? Where I can find this css?

Thank you
Title: Re: Delete address nickname from shipto address fields
Post by: psm on May 03, 2017, 21:32:16 PM
I have it. Thank you. I set id #shipto_address_type_name_field in onepage_generic folder css file as:

#shipto_address_type_name_field
{
display:none;
visibility:hidden;
}

Thanks for help.
Title: Re: Delete address nickname from shipto address fields
Post by: psm on May 03, 2017, 22:14:53 PM
Dear all,
I have another problem, that I cannot hide the same field (address nickname) in invoice. Do you have any suggestions?

Thanks.
Title: Re: Delete address nickname from shipto address fields
Post by: GJC Web Design on May 03, 2017, 23:06:20 PM
there u have to remove it in the invoice template by looping the fields and remove what u don't want

over ride components\com_virtuemart\views\invoice\tmpl\mail_html_shopperaddresses.php
Title: Re: Delete address nickname from shipto address fields
Post by: psm on May 04, 2017, 22:29:35 PM
If I understand well I should modify this code and replace $field['title'] and $field['value'] by some specific itmes (family_name, etc). Is it like this? If yes, where can I find how to define specific item instead of value or title, pls?

<?php
       foreach ($this->shipmentfields['fields'] as $field) {
      if (!empty($field['value'])) {
          echo '<tr><td class="key" align="left"><strong>' . $field['title'] . ':</strong></td>'
          . '<td>' . $field['value'] . '</td></tr>';
      }
       }
?>

Thanks
Title: Re: Delete address nickname from shipto address fields
Post by: GJC Web Design on May 04, 2017, 22:56:23 PM
check the name with another "if" .. if it isn't what you want echo nothing
Title: Re: Delete address nickname from shipto address fields
Post by: psm on May 05, 2017, 20:50:40 PM
Thank you very much. I add this condition  if($field['title']!="Názov (značka)"){
to this code below and now it is working well. 

<?php
       foreach ($this->shipmentfields['fields'] as $field) {
      if (!empty($field['value'])) {
          if($field['title']!="Názov (značka)"){
          echo '<tr><td class="key" align="left"><strong>' . $field['title'] . ':</strong></td>'
          . '<td>' . $field['value'] . '</td></tr>';
      }
      }
       }
       ?>
Title: Re: Delete address nickname from shipto address fields
Post by: GJC Web Design on May 05, 2017, 21:48:25 PM
well done

might be better to test the $field['name'] as this will be code friendly
Title: Re: Delete address nickname from shipto address fields
Post by: psm on May 05, 2017, 22:20:10 PM
Changed, thanks again. ;)