I was wondering if it would be possible to use chrono forms as a way to update the shopper group? I currently have it set up as a coupon code that updates that database so that default users can input this code and change to a discount gold group so I don't have to manually do it each time.
I would like do this in a form that you just use a text box and hit submit to change your shopper group.
Thank you for any info you might have!
I would like do this in a form that you just use a text box and hit submit to change your shopper group.
<?php
if( !defined( '_VALID_MOS' ) && !defined( '_JEXEC' ) ) die( 'Direct Access to '.basename(__FILE__).' is not allowed.' );
class ps_coupon extends vm_ps_coupon {
function process_coupon_code( $d ) {
$retval=vm_ps_coupon::process_coupon_code($d);
$user =& JFactory::getUser();
if($d['coupon_code']=="password here" && $user->id > 0 ) {
$d['shopper_group_id']="6";
$user =& JFactory::getUser();
$db =& JFactory::getDBO();
$q = "UPDATE #__vm_shopper_vendor_xref SET `shopper_group_id` = '6' WHERE `user_id` =".$user->id." LIMIT 1";
$db->setQuery($q);
$db->query();
}
}
}
?>
Thank you for any info you might have!