No replies
hkvega01's picture
Offline
Joined: 09/05/2012
Juice: 82
Was this information Helpful?

i'm debugging a javascript function of uc_discounts_alt, this function is not work at drupal 7, the something like xxx_line_item, or
render_line_items are completely not working and undefined, what the hell are that functions? Where are these functions from? Anyone knows?

function uc_discountsRenderLineItems(line_items, show_message) {
alert(window.set_line_item);
if ((window.set_line_item == null) || (line_items == null)) {
return;
}

//Remove total discount line item

remove_line_item(Drupal.settings.uc_discounts.line_item_key_name);

var total_amount = 0;

for (i = 0; i < line_items.length; i++) {
var line_item = line_items[i];
total_amount += parseFloat(line_item["amount"]);

}

//Add total discount line item
if (line_items.length > 0) {
set_line_item(Drupal.settings.uc_discounts.line_item_key_name,
Drupal.settings.uc_discounts.total_discount_text, total_amount,
parseFloat(Drupal.settings.uc_discounts.line_item_weight) + 0.5,
1,
false);
}

// Update total

if (window.render_line_items) {
render_line_items();
}

//If there is tax in the system, recalculate tax
if (window.getTax) {
getTax();
}

}