News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Picture above the product list

Started by fsgfsg, August 14, 2014, 16:11:29 PM

Previous topic - Next topic

fsgfsg

Hi!
How can I add a picture (text or slideshow) on the top of the pages with the products list, in the VM frontend, but to be visible only to a shoppers group?

I found a way to add these, so that everyone can see it. But how can it be be visible only to a shoppers group?
Thank you!

mowlman

I have special shopper groups that I want to display a special message to once they log in

I use Advanced Module Mananager....http://www.nonumber.nl/extensions/advancedmodulemanager
to control what modules and when they should be displayed.



Then within the Custom PHP option I entered a check for my special shopper groups:


$db = JFactory::getDbo();
$user = JFactory::getUser();
$user1 = ($user->get(id));
$query = 'SELECT virtuemart_shoppergroup_id FROM #__virtuemart_vmuser_shoppergroups WHERE virtuemart_user_id ='. $user1 ;
$db->setQuery($query, 0, 10);
$Logged_in_shopper_grp_id = $db->loadResult();
if ( $Logged_in_shopper_grp_id == 4 ) { /* Contractor 1 */     return true;}
elseif ( $Logged_in_shopper_grp_id == 5 ) { /* Contractor 2 */ return true;}
elseif ( $Logged_in_shopper_grp_id == 7 ) { /* Contractor 3 */ return true;}
else return false; /* Do NOT display this module */



For the way I have it coded, you will need to know the shopper group id from the table.  You can log into Cpanel and use myPHPAdmin to view and look at virtuemart_shoppergroups table

fsgfsg

Thank you so much for this information!!!
I also would like to have a "message" that stays on top of the page of each product category.
Because in each category it would be different.

GJC Web Design

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

fsgfsg

GJC you mean that the category description can be visible if I want to a specific shoppers group?

GJC Web Design

surround the cat desc in the category template in the same if code as mowlman supplied (although there must be a shoppers group model somewhere to use)
if the shopper group is correct -> display
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

fsgfsg