VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: planticinal on May 12, 2015, 14:01:56 PM

Title: "Show in registration form" not work
Post by: planticinal 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

Title: Re: "Show in registration form" not work
Post by: planticinal 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

  //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

  //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?