After a lot of trouble I finally got a multi product discount to work and show up on the checkout page. However, the site will no longer calculate the shipping options and fees when their is a discount and the form to enter the credit card number is hidden.

Comments

Chad_Dupuis’s picture

Out of curiousity, is your issue the same as mine? - http://drupal.org/node/344579 - Does the order total become a negative number (the total of the discounts, not total - discounts)?

In my case that is what is making the cc greyed out and stopping shipping from working (i.e. the negative total).

jdblank’s picture

I will confirm this later today but I believe in my case the order was a positive number and it seemed to some how be preventing the FedEx code to get the shipping costs (it does this in an ajax sorta way).

Chad_Dupuis’s picture

I think I might have a fix for you if my assumption was even close to correct. It's in one of the patches for the 6.x branch that never got into the 5.x branch involving a call to getTax - if taxes are not applicable or you don't have it enabled at all the whole total price function fails. Correct the lines in uc_discounts.module around line 336 made everything work for me....... I'll try to write a patch and get it submitted, but for now you can change the code to match the following:

      $script = "set_line_item('discounts', '". t('Discounts') ."', $discount_total, -1)";
      drupal_add_js('$(document).ready( function() { 
        '. $script .' 
        if (window.getTax) {
          getTax();
        }
        else if (window.render_line_items) {
          render_line_items();
        }
      });', 'inline');
      break;
  }
}
jdblank’s picture

This appeared to do it! Thank you so much. I really appreciate it.