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 1
Even 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
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | double discount code.jpg | 92.57 KB | smptebars1 |
| #1 | one term.jpg | 44.48 KB | smptebars1 |
| #1 | by SKU.jpg | 69.44 KB | smptebars1 |
Comments
Comment #1
smptebars1 commentedI 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?
Comment #2
smptebars1 commentedthanks. I see this is in fact what is happening. I may try the code on my test site. thanks for the explanation