News:

Looking for documentation? Take a look on our wiki

Main Menu

Trigger Coupon Automatically (Plugin)

Started by seyi, June 25, 2012, 18:31:23 PM

Previous topic - Next topic

seyi

This is a Virtuemart 2 Plugin.

Automatically trigger a coupon code when a product is added to the shopping cart.

Its very simple, install the plugin, enable it, and enter the coupon code you want to be automatically triggered. If a coupon code already exists in the cart, the auto coupon code is not run.

http://awodev.com/products#plg_awocoupontrigger
Seyi A
--------------------
Promotion enhancement for Virtuemart:
   - AwoCoupon FREE - http://www.awocoupon.com/starter
   - AwoCoupon Pro - http://awodev.com/products/joomla/awocoupon
   - AwoRewards - http://awodev.com/products/joomla/aworewards
   - AwoAffiliate - http://awodev.com/products/joomla/awoaffiliate

alin09ro

it's a great plugin but it needs some options:

- when you update the quantity the plugin doesn't load/unload the coupon
- should have the option to select multiple coupons and apply them based on cart total value

seyi

Thanks for the feedback.  I fixed the update/delete problem.  It would be best to uninstall the previous version before installing this one as it is no longer a vmpayment plugin, it is now a system plugin.  To your other points:
1) cart total value - this can already be set up within the coupon you are creating, it would be redundant to add this feature
2) multiple coupons - this is not something supported by Virtuemart, it will only allow one coupon at a time so not sure it is very useful
Seyi A
--------------------
Promotion enhancement for Virtuemart:
   - AwoCoupon FREE - http://www.awocoupon.com/starter
   - AwoCoupon Pro - http://awodev.com/products/joomla/awocoupon
   - AwoRewards - http://awodev.com/products/joomla/aworewards
   - AwoAffiliate - http://awodev.com/products/joomla/awoaffiliate

wtkagb

Can you apply this to more than 1 coupon?

I have several coupons that I would like to auto trigger

seyi

Hi,

Virtuemart coupon system is built to accept just 1 coupon code, so even if there was a box for 2, it will only accept the first one.

If you need that functionality, then AwoCoupon pro will allow this through parent coupons.
Seyi A
--------------------
Promotion enhancement for Virtuemart:
   - AwoCoupon FREE - http://www.awocoupon.com/starter
   - AwoCoupon Pro - http://awodev.com/products/joomla/awocoupon
   - AwoRewards - http://awodev.com/products/joomla/aworewards
   - AwoAffiliate - http://awodev.com/products/joomla/awoaffiliate

baggiesmad

Quote from: seyi on June 25, 2012, 18:31:23 PM
This is a Virtuemart 2 Plugin.

Automatically trigger a coupon code when a product is added to the shopping cart.

Its very simple, install the plugin, enable it, and enter the coupon code you want to be automatically triggered. If a coupon code already exists in the cart, the auto coupon code is not run.

http://awodev.com/products#plg_awocoupontrigger

Installed this, works fine apart from the discount being applied to the final price, it doesnt actually display a notification that the customer is saving or that there has been a discount applied?

seyi

Hello,

No, it does not display a message when a coupon is added to the cart.  But I think its easy enough

in www/plugins/system/awocoupontrigger/awocoupontrigger.php, around line 34 is this

<?php
$cart->setCouponCode($coupon_code);
$cart->getCartPrices(); // needed it to fix the cart prices

?>



Change it to this

<?php
$orig_code $cart->couponCode;
$msg $cart->setCouponCode($coupon_code);
$cart->getCartPrices(); // needed it to fix the cart prices
if(empty($orig_code) && !empty($msg)) {
JFactory::getApplication()->redirect(JRoute::_('index.php?option=com_virtuemart&view=cart'FALSE),$msg);
}
?>

Seyi A
--------------------
Promotion enhancement for Virtuemart:
   - AwoCoupon FREE - http://www.awocoupon.com/starter
   - AwoCoupon Pro - http://awodev.com/products/joomla/awocoupon
   - AwoRewards - http://awodev.com/products/joomla/aworewards
   - AwoAffiliate - http://awodev.com/products/joomla/awoaffiliate