Hey guys,

When Ubercart creates the list of all panes to be displayed on the cart page, it will automatically call the hook 'uc_discounts_cart_pane' and then check to output it or not. Anyway, it's too late because the hook was called and adds inline javascript to insert discount information in the cart pane.

I think we should at least, add a condition whether to add or not the javascript in function of admin settings:

  //Write table using javascript between items and cart form buttons
  if(variable_get('uc_cap_uc_discounts_pane_enabled', TRUE)){
    drupal_add_js(sprintf('$(document).ready(function() { $("#cart-form-buttons").before("%s"); });', $body), 'inline');
  }

But it could use some hook to alter the table instead of adding javascript, like hook_tapir_table_alter(). What do you think ?

Comments

hles’s picture

Status: Active » Needs review
StatusFileSize
new805 bytes

Patch that fixes the issue.

scottbaetz’s picture

Be advised - this patch worked flawlessly when applied. It also behaves in a manner common to ubercart standards, where you can enable or disable in the checkout pane configuration.

I URGE to make this part of the module.