SamyT Posted February 12, 2008 Posted February 12, 2008 I have a payment method that sometimes fails and I want to add a message in checkout_confirmation, but I only want it to appear when this payment method is selected. Does anyone know what code I would need to add for that? I have cut and paste php skills lol
Guest Posted February 13, 2008 Posted February 13, 2008 The best way is to edit the payment module. open up catalog/includes/modules/payment/*mypaymentmodule.php* in the file find function confirmation() you will see this is a list of arrays - this specifies the information that is listed on the confirmation page. As an example the following is taken from the stock cc.php file Before $confirmation = array('title' => $this->title . ': ' . $this->cc_card_type, 'fields' => array(array('title' => MODULE_PAYMENT_CC_TEXT_CREDIT_CARD_OWNER, 'field' => $HTTP_POST_VARS['cc_owner']), array('title' => MODULE_PAYMENT_CC_TEXT_CREDIT_CARD_NUMBER, 'field' => substr($this->cc_card_number, 0, 4) . str_repeat('X', (strlen($this->cc_card_number) - 8)) . substr($this->cc_card_number, -4)), array('title' => MODULE_PAYMENT_CC_TEXT_CREDIT_CARD_EXPIRES, 'field' => strftime('%B, %Y', mktime(0,0,0,$HTTP_POST_VARS['cc_expires_month'], 1, '20' . $HTTP_POST_VARS['cc_expires_year']))))); After $confirmation = array('title' => $this->title . ': ' . $this->cc_card_type, 'fields' => array(array('title' => MODULE_PAYMENT_CC_TEXT_CREDIT_CARD_OWNER, 'field' => $HTTP_POST_VARS['cc_owner']), array('title' => MODULE_PAYMENT_CC_TEXT_CREDIT_CARD_NUMBER, 'field' => substr($this->cc_card_number, 0, 4) . str_repeat('X', (strlen($this->cc_card_number) - 8)) . substr($this->cc_card_number, -4)), array('title' => MODULE_PAYMENT_CC_TEXT_CREDIT_CARD_EXPIRES, 'field' => strftime('%B, %Y', mktime(0,0,0,$HTTP_POST_VARS['cc_expires_month'], 1, '20' . $HTTP_POST_VARS['cc_expires_year']))), array('title' => 'INFORMATION:', 'field' => 'SOMETIMES THIS PAYMENT METHOD DOESN'T WORK - IF SO PLEASE EMAIL US [email protected]')); I hope that gives you an idea of how to make the change you need.
SamyT Posted February 13, 2008 Author Posted February 13, 2008 Thank you for the response - would that allow me to put html in there? What I'd actually like to do is show an example of the button they need to press that solves this problem LOL
SamyT Posted February 13, 2008 Author Posted February 13, 2008 Ah.. I just opened up the module and the code is nothing like that. It's nothing like the CC module at all to look at. Thank you though, very grateful for any response.
SamyT Posted February 13, 2008 Author Posted February 13, 2008 I saw something in a module that looks like this: if($$payment->title != MODULE_PAYMENT_PAYMATE_TEXT_TITLE) { To me that's saying, if that's the payment module being used... but I don't know if that's right either, it's just how my mind reads it. The bit that follows that also, I don't know how to code so it shows a written message with an image.
♥GLWalker Posted February 13, 2008 Posted February 13, 2008 I saw something in a module that looks like this:To me that's saying, if that's the payment module being used... but I don't know if that's right either, it's just how my mind reads it. The bit that follows that also, I don't know how to code so it shows a written message with an image. look in your catalog/includes/languages/YOUR-LANGUAGE-HERE/modules/payment/your-payment-file-here.php Then look for something about title or just for some text you recognize from the payment page and edit away Follow the community build: BS3 to osCommerce Responsive from the Get Go! Check out the new construction: Admin Gone to Total BS!
burt Posted February 13, 2008 Posted February 13, 2008 I wrote about this recently on my blog! Someone asked about putting a message if the payment method selected was paypal... if ($payment_modules->selected_module == "paypal") was what I used when I made this change on a customers MS2 store, so; if ($payment_modules->selected_module == "paypal") echo "Your Message Here";
♥GLWalker Posted February 13, 2008 Posted February 13, 2008 I wrote about this recently on my blog! Someone asked about putting a message if the payment method selected was paypal... if ($payment_modules->selected_module == "paypal") was what I used when I made this change on a customers MS2 store, so; if ($payment_modules->selected_module == "paypal") echo "Your Message Here"; Good tip Burt Follow the community build: BS3 to osCommerce Responsive from the Get Go! Check out the new construction: Admin Gone to Total BS!
SamyT Posted February 13, 2008 Author Posted February 13, 2008 Brilliant! It took me like 1 hr to get the message to work properly but now it does. Thank you so much!
burt Posted February 14, 2008 Posted February 14, 2008 You can also test what is in the array, by doing this; <?php print_r($payment_modules); ?> Should you need to find the name of a different payment module or whatever.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.