Zen Cart Logo
Forums / Addon Payment Modules / How can i have two languages using the sermepa payment module?

How can i have two languages using the sermepa payment module?

Views: 1,245

Results 1 to 2 of 2
13 Jun 2012, 5:26 PM
#1
zand avatar

zand

New Zenner

Join Date:
Jun 2012
Posts:
9
Plugin Contributions:
0

How can i have two languages using the sermepa payment module?

Hello,
I am using the sermepa payment module and my costumers end up in the Spanish version of the payment site. I asked the support about how to make this multilingual and they say that they will show my costumers which ever language I choose in the 'Ds_Merchant_ConsumerLanguage' parameter, I can select between "001" (spanish), "002" english and more... but only one parameter can be set in the PHP file (row 104 if you look in the module):

$ds_merchant_consumerlanguage = "001";    

I tried to put "001, 002" for example (u never know right?) but it didn't work :(.

My problem is that this parameter is in the PHP file 'includes\modules\payment\sermepa.php' and since I'm new to this whole Zen Cart thing, I wish to ask how to put two of these parameters in my site's Spanish-English folders, so costumers checkout in their own language.
The guy who wrote the module also put this:

  if ($language=='english')
      {
        $ds_merchant_consumerlanguage='002';
      }
      elseif ($language=='catala') 
      {
        $ds_merchant_consumerlanguage='003';
      }

I think this was an attempt to make this work via the module... but it doesn't, at least not for me...

Thanks for any help, :smile:

13 Jun 2012, 10:56 PM
#2
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,873
Plugin Contributions:
7

Re: How can i have two languages using the sermepa payment module?

The parameter, beit 001 or 002 or 003 has to be passed to the gateway at checkout confirmation and so yes it needs to be defined in the code, not as a constant, and should be decided by the language in use in the checkout process.
So the PHP code you have quoted is on the right track in a general sense..

I do not use this module but have had the misfortune to use/repair both the CECA and Pasat 4B module for Spain so have had similar problems with buggy code, usually in the "optional" parts like the languages not having been completed or tested, and no support from other users.

You will have to get your hands dirty and write your own code as Zen Cart use in Spain is very low and community help even lower.

I suggest you first install the Superglobals addon. This will show you all the variables that are in use on the different pages so you can use the correct one for your needs.

Then just play with the code and temporarily put echo "$your_variable=".$your_variable;die; just after where you are making changes to see if you are getting the value you need in the variable you are using. The die bit just stops the code from proceeding further so you can see the echo.