Jump to content
xt:Commerce Community Forum

Paypal L?ndereinstellung


tom4545

Recommended Posts

mein problem war, da? wir einen franz. shop und CC ?ber paypal als zahlung anbieten.

da wir einen deutschen paypal-account haben wird normalerweise die deutsche paypal-seite aufgerufen.

franzosen ohne paypal-account standen dann vor einem sprachr?tzel.

hier die l?sung -

ein hiddenfield mit dem optionswert des landes f?r das paypal formular


$process_button_string = xtc_draw_hidden_field('cmd', '_xclick') .

 xtc_draw_hidden_field('business', MODULE_PAYMENT_PAYPAL_ID) .

 xtc_draw_hidden_field('item_name', STORE_NAME) .

 xtc_draw_hidden_field('country_code', 'FR') . <-- hier den l?ndercode eintragen


........

hoffe dem einen oder anderen hilfts

Link to comment
Share on other sites

  • 1 year later...

hallo, ich suche und suche finde leider keine antwort. kann mir jemand helfen?

es geht darum das unsere kunden in england und frankreich via zahlungsmodul auf paypal umgeleitet werden, die sprache aber in D ist. das schreckt ab. ich suche seit tagen finde aber nichts dazu...

mein paypal.php code kopiere ich unten, finde aber nichts zur länder/oder sprach einstellung - ich bitte um hilfe! sam

<?php

/* -----------------------------------------------------------------------------------------

$Id: paypal.php 998 2005-07-07 14:18:20Z mz $

XT-Commerce - community made shopping

http://www.xt-commerce.com

Copyright © 2003 XT-Commerce

-----------------------------------------------------------------------------------------

based on:

© 2000-2001 The Exchange Project (earlier name of osCommerce)

© 2002-2003 osCommerce(paypal.php,v 1.39 2003/01/29); www.oscommerce.com

© 2003 nextcommerce (paypal.php,v 1.8 2003/08/24); www.nextcommerce.org

Released under the GNU General Public License

---------------------------------------------------------------------------------------*/

class paypal {

var $code, $title, $description, $enabled;

function paypal() {

global $order;

$this->code = 'paypal';

$this->title = MODULE_PAYMENT_PAYPAL_TEXT_TITLE;

$this->description = MODULE_PAYMENT_PAYPAL_TEXT_DESCRIPTION;

$this->sort_order = MODULE_PAYMENT_PAYPAL_SORT_ORDER;

$this->enabled = ((MODULE_PAYMENT_PAYPAL_STATUS == 'True') ? true : false);

$this->info = MODULE_PAYMENT_PAYPAL_TEXT_INFO;

if ((int) MODULE_PAYMENT_PAYPAL_ORDER_STATUS_ID > 0) {

$this->order_status = MODULE_PAYMENT_PAYPAL_ORDER_STATUS_ID;

}

if (is_object($order))

$this->update_status();

$this->form_action_url = 'https://www.paypal.com/cgi-bin/webscr';

}

function update_status() {

global $order;

if (($this->enabled == true) && ((int) MODULE_PAYMENT_PAYPAL_ZONE > 0)) {

$check_flag = false;

$check_query = xtc_db_query("select zone_id from ".TABLE_ZONES_TO_GEO_ZONES." where geo_zone_id = '".MODULE_PAYMENT_PAYPAL_ZONE."' and zone_country_id = '".$order->billing['country']['id']."' order by zone_id");

while ($check = xtc_db_fetch_array($check_query)) {

if ($check['zone_id'] < 1) {

$check_flag = true;

break;

}

elseif ($check['zone_id'] == $order->billing['zone_id']) {

$check_flag = true;

break;

}

}

if ($check_flag == false) {

$this->enabled = false;

}

}

}

function javascript_validation() {

return false;

}

function selection() {

return array ('id' => $this->code, 'module' => $this->title, 'description' => $this->info);

}

function pre_confirmation_check() {

return false;

}

function confirmation() {

return false;

}

function process_button() {

global $order, $xtPrice;

if (MODULE_PAYMENT_PAYPAL_CURRENCY == 'Selected Currency') {

$my_currency = $_SESSION['currency'];

} else {

$my_currency = substr(MODULE_PAYMENT_PAYPAL_CURRENCY, 5);

}

if (!in_array($my_currency, array ('CAD', 'EUR', 'GBP', 'JPY', 'USD'))) {

$my_currency = 'EUR';

}

if ($_SESSION['customers_status']['customers_status_show_price_tax'] == 0 && $_SESSION['customers_status']['customers_status_add_tax_ot'] == 1) {

$total = $order->info['total'] + $order->info['tax'];

} else {

$total = $order->info['total'];

}

if ($_SESSION['currency'] == $my_currency) {

$amount = round($total, $xtPrice->get_decimal_places($my_currency));

$shipping = round($order->info['shipping_cost'], $xtPrice->get_decimal_places($my_currency));

} else {

$amount = round($xtPrice->xtcCalculateCurrEx($total, $my_currency), $xtPrice->get_decimal_places($my_currency));

$shipping = round($xtPrice->xtcCalculateCurrEx($order->info['shipping_cost'], $my_currency), $xtPrice->get_decimal_places($my_currency));

}

$process_button_string = xtc_draw_hidden_field('cmd', '_xclick').xtc_draw_hidden_field('business', MODULE_PAYMENT_PAYPAL_ID).xtc_draw_hidden_field('item_name', STORE_NAME).xtc_draw_hidden_field('amount', $amount - $shipping).xtc_draw_hidden_field('shipping', $shipping).xtc_draw_hidden_field('currency_code', $my_currency).xtc_draw_hidden_field('return', xtc_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL')).xtc_draw_hidden_field('cancel_return', xtc_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));

return $process_button_string;

}

function before_process() {

return false;

}

function after_process() {

global $insert_id;

if ($this->order_status)

xtc_db_query("UPDATE ".TABLE_ORDERS." SET orders_status='".$this->order_status."' WHERE orders_id='".$insert_id."'");

}

function output_error() {

return false;

}

function check() {

if (!isset ($this->_check)) {

$check_query = xtc_db_query("select configuration_value from ".TABLE_CONFIGURATION." where configuration_key = 'MODULE_PAYMENT_PAYPAL_STATUS'");

$this->_check = xtc_db_num_rows($check_query);

}

return $this->_check;

}

function install() {

xtc_db_query("insert into ".TABLE_CONFIGURATION." ( configuration_key, configuration_value, configuration_group_id, sort_order, set_function, date_added) values ('MODULE_PAYMENT_PAYPAL_STATUS', 'True', '6', '3', 'xtc_cfg_select_option(array(\'True\', \'False\'), ', now())");

xtc_db_query("insert into ".TABLE_CONFIGURATION." ( configuration_key, configuration_value, configuration_group_id, sort_order, date_added) values ('MODULE_PAYMENT_PAYPAL_ALLOWED', '', '6', '0', now())");

xtc_db_query("insert into ".TABLE_CONFIGURATION." ( configuration_key, configuration_value, configuration_group_id, sort_order, date_added) values ('MODULE_PAYMENT_PAYPAL_ID', '[email protected]', '6', '4', now())");

xtc_db_query("insert into ".TABLE_CONFIGURATION." ( configuration_key, configuration_value, configuration_group_id, sort_order, set_function, date_added) values ('MODULE_PAYMENT_PAYPAL_CURRENCY', 'Selected Currency', '6', '6', 'xtc_cfg_select_option(array(\'Selected Currency\',\'Only USD\',\'Only CAD\',\'Only EUR\',\'Only GBP\',\'Only JPY\'), ', now())");

xtc_db_query("insert into ".TABLE_CONFIGURATION." ( configuration_key, configuration_value, configuration_group_id, sort_order, date_added) values ('MODULE_PAYMENT_PAYPAL_SORT_ORDER', '0', '6', '0', now())");

xtc_db_query("insert into ".TABLE_CONFIGURATION." ( configuration_key, configuration_value, configuration_group_id, sort_order, use_function, set_function, date_added) values ('MODULE_PAYMENT_PAYPAL_ZONE', '0', '6', '2', 'xtc_get_zone_class_title', 'xtc_cfg_pull_down_zone_classes(', now())");

xtc_db_query("insert into ".TABLE_CONFIGURATION." ( configuration_key, configuration_value, configuration_group_id, sort_order, set_function, use_function, date_added) values ('MODULE_PAYMENT_PAYPAL_ORDER_STATUS_ID', '0', '6', '0', 'xtc_cfg_pull_down_order_statuses(', 'xtc_get_order_status_name', now())");

}

function remove() {

xtc_db_query("delete from ".TABLE_CONFIGURATION." where configuration_key in ('".implode("', '", $this->keys())."')");

}

function keys() {

return array ('MODULE_PAYMENT_PAYPAL_STATUS', 'MODULE_PAYMENT_PAYPAL_ALLOWED', 'MODULE_PAYMENT_PAYPAL_ID', 'MODULE_PAYMENT_PAYPAL_CURRENCY', 'MODULE_PAYMENT_PAYPAL_ZONE', 'MODULE_PAYMENT_PAYPAL_ORDER_STATUS_ID', 'MODULE_PAYMENT_PAYPAL_SORT_ORDER');

}

}

?>

Link to comment
Share on other sites

  • 4 months later...

Mir fehlt denke ich nicht viel, nachdem sich ausländische, englischsprechende Kunden schon beschwert haben,

Gemäß Paypal Developer Program übergibt man mit lc entweder value"US" für Englisch, "DE" für deutsch usw.

Leider kann ich es nicht testen, da mein OS/browser deutsch sind, kann das jemand mal checken , ob's jetzt besser klappt ??

Ändern in includes/modules/payment/paypal.php

ca. Zeile 115

$dataString = 'cmd=_xclick&business='.MODULE_PAYMENT_PAYPAL_ID.'&item_name='.STORE_NAME.'-OID:'.$_SESSION['tmp_oID'].'&amount='. ($amount - $shipping).'&shipping='.$shipping.'&currency_code='.$my_currency.'&return='.xtc_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL').'&cancel_return='.xtc_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL');

nach:

$dataString = 'cmd=_xclick&business='.MODULE_PAYMENT_PAYPAL_ID.&lc='.$_SESSION["language_code"].'&item_name='.STORE_NAME.'-OID:'.$_SESSION['tmp_oID'].'&amount='. ($amount - $shipping).'&shipping='.$shipping.'&currency_code='.$my_currency.'&return='.xtc_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL').'&cancel_return='.xtc_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL');

jetzt müßte die session_language erkannt werden ??

Bitte mal prüfen

danke&gruß sajako

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 months later...

Um nur auf die englische Seite zu kommen habe ich die lc Variable hier eingesetzt:

paypal.php ca. Zeile 115

$dataString = 'cmd=_xclick&lc=EN&business='.MODULE_PAYMENT_PAYPAL_ID.'&item_name='.STORE_NAME.'-OID:'.$_SESSION['tmp_oID'].'&amount='. ($amount - $shipping).'&shipping='.$shipping.'&currency_code='.$my_currency.'&return='.xtc_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL').'&cancel_return='.xtc_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL');

Bei mir funktioniert es (endlich)

Link to comment
Share on other sites

  • 1 year later...

Archived

This topic is now archived and is closed to further replies.

×
  • Create New...