At present this module does not provide enough context when calling uc_price() for price alterers to know what they are altering. This patch passes the node itself and other relevant data so uc_vat or other price altering modules can successfully modify the prices displayed by uc_upsell.

Once this has been reviewed I will add the equivalent support code to uc_vat.

CommentFileSizeAuthor
uc_upsell-uc_price.patch1.26 KBlongwave

Comments

torgospizza’s picture

Awesome, thanks!

I might need your help looking at a patch I did for Multicurrency. $context is something that is giving me a headache there as well. Your help is appreciated!

torgospizza’s picture

I've committed this change to my local working copy, however there still exists the problem of having multiple alterer functions requiring the $context['location'] be added to the individual module.

There has to be a better way (a patch, most likely) that can address this issue. It's awfully clumsy to, for instance in this case, add

case 'product-upsell':

to the switch($context['location']) conditional of the uc_multicurrency's price hander_alter() function.

Unless I'm not doing something correctly which could always be the case. It just seems strange that the only way I'm able to get around this is to either a) add the new location to all alterer functions, or b) just use another pre-existing location such as cart-item. Thoughts?

torgospizza’s picture

Status: Needs review » Patch (to be ported)

I also added the same $context rules for list_price, a feature patched in #482724: Not possible to display list and cost prices in the upsell block

torgospizza’s picture

Status: Patch (to be ported) » Fixed

This is committed in dev. Assuming there are no other issues with how this works, it will be in the next stable release (1.14).

longwave’s picture

Also committed the relevant change to uc_vat.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.