News:

Looking for documentation? Take a look on our wiki

Main Menu

display first name and last name in custom module

Started by jankoo, December 19, 2020, 01:21:20 AM

Previous topic - Next topic

jankoo

hi.
im trying to create custom module to display customer first and last name after login..

i found this topic for vm1 - http://forum.virtuemart.net/index.php?topic=79226.0

but when i use the code from @expertslogic i get the error "Class 'ps_user' not found"

can anyone point me to right direction how can i connect to vm user fields from custom module?

thanks a lot

jenkinhill

Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

jankoo

yes, loged user.
but i need data from virtuemart fields firstname and lastname..
these standard joomla im able to show..
i just need what class to load so i have access to those vm fields..

GJC Web Design

Class 'ps_user' is from VM1

if (!class_exists( 'VmConfig' )) require(JPATH_ROOT .'/administrator/components/com_virtuemart/helpers/config.php');
VmConfig::loadConfig();
$userModel = VmModel::getModel('User');

use a function from there

e.g.

$userModel->getCurrentUser();

untested
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

jankoo