I have an UK site in which we set up two VAT taxes, both are for 20% (as per UK) and applies to the same product, but we needed a certain role to see prices excl. VAT and normal users (anon and the rest) to see the prices inc. VAT.

To achieve this, I configured two Tax rates with the same details, except for the "Include this tax when displaying product prices." which was checked on one and unchecked on the other.

I then set up the conditions for the two tax rates, where one has "User has role 'x'" and the other one has the opposite condition (same one negated).

I noticed that although prices were display excl. of vat in cart and checkout, it did not on product views, regardless of the conditions.

After looking at the code, I found that indeed, for product display the conditions were not run at all.

Comments

hanoii’s picture

Status: Active » Needs review
StatusFileSize
new1.35 KB

I realise this is probably a design error, o some inheritance from old code, and attempting to fix this might not be so easy because of its probably repercussions, but here is a proposed fix, one it makes sense logically and should work most of the time, although I expect certain order conditions to need some extra conditions.

For me its working because I am not using any order data condition, but should work non-the-less.

hanoii’s picture

StatusFileSize
new1.35 KB
new522 bytes

Small change, using UcOrder() instead of stdClass();

EDIT: this should prevent most notices.

hanoii’s picture

smurfxx’s picture

Patch works very well!