Posted by recrit on June 19, 2009 at 4:16pm
1 follower
| Project: | Ubercart Discounts (Alternative) |
| Version: | 6.x-2.4 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Issue Summary
If the product:
has more than 1 taxonomy term associated with it
AND
the codeless discount is 'Filter by Terms' where more than 1 term are matched in the associated terms
Then the discounts will be duplicated for as many matched terms.
For example:
discount 1 = 'Filter by Terms' for X, Y
product has 2 terms - X, Y
codeless discount view:
discount 1
discount 1Even though it shows this way, the discounts are still applied to the order correctly - in the example discount 1 is applied only once to the order
I have provided a hack until the bug is fixed. I changed the output of this field in my template using the following function:
function unique_codeless_discounts_view(&$field_codeless_discount) {
$discounts_delim = '<br/>';
if (!$field_codeless_discount['view']) {return '';}
return implode($discounts_delim, array_unique(explode($discounts_delim, $field_codeless_discount['view'])));
}This function is only valid to use if your discount:
- are filter by terms
- descriptions are unique
- should only be applied once per product
Comments
#1
I have this same type error. (see attached photo). Altho it seems to apply correctly on the checkout page. But my product only has 1 term. (see photo) Also the discount is being applied by specific product SKU. Why is this?
#2
thanks. I see this is in fact what is happening. I may try the code on my test site. thanks for the explanation