We're trying to figure out a way to offer customers free shipping coupons. That is, create a coupon where the discount only goes toward the shipping cost. And we use UPS.

Ideally we'd like to be able to:

1. Offer a coupon for $100 off shipping and it can be applied to any order. (but can only be applied to shipping, not to the rest of the order)
2. Offer a "free shipping" coupon that just zeros out the shipping total

Any ideas would be greatly appreciated (and I'm sure useful to others going forward)!

We're using the following modules:

Ubercart
uc_ajax_cart
uc_coupon
uc_option_image
uc_out_of_stock
uc_store_credit
userpoints

Comments

duckydan’s picture

I am in exactly the same boat. I need a coupon to give 100% discount and free shipping. My customer provides free samples of product to key decision makers in the hopes they will order more. I got the 100% discount coupon, but the shipping still shows up.

Dan Eveland

datarazor’s picture

same need here. scrubbing.

schedal’s picture

bump.

ahimsauzi’s picture

Totally in need subscribing!

JoshW’s picture

has anyone figured this out yet?

bkosborne’s picture

I am also interested

novice’s picture

I modified the dev branch of uc_coupon to be able choose a coupon in the conditional actions. Also it fixes a minor bug which was preventing to look at coupon use reports. With the patch in place, now you can create a free shipping coupon using following steps:

1. Create a coupon let's say FREESHIP100 and make the discount to be 0.00 dollars and conditional upon 100 dollars or above.
2. Create a Flat rate shipping with 0.00 shipping cost and apply the conditions that amount is above 100 dollars and a coupon FREESHIP100 is applied.
This will automatically create a shipping choice when both minimum amount and coupon applied are met.

The only issue I see is that it does show a 0.00 dollar coupon discount in addition to free shipping. It is aminor annoyance, but the whole thing works. It is based upon the patch in Ubercart discount module (alt) patch.


diff -Naur uc_coupon-6.x-1.x-dev/uc_coupon.ca.inc uc_coupon/uc_coupon.ca.inc
--- uc_coupon-6.x-1.x-dev/uc_coupon.ca.inc	2010-12-06 14:28:06.000000000 -0600
+++ uc_coupon/uc_coupon.ca.inc	2010-12-06 14:30:42.000000000 -0600
@@ -47,7 +47,18 @@
  * Check if an order has a coupon applied.
  */
 function uc_coupon_condition_order_has_coupon($order, $settings) {
-  return isset($order->data['coupon']);
+ if (isset($_SESSION['uc_coupon'])) {
+	if (empty($settings['cid'])) {
+		return True;
+	}
+	$result = db_query("select * from uc_coupons where code = '" . $_SESSION[uc_coupon] . "'");
+	while ($coupon = db_fetch_object($result)) {
+		if (in_array($coupon->cid, $settings['cid'])) {
+			return True;
+		}
+	}
+ }
+ return False;
 }
 
 /**
@@ -56,3 +67,23 @@
 function uc_coupon_condition_is_bulk($coupon, $settings) {
   return $coupon->bulk;
 }
+
+function uc_coupon_condition_order_has_coupon_form($form_state, $settings = array()) {
+  $form = array();
+
+  $result = db_query('SELECT * FROM {uc_coupons} ORDER BY code');
+  while ($coupon = db_fetch_object($result)) {
+    $options[$coupon->cid] = $coupon->code;
+  }
+
+  $form['cid'] = array(
+    '#type' => 'select',
+    '#title' => t('Coupon'),
+    '#options' => $options,
+    '#multiple' => TRUE,
+    '#default_value' => $settings['cid'],
+    '#description' => t('Select the coupon which, if the user has successfuly applied them to their order, should trigger this condition.'),
+  );
+
+  return $form;
+}
\ No newline at end of file
diff -Naur uc_coupon-6.x-1.x-dev/uc_coupon.reports.inc uc_coupon/uc_coupon.reports.inc
--- uc_coupon-6.x-1.x-dev/uc_coupon.reports.inc	2010-12-06 14:28:07.000000000 -0600
+++ uc_coupon/uc_coupon.reports.inc	2010-12-06 05:56:56.000000000 -0600
@@ -4,6 +4,8 @@
 /**
  * Coupon report options form.
  */
+
+require_once 'uc_coupon.admin.inc';
 function uc_coupon_reports_form(&$form_state, $start = NULL, $end = NULL, $statuses = NULL) {
   if (is_null($start)) {
     $start = time();
reinvented’s picture

You write:

Create a coupon let's say FREESHIP100 and make the discount to be 0.00 dollars and conditional upon 100 dollars or above.

And yet with 6.x-1.5 (at least), when I enter "0" or "0%" in the "Discount" field, I get a "Invalid discount." upon saving, presumably because either value fails this test:

  if (!preg_match('/^[1-9]\d*(\.\d+)?%?$/', $form_state['values']['discount'])) {
    form_set_error('discount', t('Invalid discount.'));
  }

How can I create a coupon of 0.00 value as you suggest you were able to do?

mcfilms’s picture

Have you seen the thread at:
http://drupal.org/node/960572

The attached patch adds a new conditional action to "Check if a discount has been applied to an order." This allows for a shipping quote to be given based on what discount codes a user has entered. It does this by saving the discount codes entered in a session variable.

A list of some of the Drupal sites I have designed and/or developed can be viewed at motioncity.com

dcarr’s picture

I tried using this conditional action in my FREE flatrate shipping, but on the checkout screen, if I apply the coupon code to activate it, it won't load in my shipping options?? Not sure if I'm doing something wrong??

platypus media’s picture

I just changed the 1 to a 0, and it seems to work for me. My regex is pretty poor, so that might not be the right way to do it, but it worked.

bruiseviolet’s picture

This is great and all, but honestly how many e-commerce sites have ONE flat rate shipping method? It costs us 3-4x as much to ship international (not to mention priority and express shipping options). Would love a way to offer a coupon that would just zero out the shipping costs- whether they are going domestic or international if their order is over a certain amount.

Giving a coupon discount of 4.99 is great- it zeros out the domestic orders- but doesn't zero out for international orders. If we do a coupon code discount for international of 14.99- then we just get domestic customers using the coupon codes to get 14.99 off of their order.

bruiseviolet’s picture

In my head it seems like the solution would be a code that would look at whatever value is displayed in "standard shipping & handling" (or whatever you have it named on your site) and subtract that amount as the coupon code. ??

mattcasey’s picture

I set this up with Alternative Discounts in D6. First, create a discount - doesn't matter what options you set. You then need to have to a "Free Shipping" shipping method, and in Conditional Actions you can add a condition: "Check if a discount has been applied to the order." Choose the discount you just created.

Mike Kelley’s picture

I will take a shot at these extensions. Coupons availability must be visible always.