Web Design Glasgow

Web Design: Stylish, Flexible & Bespoke

Web Hosting Glasgow

Web Hosting: Carbon Neutral, Fast & Reliable

IT Support Glasgow

IT Support: Quality Advice, support & Delivery

Print
PDF

Virtuemart : Discount Notification

User Rating: / 1
PoorBest 

Create a call to the database to find out a users Shopper Group

$user =& JFactory::getUser();
$userId = $user->get( 'id' );
//add database  $database =& JFactory::getDBO();
// find user's Shopper Group
if ($userId != 0) {                   $qshoppersgroup = "SELECT `shopper_group_id` FROM `#__{vm}_shopper_vendor_xref` WHERE `user_id`='".$userId."'";
//load results into an object refrence
$o = $db->loadObject();
//retrieve value and place in var
$shoppergroup = $o->shopper_group_id;

Use the shopper group to compare against your chosen group. If they are the same notify user of applied discount

If $shoppergroup = "Members" {
echo ''You are receiving the member's discount';
} 

//RECENT WORK

RedbagUK New Website

RedbagUK

Discover the latest men's clothing and accessories online with RedBagUK.

Learn More
Oasis Skincare Centre

Oasis Skincare

Oasis provides Dermalogica Products to the UK

Learn More
spotlight

Allan Nisbet

Director | Glasgow, UK

Storm Tweet

Fraser IT Engineer

Fraser

IT Engineer | Glasgow, UK

Storm Tweet