Author Topic: Show Custom User Fields in module?  (Read 2829 times)

michigansignshops

  • Beginner
  • *
  • Posts: 5
Show Custom User Fields in module?
« on: November 11, 2011, 01:59:45 am »
I'm in need of a custom module as part of a virtuemart site I'm developing that will display selected Custom User Fields so the end user can see that info while they browse the site. (For example, the end user has a set color palette that they fill out on their account page so they don't have to enter it in for every product, and this information is viewable in a seperate column that is viewed globally on the site -- even outside of VirtueMart pages.)

How does the PHP code need to be formatted to pull that specific information from the database?

Thank you!

MikeUK

  • Global Moderator
  • Full Member
  • *
  • Posts: 1344
Re: Show Custom User Fields in module?
« Reply #1 on: November 12, 2011, 17:33:44 pm »
This would require PHP development knowledge. You didn't state what you skill level is, and the question you are asking is perhaps too general. If you are able to give this a go, and can describe and post code that you think you are having difficulty with, others may be able to help.

If you're not experienced with PHP, you'll need someone to do this for you I would think. From what you have said, you'll also need some modification to enable using this user info at the product stage.
Get answers faster:

I can build your online shop, setup or customize Virtuemart or help your existing shop maximize its potential. Email / PM for info

michigansignshops

  • Beginner
  • *
  • Posts: 5
Re: Show Custom User Fields in module?
« Reply #2 on: November 14, 2011, 22:21:56 pm »
My PHP skill is pretty rudimentary -- I'm usually able to reverse-engineer working PHP code but I'm coming up empty when trying to get it to work in this case.
What I'm trying to do is take the information stored in some Virtuemart Custom User Fields I've created and have them display for that user in a module in the right column of the site, globally (whether or not the user is a virtuemart area of the site or not.)

The store I'm building out is for schools -- schools that have a set mascot, color palette, motto, etc.. These items would be included on the products they order (though not all). The module displaying that data would be a visual reminder of how their product will be handled (color-wise, most importantly) without the need to enter in their color selections with every single product order. It doesn't interact with virtuemart at all other than just displaying the custom field data from the form.

I customized the custom user fields to include a checkbox color picker and it's working wonderfully, so that part is all set. Now I just need that data to display in a separate module (just the text of the color, not necessarily the color itself.)

Getting the module to display for the user I don't forsee as a problem -- I was planning on running the custom script (if it's not an actual Joomla module itself, which would be amazing!) inside the Jumi 3rd party module and then limit the visibility of the module to its intended user via the Advanced Module Manager. A roundabout way of doing it, to be sure, but I'm not sure of any other options without a completely custom-built module. (Which I'd be willing to pay for if it works as intended.)

MikeUK

  • Global Moderator
  • Full Member
  • *
  • Posts: 1344
Re: Show Custom User Fields in module?
« Reply #3 on: November 15, 2011, 04:10:48 am »
.................. schools that have a set mascot, color palette, motto, etc.. These items would be included on the products they order (though not all). The module displaying that data would be a visual reminder of how their product will be handled (color-wise, most importantly) without the need to enter in their color selections with every single product order. It doesn't interact with virtuemart at all other than just displaying the custom field data from the form.

Well, I'd say it does need to interact with Virtuemart, because surely you'd want the cart to pick up these elements as if they were attributes? I would say this is the bigger part of the project.

I customized the custom user fields to include a checkbox color picker and it's working wonderfully, so that part is all set. Now I just need that data to display in a separate module (just the text of the color, not necessarily the color itself.)

If jumi doesn't do what you nees, you could try the Commercial Jobs section to get developer help with this.
Get answers faster:

I can build your online shop, setup or customize Virtuemart or help your existing shop maximize its potential. Email / PM for info

michigansignshops

  • Beginner
  • *
  • Posts: 5
Re: Show Custom User Fields in module?
« Reply #4 on: November 23, 2011, 22:33:01 pm »
Thanks for the reply! After discussing the function of the module with others involved in the project I do believe we want them to run separate of eachother... The role of the module itself is to just query the {vm}_user_info database table and display some of the user's info inside the module as a constant visual reference.

For instance, there's a few custom fields I created in Virtuemart for school colors, school mascot, etc. (the "company" entry is now the school's name). All I'm looking to do (inside a Jumi module since I can run the code from there) is show that information. I've tried a variety of ways to get it to properly query the database, but it either ends in a PHP error screen or nothing displays at all.

How would I do this?

As an aside, on the account.index page I'd love to show the "company" field along with the user's "first_name" and "last_name", but have come up empty there as well.

michigansignshops

  • Beginner
  • *
  • Posts: 5
Re: Show Custom User Fields in module?
« Reply #5 on: November 30, 2011, 01:53:43 am »
Anyone with any feedback/ideas?