Hello, i am afraid that automatic coupopn assignment would not be used by many customers. If you want a coupon to be automatically added, you can add it in any enabled system plugin in:
- Code: Select all
function onAfterRoute() {
....
// you can filter it to VM pages only:
if (JRequest::getCmd('option') == 'com_virtuemart')
{
// will get autocoupon=1 from the url
$x = JRequest::getVar('autocoupon', 0);
if ($x)
{
// if you want a particular coupon, you'd have to query it by
// $dbj=JFactory::getDBO(); $q = 'select coupon_code from #__something where id = '.(int)$someid..... $db->setQuery($q); $cc = $db->loadResult();
if (empty($_SESSION['coupon_code']))
$_SESSION['coupon_code'] = 'your awo coupon code';
}
}
// thus it will automatically be used in the cart
}
The code is no way complete and may contain errors.
You can download my currency plugin, which redirects the old checkout.index page to OPC's shop.cart page and add it there.
Best Regards,
Stan