Author Topic: Custom Text for shopper group  (Read 209 times)

fabioweb

  • Jr. Member
  • **
  • Posts: 132
Custom Text for shopper group
« on: July 05, 2018, 15:21:11 pm »
Hello, in my 3.2.14 virtuemart store i need to display some text only for shopper group "rivenditore"
In short i have two main shoppers group: "Cliente" and "Rivenditore"

Once a user is logged in and is "Rivenditore" i need to load some text somewhere into the website
if user is logged in and is "Cliente" the same text will not displayed

Is it possible?

Best regards

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 8413
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 2.6.22 & 3.2.14
Re: Custom Text for shopper group
« Reply #1 on: July 05, 2018, 18:07:00 pm »
Get shopper Group

$userModel = VmModel::getModel('user');
$vmuser = $userModel->getCurrentUser();
$vmgroup = $vmuser->shopper_groups;

//$vmgroup is an array
GJC Web Design
VirtueMart and Joomla Developers - php developers http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 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
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 3458
  • Joomla & Virtuemart addon developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3.0.x.y
Re: Custom Text for shopper group
« Reply #2 on: July 05, 2018, 22:14:03 pm »
If you manually set user shopper groups, you can use Joomla user groups restrictions to display a module an affiliate the users in "rivenditore" to this group.
This need one step more, but it's very more flexible after(you can add new menus for eg. Restricted acces to some pages ...)