Author Topic: "Show in registration form" not work  (Read 902 times)

planticinal

  • Beginner
  • *
  • Posts: 8
  • Skype Name: jeromefontaineluxembourg
"Show in registration form" not work
« on: May 12, 2015, 14:01:56 pm »
Created new simple text field and even if "Show in registration form" is disabled (red) and "Show in account maintenance" is enabled (green) it still shows in registration form.
This is a bug or not?

Help me please, thanks

VM 2.6.10
Joomla 2.5.27


planticinal

  • Beginner
  • *
  • Posts: 8
  • Skype Name: jeromefontaineluxembourg
Re: "Show in registration form" not work
« Reply #1 on: May 18, 2015, 12:47:45 pm »
I think have the solution, at least to me it has worked and do not know if it can be modified for later versions

file:/administrator/components/com_virtuemart/models/userfields.php
line:493 to 506

Change this code
Code: [Select]
  //Here we get the fields
  if ($type == 'BT') {
      $userFields = $this->getUserFields(
      'account'
      , array() // Default toggles
      , $skips// Skips
      );
  } else {
   $userFields = $this->getUserFields(
     'shipment'
   , array() // Default toggles
   , $skips
   );
  }

For this code
Code: [Select]
  //Here we get the fields
  if ($type == 'BT') {
            if(!$register) {
                $userFields = $this->getUserFields(
                    'account'
                    , array() // Default toggles
                    , $skips// Skips
                );
            }
            else {
                $userFields = $this->getUserFields(
                    'registration'
                    , array() // Default toggles
                    , $skips// Skips
                );
            }
  } else {
   $userFields = $this->getUserFields(
     'shipment'
   , array() // Default toggles
   , $skips
   );
  }

What do you think the solution?