Download & Extend

In case of Product Kit with Percentage of on Per Qualitying Product Division by zero in uc_discounts.module on 1563

Project:Ubercart Discounts (Alternative)
Version:6.x-2.2
Component:Code
Category:bug report
Priority:major
Assigned:Unassigned
Status:needs work

Issue Summary

Hi,

Got error as below on Review Order page after Checkout page:
warning: Division by zero in /var/www/html/tsnd/ldfo/sites/default/modules/contrib/uc_discounts_alt/uc_discounts/uc_discounts.module on line 1563

The settings are:
Product Kit
2 Product with 2 attributes per product
Quantity 1 for each product in Product Kit
Discount Applied as Percentage Off per qualifying item at 0.20 (i.e. 20%)
(also tried it with just Percentage Off instead per qualifying item, no error but no discount)

Discount is not getting applied

Please check. I can provider if any other detailed information required.

Will let you know if got it solved anyhow.

Thanks & Regards,

Tajinder Singh

Comments

#1

Priority:normal» major

#2

Status:active» needs review

Hi,

Got it working by modifications in uc_discounts.module file.

Patch generated with Meld Diff Viewer is attached for review and use by others in need.

Thanks & Regards,

Tajinder Singh
IMP Technologies
http://imptechs.com

AttachmentSize
uc_discounts.module.product_kit.patch 1.43 KB

#3

Status:needs review» needs work

Looks pretty good, but why did you remove this line:

uc_discounts_add_to_existing_map_number_value($order_product_id_quantity_map, $nid, $product->qty);