dahui Posted September 9, 2005 Share Posted September 9, 2005 hi I am not sure if here or payment-modules board is the right place to post, but I think it is more 'general', if not a mod might please move the thread, thx. in catalog/checkout_process.php I found the following code round l 265 if (is_object($$payment)) { $email_order .= EMAIL_TEXT_PAYMENT_METHOD . "\n" . EMAIL_SEPARATOR . "\n"; $payment_class = $$payment; $email_order .= $payment_class->title . "\n\n"; if ($payment_class->email_footer) { $email_order .= $payment_class->email_footer . "\n\n"; } } it workz fine for catalog/includes/languages/english/modules/moneyorder.php, as here I found the 'define-code' by defalut and altered it when I add now to catalog/includes/languages/english/modules/cod.php define('MODULE_PAYMENT_COD_TEXT_EMAIL_FOOTER', "sometext \n and some more \n\n\n\n". EMAIL_SEPARATOR . "\n\n" . STORE_NAME_ADDRESS ."\n\n\n"); it is not displayed in the confirmation email? any idea how it workz as apart of catalog/includes/languages/english/modules/moneyorder.php non of the other files has a 'define-code' by default in the file? thx, dahui Link to comment Share on other sites More sharing options...
stevel Posted September 9, 2005 Share Posted September 9, 2005 In the cod module, you need to add the line: $this->email_footer = MODULE_PAYMENT_COD_TEXT_EMAIL_FOOTER; in with the other lines that initialize $this. Steve Contributions: Country-State Selector Login Page a la Amazon Protection of Configuration Updated spiders.txt Embed Links with SID in Description Link to comment Share on other sites More sharing options...
dahui Posted September 9, 2005 Author Share Posted September 9, 2005 perfect. workz! thx a lot stevel dahui Link to comment Share on other sites More sharing options...
dahui Posted September 9, 2005 Author Share Posted September 9, 2005 stevel, may I ask you how to call cutomer_id and order_id in he confrimation mail? when moneyoder is chosen, in germany we ask the customer to fill in information to identify whom the payment is coming from in an extra line. ther fore I would like to tell the customer in the confirmation mail what to write exactly into that field upon payment. we call it "Verwendungszweck" (purpose of use?) I tried the following code: define('MODULE_PAYMENT_MONEYORDER_TEXT_EMAIL_FOOTER', "Verwendungszweck: \n" . $order->customer['customer_id'] . " - " . EMAIL_TEXT_ORDER_NUMBER . ' ' . $insert_id . "\n\n"); but the result is only Verwendungszweck: - Bestellnummer: where is the little devil in my code :'( ??? dahui Link to comment Share on other sites More sharing options...
dahui Posted September 9, 2005 Author Share Posted September 9, 2005 has anybody ever succeeded in integrating a variable-echo within the define clauses of a language file? or the other way round, could it be that - sorry fo my limited php knowledge - this isn't possible at all? I am searching the board for hours know and don't find anything. anbody out there to point me in the right direction please? thx, dahui Link to comment Share on other sites More sharing options...
Guest Posted September 9, 2005 Share Posted September 9, 2005 what is it you are trying to do? Link to comment Share on other sites More sharing options...
dahui Posted September 9, 2005 Author Share Posted September 9, 2005 Hi Mibble thanks for having a look at that I want to include the customer_id and order_id into the email order confirmation for moneyorders at the moment: <?php /* $Id: moneyorder.php,v 1.9 2003/07/11 09:04:23 jan0815 Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2002 osCommerce Released under the GNU General Public License */ define('MODULE_PAYMENT_MONEYORDER_TEXT_TITLE', 'Scheck/Vorkasse'); define('MODULE_PAYMENT_MONEYORDER_TEXT_DESCRIPTION', 'Zahlbar an:<br>Frau ' . MODULE_PAYMENT_MONEYORDER_PAYTO . '<br>Raiffeisenbank Ebern<br>BLZ 77061425<br>Kto 100512532<br><br>' . nl2br(STORE_NAME_ADDRESS) . '<br><br>' . 'Ihre Bestellung wird unmittelbar nach Zahlungseingang versandt.'); define('MODULE_PAYMENT_MONEYORDER_TEXT_EMAIL_FOOTER', "Zahlbar an:\nElflein Kosmetik, R. Elflein\nRaiffeisenbank Ebern\nBLZ : 77061425\nKtoNr. : 100512532\n\nIhre Bestellung wird unmittelbar nach Zahlungseingang auf den Versandweg gebracht.\nHerzlichen Dank f?r Ihren Einkauf.\n\nElflein Kosmetik\nOnlineShop Service\n\n\n\n". EMAIL_SEPARATOR . "\n\n" . STORE_NAME_ADDRESS ."\n\n\n"); ?> results in an email looking like this: Zahlungsweise------------------------------------------------------ Scheck/Vorkasse Zahlbar an: Elflein Kosmetik, R. Elflein Raiffeisenbank Ebern BLZ : 77061425 KtoNr. : 100512532 Verwendungszweck: Ihre Bestellung wird unmittelbar nach Zahlungseingang auf den Versandweg gebracht. Herzlichen Dank f?r Ihren Einkauf. Elflein Kosmetik OnlineShop Service and I want to have it look exactly like this please: Zahlungsweise------------------------------------------------------ Scheck/Vorkasse Zahlbar an: Elflein Kosmetik, R. Elflein Raiffeisenbank Ebern BLZ : 77061425 KtoNr. : 100512532 Verwendungszweck: '$cutomer_id' - Bestellnummer: '$order_id' Ihre Bestellung wird unmittelbar nach Zahlungseingang auf den Versandweg gebracht. Herzlichen Dank f?r Ihren Einkauf. Elflein Kosmetik OnlineShop Service its a line that tells the customer what to fill in at the bank in a field we call here "pupose of use" => Verwendunsgzweck thx for helping me on this dahui Link to comment Share on other sites More sharing options...
dahui Posted September 9, 2005 Author Share Posted September 9, 2005 nobody Ideas on that :'( ??? dahui Link to comment Share on other sites More sharing options...
stevel Posted September 9, 2005 Share Posted September 9, 2005 You can have a variable in there, but it is evaluated when the language file is included, not when you are constructing the message. To do what you want means that you have to build the message text at the time when the information is available, such as where the mail is constructed in checkout_process. Steve Contributions: Country-State Selector Login Page a la Amazon Protection of Configuration Updated spiders.txt Embed Links with SID in Description Link to comment Share on other sites More sharing options...
dahui Posted September 9, 2005 Author Share Posted September 9, 2005 You can have a variable in there, but it is evaluated when the language file is included, not when you are constructing the message. To do what you want means that you have to build the message text at the time when the information is available, such as where the mail is constructed in checkout_process. <{POST_SNAPBACK}> Stevel, yr input is soooooooo valuable for me thx a lot. If I understand right that means I have to split up the define('MODULE_PAYMENT_MONEYORDER_TEXT_EMAIL_FOOTER', ... of the langauge file in 2 parts to have the data inserted in the middle at the right place and alter in catalog/checkout_process.php parts if (is_object($$payment)) { $email_order .= EMAIL_TEXT_PAYMENT_METHOD . "\n" . EMAIL_SEPARATOR . "\n"; $payment_class = $$payment; $email_order .= $payment_class->title . "\n\n"; if ($payment_class->email_footer) { $email_order .= $payment_class->email_footer . "\n\n"; } } tep_mail($order->customer['firstname'] . ' ' . $order->customer['lastname'], $order->customer['email_address'], EMAIL_TEXT_SUBJECT . ' - ' . EMAIL_TEXT_ORDER_NUMBER . ' ' . $insert_id , $email_order, STORE_NAME, STORE_OWNER_EMAIL_ADDRESS); // send emails to other people if (SEND_EXTRA_ORDER_EMAILS_TO != '') { tep_mail('', SEND_EXTRA_ORDER_EMAILS_TO, EMAIL_TEXT_SUBJECT . ' - ' . EMAIL_TEXT_ORDER_NUMBER . ' ' . $insert_id , $email_order, STORE_NAME, STORE_OWNER_EMAIL_ADDRESS); right? I imagined that but wished it was easier thx stevel :thumbsup: dahui Link to comment Share on other sites More sharing options...
stevel Posted September 9, 2005 Share Posted September 9, 2005 No - you can't use EMAIL_TEXT_ORDER_NUMBER in this context as the value of that is set when the language file is included, unless the variable you specify there is set at the place where the file is included. If $order_id is defined when checkout_process.php is first loaded, then maybe it will work to include it there. Otherwise you would use the variable $order_id directly. Steve Contributions: Country-State Selector Login Page a la Amazon Protection of Configuration Updated spiders.txt Embed Links with SID in Description Link to comment Share on other sites More sharing options...
dahui Posted September 9, 2005 Author Share Posted September 9, 2005 No - you can't use EMAIL_TEXT_ORDER_NUMBER in this context as the value of that is set when the language file is included, unless the variable you specify there is set at the place where the file is included. If $order_id is defined when checkout_process.php is first loaded, then maybe it will work to include it there. Otherwise you would use the variable $order_id directly. <{POST_SNAPBACK}> stevel my php-help-angel :D man it workz smoothly like this: split the define in langauge file altered the payment module file to match in catalog/checkout_process.php altered the code as follows: if ($payment_class->email_footer) { $email_order .= $payment_class->email_footer . "\n"; $email_order .= "KdNr: " . $customer_id . " / " . EMAIL_TEXT_ORDER_NUMBER . ' ' . $insert_id . " / v." . strftime(DATE_FORMAT_SHORT) . "\n\n"; $email_order .= $payment_class->email_footer2 . "\n"; } and it workz brilliant apart that now it is in all confirms ;) if statementsare already two steps infront of my knowledge, I just learb by try and error. what would the statement look like to make this part $email_order .= "KdNr: " . $customer_id . " / " . EMAIL_TEXT_ORDER_NUMBER . ' ' . $insert_id . " / v." . strftime(DATE_FORMAT_SHORT) . "\n\n"; $email_order .= $payment_class->email_footer2 . "\n"; } only to happen when the payment module is moneyorder? dahui Link to comment Share on other sites More sharing options...
stevel Posted September 9, 2005 Share Posted September 9, 2005 You can test for ($payment_class->code== 'cod') Steve Contributions: Country-State Selector Login Page a la Amazon Protection of Configuration Updated spiders.txt Embed Links with SID in Description Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.