When you are on the checkout page, either view or review mode, the cart content pane does not translate on multilingual sites. I.e the product description always shows in Englis.

Here is patch to ubercart/uc_cart/uc_cart_checkout_pane.inc that fixes the issue by first checking if we are on a translation page, and then using the tnid to get back the product description.

This patch does not fix issues with attributes however, they remain untranslated.

CommentFileSizeAuthor
#14 uc_cart-translation.patch4.02 KBlongwave
#13 uc_cart_checkout_pane_i18n.patch1.84 KBalduya
#5 patch.txt1.96 KBAnonymous (not verified)
#2 patch.txt1.98 KBAnonymous (not verified)
#1 patch.txt1.62 KBAnonymous (not verified)
patch.txt1.62 KBAnonymous (not verified)
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Anonymous’s picture

FileSize
1.62 KB

Looks like I submitted a reverse patch, trying again.

Anonymous’s picture

FileSize
1.98 KB

Someone on #ubercart suggested I wrap the code in module_exists('translation') blocks, just in case :)

updated patch

Anonymous’s picture

Title: On checkout: cart contents are not translatable » On checkout: cart contents are not translatable - patch submitted
Status: Active » Needs review
TR’s picture

Status: Needs review » Needs work

I think this is wrong: uc_pnslation_node_get_translationroduct_get_description($item)

Anonymous’s picture

Status: Needs work » Needs review
FileSize
1.96 KB

Thanks! Obviously a vi typo.

resubmitting

robby.smith’s picture

subscribing

stewart.adam’s picture

Status: Needs review » Needs work

The patch looks good, except that I would try to optimize the part that sets $desc. It looks like in whether or not the translation module exists this call is always performed:

$desc = check_plain($item->title) . uc_product_get_description($item);

So no need to have it inside and outside the conditional.

xibun’s picture

+1

YK85’s picture

subscribing
+1 for translatable content in Ubercart

Anonymous’s picture

Title: On checkout: cart contents are not translatable - patch submitted » On checkout: cart contents are not translatable

I submitted this patch 5 months ago but it doesn't seem to have been picked up by the Ubercart folks.

I know it's perhaps not the best solution but it's the best I can come up with my limited knowledge.

If it's not good enough or correct enough it would be nice to get some feedback/direction from the UC maintainers perhaps? :)

TR’s picture

The only review this patch has received was #7, who suggested a change and moved the status to "needs work". His concern has not been addressed by you or anyone else, so the patch is not ready to commit. Even then, I'd like to see someone do some real testing on this. I do not use the translation module so I can't test it myself. But I was under the impression that having a separate nid for translated product content causes lots of problems, for instance stock isn't decremented correctly because stock levels are associated with a nid. That said, even if your patch doesn't cause problems, it may not be the right thing to do.

Anonymous’s picture

TR, as I posted above, I'm hoping that someone else will pick this up. I'm not a Drupal developer and anything more than the simple patch I submitted is out of my league.

I agree with you that my patch may or may not be the right way to go. Could an 'expert' from the UC group yea-or-nay this approach or offer comments?

Or if this is not high on the UC team's priority list, which I can accept, let us know and I'll let this die. Or perhaps the issue needs to be reformulated and a new, better worded, issue raised so the UC team can address it?

UC is definitely the best e-commerce module for Drupal bar none, but one of it's major weak points is multi-lingual sites and this is my attempt at trying to help on this front :)

alduya’s picture

Version: 6.x-2.2 » 6.x-2.4
Status: Needs work » Needs review
FileSize
1.84 KB

I updated the totsubo's patch from #5 with the comments firewing1 gave in #7.

I don't know Übercart well enough to decide if this is the best solution, but this makes translating Übercart a little less troublesome.

longwave’s picture

FileSize
4.02 KB

A slightly different approach is attached. A new checkbox, "Use source translation node when adding products to the cart", is added to the cart settings. When this is enabled, product titles will be translated in the cart and checkout and the localized name will be stored against the order, but translated products will be grouped together in the cart and reports - however, this is at the expense of allowing different product settings per language. Seems to work well if you are using i18sync module and the fields sync patch that was committed recently.

Further work is needed to support attributes and some other modules, but as this new option is disabled by default it could still be committed as-is.

Status: Needs review » Needs work

The last submitted patch, uc_cart-translation.patch, failed testing.

TR’s picture

Pay no attention to the bot behind the curtain...

Can't trust the test results yet - bot is misbehaving. I reported the above failure as a testbot bug, see #1096900: Releases should not be tested.

splash112’s picture

subscribe

kenorb’s picture

Status: Needs work » Needs review

#14: uc_cart-translation.patch queued for re-testing.

Status: Needs review » Needs work

The last submitted patch, uc_cart-translation.patch, failed testing.

longwave’s picture

Version: 6.x-2.4 » 7.x-3.x-dev
Component: Code » Cart/checkout
Category: bug » feature

This is unlikely to be fixed in 6.x now, as nobody tested the patch I uploaded two years ago in #14. This could still be changed in 7.x if someone wants to work on it.

kenorb’s picture

I've this patch already applied to one live site for over 1 year, so this patch actually has been tested under 6.x

kenorb’s picture

Priority: Normal » Minor
Issue summary: View changes