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.
Having upgraded to ubercart 6.x-2.6 recently, I've discovered that uc_multiprice module is no longer able to alter the displayed currency in the uc_cart block, on the /cart page or on the cart checkout pane, the reason being that the uc_price() context "themed-original" is being used instead of "themed". Now, I know there may be reason why you want to display the original unaltered version, I just can't think of any! Attached patch fixes this - at least until such a time as uc_multiprice module adds in the new currency features recently added to ubercart.
Comment | File | Size | Author |
---|---|---|---|
#15 | uc_cart.module-sign-bug-1304884.patch | 2.87 KB | kenorb |
#15 | Screen Shot 2013-10-02 at 22.33.35.jpg | 52.6 KB | kenorb |
#15 | Screen Shot 2013-10-02 at 22.33.54.jpg | 53.43 KB | kenorb |
#15 | Screen Shot 2013-10-02 at 21.40.01.png | 26.62 KB | kenorb |
#15 | Screen Shot 2013-10-02 at 22.24.12.png | 24.46 KB | kenorb |
Comments
Comment #2
longwaveThe code you reference in the patch hasn't changed in two years, so I'm not sure why this is only affecting uc_multiprice now?
http://drupalcode.org/project/ubercart.git/blame/refs/heads/6.x-2.x:/uc_...
http://drupalcode.org/project/ubercart.git/blame/refs/heads/6.x-2.x:/uc_...
Comment #3
longwaveAlso I think the reason for using themed-original here is that the prices have already been altered, so we don't want them to be altered again (e.g. by a VAT or discount module)
Comment #4
stella CreditAttribution: stella commentedI'm not sure why it happens now either. I just upgraded from ubercart 6.x-2.4 to 6.x-2.6 and things suddenly no longer work as expected. Looking back at 6.x-2.4 I can see those lines haven't changed alright, but something must have changed elsewhere though that is affecting this?
Basically I have a setup where I have 2 prices for each product configured, one in the site default currency (EUR) and one for the UK (so in GBP). I can switch between the two currencies fine and the price displayed updates, but the currency displayed in the cart block, cart page, cart checkout pane is always in EUR. However, the currency displayed above the credit card block and on the order review page are both correct. It's just those coming from the cart module that are problematic.
Perhaps the api changed somewhere and uc_multiprice needs to be updated? but I can't see where or what would do it.
Comment #5
Anonymous (not verified) CreditAttribution: Anonymous commentedHi,
I would like this module in D7 - am willing to sponsor for this - possibly we could club together to get a fix for the above problems and a conversion - anyone interested?
Comment #6
neokoenig CreditAttribution: neokoenig commentedI've got a client interested in multicurrency for 3.x on D7 too.. subscribing.
Comment #7
longwaveAs 6.x is coming to end of life and uc_multiprice has less than 100 users, not sure it is worth fixing this now. If anyone is still interested please reopen, preferably with a patch!
Comment #8
kenorb CreditAttribution: kenorb commentedThe same problem here.
When $context['revision'] is 'themed-original', no alternation can be done.
This was working fine in earlier versions of Ubercart.
I can confirm that the patch fix the problem straight away.
-
Steps to reproduce the problem:
1. Add item to the cart.
2. Go to: /cart
3. Change currency to different one.
URL has other currency in the URL such as /cart?currency=GBP but the sign in the cart shows the default currency (USD).
The price is converted correctly, so the problem is only with the currency sign.
Comment #9
kenorb CreditAttribution: kenorb commentedPatch against UC 2.12
It's actually upgrade to 6.x-2.6 broke this functionality.
These are the changes between 2.5 and 2.6 which broke this:
Comment #10
kenorb CreditAttribution: kenorb commentedComment #11
kenorb CreditAttribution: kenorb commentedRelated:
#1097668: Multicurrency support
#449546: uc_price() is a new complicated thing and needs explaining
#1396124: Payment order pane does not use order currency
Comment #13
kenorb CreditAttribution: kenorb commentedSimilar thing happens on invoice at: /user/%/order/%/invoice/print
$order_subtotal has the correct currency sign, $order_total hasn't ($ instead of £).
Comment #14
kenorb CreditAttribution: kenorb commentedThe same happening on uc_order_pane_payment at /admin/store/orders/%.
The following patch fixes the problem:
And also on invoice page at /admin/store/orders/%/invoice/print.
The following patch, fixes the problem:
Comment #15
kenorb CreditAttribution: kenorb commentedURL: /admin/store/orders/%
Before the patch:
After the patch:
URL: /admin/store/orders/%/invoice
Before the patch:
After the patch:
Comment #16
longwaveThe changes you list in #9 were not changed between 6.x-2.5 and 6.x-2.6 as far as I can see? They seem to have been there since 6.x-2.0 beta releases when uc_price() was first added, looking at git history.
We need the -original prices at those points to avoid price alterers (such as uc_vat) modifying the price twice. The price handler system is unfortunately fundamentally broken, and I don't want to commit such a patch now to 6.x that might fix the uc_multiprice problems for your site, while causing other problems for existing users.
As a lot of these are in theme functions, you should be able to override many of them in your own theme, if that helps.
Comment #17
longwaveI don't see a way forward with this without breaking existing sites, and it is probably not worth spending time on this at this stage in the 6.x-2.x cycle.