The Foxy forums are on the move!

We're in the process of moving our forums over to a new system, and so these forums are now read-only.
If you have a question about your store in the meantime, please don't hesitate to reach out to us via email.

Multiple languages / versatile payment methods

bobmeetinbobmeetin Member
in Bugs & Feature Requests edited January 2015
I'm setting up a membership site in which the primary language will be English but the customer base will be universal. We need to offer customers the most possible flexibility in managing payments, i.e. the most universal payment gateway possible, be it paypal,, worldpay, 2checkout, etc.

To make registration easy and reasonably I will employ (probably) google translate on the customer registration page so that the customer can choose their language and fill in the blanks.

What I am wondering about though is how that will translate to the cart/checkout. Say someone from the Ukraine, Vietnam or perhaps Tierra del Fuego fills out my form then gets passed along to the checkout page. What are they going to see in terms of language and payment gateway options?
  • fc_adamfc_adam FoxyCart Team

    Currently FoxyCart only allows a single locale, language and payment gateway selection per store. So no matter where someone comes from, they'll see the same set up for your FoxyCart templates. We are planning to allow gateway and template sets in the future to allow you to provide multiple different language and gateway set options, and you can vote for that functionality here:
  • Meaning at this time that if I want to create a universal store to reach 150+ countries, folks in their language, that I need to signup for 150+ stores at $15/month per store. $150 * 15 = $2250/month. This seems to be rather cost-prohibitive for a small business, membership-type service that will perhaps sell a few memberships per month. Am i understanding this correctly?

    PayPal offers interesting functionality with "Website Payment Advanced". Using their Iframe Code you can create an embed payment function for PayPal, either going with paying by credit card if you're good or if you don't have a paypal account, you can opt to signup for a new account. On the new account form/page they offer a dropdown function where you can choose a language/country from an extensive list. Not only does it switch the language to the selected language but it also offers varied choices of credit cards based upon the country. Typically you will see the common core of Visa, MC, Amex and Discover in many countries then some variation per country, both plus/minus.
  • On a local registration page I can use something like Google translate to collect the basic visitor data: name, email, username, password, billing address, etc. I don't know how well this will translate if I try to pass this type of translated data to a payment form.
  • fc_adamfc_adam FoxyCart Team

    If you're just wanting to just provide different languages, but maintain the same gateway and currency settings for payment, we do have a Twig based snippet that allows you to specify a language and it will customise the language strings presented to the customer.

    If you're wanting to specify 150 different languages, I'm not sure that that would be a good approach though - as it would result in a significantly large template. Perhaps you could provide translations in a 3-5 languages that make up the majority of languages spoken around the world? That could be a good place to meet in the middle.

    If you're wanting to provide different currencies and/or gateway settings across the different locales as well - that would require different stores for each different set.

    In terms of doing a dynamic translation of that - there may well be security concerns on sending information from a secured payment page to an external unsecured endpoint - so I wouldn't suggest taking that route. As an example, I believe by default Google Translate won't translate a secured page.
  • If you're just wanting to just provide different languages, but maintain the same gateway and currency settings for payment, we do have a Twig based snippet that allows you to specify a language and it will customise the language strings presented to the customer.
    Cac you send me the FAQ related to this?

    I'm shooting from the hip trying to sort out whether this stuff will work well or not.
  • fc_adamfc_adam FoxyCart Team

    At this time we don't have a public FAQ, but I'll whisper you some details shortly.
  • I am ready to try this but don't understand your comment about where to add the twig code. For checkout you said right after the opening "" tag. What is the opening "" tag? Here is a link to a text version of my checkout template.

    There are similar links for cart and receipt. What I am understanding is that I must copy (for French) that entire TWIG logic code and paste it into the template.

    You said to activate by adding a hidden session variable to the page.

    You said hidden. What I see is:

    How/where is this getting passed? I can make up something hidden as:

    <input type="hidden" name="h:lang" value="FR" />

    Where would this go and how would I get folks to switch from English to French?

  • fc_adamfc_adam FoxyCart Team
    edited February 2015

    Sorry - looks like some of the text got busted by the forums in my whisper - it should say right after the opening <body> tag.

    How/where is this getting passed?
    With the hidden variable - that link I provided is an add to cart URL. You can add a hidden session variable to the cart by prefixing the variable name with the h:. A session variable is added to the cart session, rather than being associated with a specific product. Your form example code would perform the same action as the link.

    Where would this go and how would I get folks to switch from English to French?
    It could be a part of every add to cart, or you could perform a JSONP cart request on page load depending on the locale the customer has selected. Ultimately as long as it's set once for the customer session, it will persist from then on.
  • Re: cart include template

    I am having trouble with this template, not sure whether it is the twig code or general structure, but can you as well layout the general structure including the verbatim full twig code (you mentioned{% block cart %}) , where it belongs (I assume same content area as other templates like checkout).

  • bobmeetinbobmeetin Member
    edited February 2015
    Here is a link to the file that I am cacheing for cart include:

    Scroll down to COMPONENT and you'll find the Foxycart part which is currently based upon cart because I could not find the correct TWIG code that you were referencing. Here is the code block I am using:

    {% set cart_is_fullpage = true %}
    <div data-fc-container="cart">
    {% include '' %}

    This is currently failing - if I click on any item to add to cart it opens up a blank sidebar, white space.

    Giving that information hopefully I will be able to add the TWIG language code logic to the right location in the template. It may help if you re-specify where in the template.

    And yes, I would still like to get access to all the language files you have on file.
  • fc_adamfc_adam FoxyCart Team

    So the cart include template needs to be the actual raw cart template. You can't embed the cart include template into itself. That's the issue you're running into there. You're trying to include the cart include template inside the cart include template.

    The cart include template is essentially a partial template - it's just the raw cart code. Thinking in terms of the checkout - it includes two templates, the checkout include template and the cart include template inside of that template. The reason the cart include template is featured as a top level template within the administration is due to the fact that that template is what is contained within the Sidecart.

    To lay it out in a bit more detail:


    - cart template from admin
    - - contains

    - checkout template from admin
    - - contains
    - - - contains (amongst others)

    - receipt template from admin
    - - contains
    - - - contains (amongst others)

    So as you can see there - the cart include template is indeed included across all three templates, but the whole template for Sidecart is just made up of the cart include template.

    The tpl_cart_include.txt file you linked to is what you would use for the full page cart template - accessible in the administration as "cart". The cart include template needs to be just the raw twig code for the cart, as is contained within the template file. You can certainly customise that file - but it's not where you'll be adding a full HTML page template like you're trying to there.

    Does that help clarify things? I'll whisper in regards to the multiple languages setup.
Sign In or Register to comment.