News:

Looking for documentation? Take a look on our wiki

Main Menu

Hide/Show Shopper Fields won't work

Started by Nepol, October 28, 2013, 02:11:20 AM

Previous topic - Next topic

Nepol

Hi, I'm using VM 2.0.22a & Joomla! 2.5.14.

I'm trying to control the Shopper Fields shown in the VM Registration Form & Shippment Form via the backend and I can't achieve this.

I have some fields disabled in "Registration Form" & "Shippment Form" and they still show... The only thing that works is disabling/enabling in "Maintenance Form".

There is an attachment with the evidence of the error.

Thank you very much!



[attachment cleanup by admin]


escozul

Really this should bug us. I have the same issue. Doesn't anyone know how to resolve this? latest Virtuemart 2.0.26d has the same issue!


escozul

After further digging in, it seems that the "show in registration" field only responds to the registration during checkout operation.
Not sure about that though since I only have a catalogue site

It seems that the display in account maintenance field is the one that hides the field. It hides it! You cannot use it anymore after you register and go to account edit screens.

So actually that unpublishes the item

I would love to know which file controls the look of the account maintenance screen and how I could edit the code there to hide the fields that have the "show in registration" flag set to "unpublished" and at the same time the user is "guest". That way the fields in the account maintenance screen will hide the ones we don't want unregistered users to see and will display them when someone logs in.

escozul

Ok so the file that generates the form in the edit account screen is edit_address_userfields.php.

Now we need to find out how to ask it to ignore the fields that are hidden from registration, and do that ONLY when the user is GUEST.

I need help with that...

Nepol


Nepol

#7
I actually attempted this before, I didn't remember.

In that file we can't do the trick unfortunately because the function userFields() returns the fields without the permission settings (meaning there is no variable that indicates if the field is disabled for registration or not).

Not only that but I hardcoded an IF() telling the ID of the fields I didn't wanted to show, and of course that worked but when I submitted the form it gave me an error saying not all required fields were completed (my fields are required, as shipping fields tend to be).

The magic must happen at the function userFields(), but thats probably in a model or a helper and you'll have to hack the core files or use a plugin that lets you override models and helpers (which is not easy to setup, I tried MVC and it gives me a lot of issues with VM).

So... We requiere help from VM so they can look at the issue u.u

escozul

!!!

I must say that something so basic!!! I'm amazed that we fail to find a solution.

Anyway is there a way to make the address fields unnecessary and then add an if statement that removes just the fields we don't need? But that if statement needs to check if the user is GUEST so that the fields reappear when the user actually tries to access his account.

That if statement you say you used might help me to get a working solution untill a better resolution from virtuemart arrives. Could you guide me through?