Discounts not working with FedEx module
jdblank - December 9, 2008 - 05:32
| Project: | UC Discounts |
| Version: | 5.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
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.

#1
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).
#2
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).
#3
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;
}
}
#4
This appeared to do it! Thank you so much. I really appreciate it.