0

I'm trying to write a really simple module to enforce a maximim order amount and a mimimum time since last purchase on a Drupal 7 site with Ubercart 3.x. I'm tearing my hair out here. Nothing works. I wrote my little module and enabled it. The Devel module picks up traces of it. The only problem is that nothing happens. Right now the code just has the maximum order amount limitation in it, but it doesn't work. What am I doing wrong?

<?php
  function farmers_uc_order($op, $order, $edit) {
    switch ($op) {
      case 'new':
          if ($order->order_total > 50) {
             return array(array(
               'pass' => FALSE,
               'message' => t('We are sorry, but your total order exceeds our $50 limit.  Please remove some items from your cart before checkout.'),
             ));
          }
      break;
    }
  }

1 Answers1

0

Try putting your code in the submit operation instead of new.
I don't see the documentation specify a return value for new operations.

nmc
  • 8,724
  • 5
  • 36
  • 68