Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
Number of products count in ajax driven mini cart can be confusing when using coupons since coupons are counted as a real product.
Proposed resolution
I propose a simple patch to uc_ajax_cart.module by checking if uc_coupon module is in use and not taking into accounts product from that module:
at line 289 from:
$total += $display_item['#total'];
to:
$num = (module_exists("uc_coupon") && $display_item["module"]["#value"] == "uc_coupon") ? 0 : $display_item['qty']['#default_value'];
$total_items += $num;
This should be enaugh to resolve the total product number ambiguity.
Remaining tasks
Please evaluate it this modification is in the scope of the module and if so review it.
Comments
Comment #1
spesso CreditAttribution: spesso commentedComment #2
spesso CreditAttribution: spesso commentedChanging assignment: sorry, wrong selection.