Bank transfer details

  • Posts: 120
  • Thank you received: 1
11 years 5 months ago #114866

Hello,

I am looking into the below part of code at SYSTEM -> EMAILS -> ORDER CREATION NOTIFICATION:

                  if($data->order_payment_method=="collectondelivery"){
                         echo JText::_('ORDER_COLLECT_ON_DELIVERY');  
                     } else {
                         echo JText::_('ORDER_VALID_AFTER_PAYMENT');
                         if($data->order_payment_method=="banktransfer"){
                             $class = hikashop_get('class.payment');
                             $payment = $class->get($data->order_payment_id);
                             $payment->payment_params = unserialize($payment->payment_params);
                             echo $payment->payment_params->information;
                         }
                     } 

From the above code I understand that in case if payment method selected is BANKTRANSFER, then my customer has to receive message ORDER_VALID_AFTER_PAYMENT and payment details (bank name, bank account etc).
However, due to some reason, my customer does not get payment info to his e-mail. He only gets e-mail with ORDER_VALID_AFTER_PAYMENT message, but no bank details.
Can you kindly advice what might be the reason?

I have put necessary information here: SYSTEM -> PAYMENT METHODS -> BANKTRANSFER PLUGIN -> SPECIFIC CONFIGURATION section -> BANK ACCOUNT INFORMATION text box.

Do I have to put it somewhere else?

Regards

Last edit: 11 years 5 months ago by watashi.

Please Log in or Create an account to join the conversation.

  • Posts: 83025
  • Thank you received: 13404
  • MODERATOR
11 years 5 months ago #114921

Hi,

There is nothing else to do.
It should be automatic.
Nevertheless, you can simply add a line like below in your email code in order to display it in the email directly:
echo 'my bank details';

Please Log in or Create an account to join the conversation.

  • Posts: 120
  • Thank you received: 1
11 years 5 months ago #115000

Hi Nicolas,

Thanks for reply. That is what I am going to do, however, this part of code does not work:

                         if($data->order_payment_method=="banktransfer"){
                             $class = hikashop_get('class.payment');
                             $payment = $class->get($data->order_payment_id);
                             $payment->payment_params = unserialize($payment->payment_params);
                             echo $payment->payment_params->information;
                         }

There is no text in my e-mail between ORDER_VALID_AFTER_PAYMENT and THANK_YOU_FOR_YOUR_ORDER.

If my bank details change in the future, I will need to remember to change it not only at the back-end, but also in e-mails. It is not a good solution.

A screenshot of banktransfer plugin is attached hereto. Any mistake in its configuration from my side?

Best regards,

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
11 years 5 months ago #115046

Hi,

To check if you pass in the "if" condition you can add "echo $data->order_payment_method;" to see the value returned, and why it's not going in the if.

Please Log in or Create an account to join the conversation.

  • Posts: 120
  • Thank you received: 1
11 years 5 months ago #115147

Hi,

That's a good idea!

I have amended the piece with break-points as following:

                  if($data->order_payment_method=="collectondelivery"){
                         echo JText::_('ORDER_COLLECT_ON_DELIVERY');  
                     } else {
                         echo JText::_('ORDER_VALID_AFTER_PAYMENT');
                         echo '<br />"';
                         echo $data->order_payment_method;
                         echo '"';
                         if($data->order_payment_method=="banktransfer"){
                             $class = hikashop_get('class.payment');
                             echo "!1";
                             $payment = $class->get($data->order_payment_id);
                             echo "-";
                             echo $payment->payment_params->information;
                             $payment->payment_params = unserialize($payment->payment_params);
                             echo "-";
                             echo "!2";
                             echo $payment->payment_params->information;
                             echo "!3";
                         }
                     } 

Below is the result I've got in my e-mail:

"banktransfer"!1-
Ниже указан номер карты Приват Банка нашего сотрудника, на которую вы можете перечислить вышеуказанную сумму. Вы можете перечислить деньги через он-лайн систему Privat24, а также через банкомат или отделение Приват Банка (Карта отделений и банкоматов).

Номер карты: xxxx xxxx xxxx xxxx
Получатель: xxxx xxxx
-!2!3


Definitely, it goes into the "if" clause, but unserialize makes it blank...
What is the function of unserialize and why it removes the whole message. Does it hate Russian? :)

Please Log in or Create an account to join the conversation.

  • Posts: 83025
  • Thank you received: 13404
  • MODERATOR
11 years 5 months ago #115169

Hi,

It seems that you had previously override the email code before updating to the latest version which already unserialize that data before loading the email content.
In the latest version of HikaShop the information is not unserialized in the email anymore and if you do it, it create an error and empty the variable.

So you should indeed remove the unserialize there for it to work properly.

The following user(s) said Thank You: watashi

Please Log in or Create an account to join the conversation.

Time to create page: 0.080 seconds
Powered by Kunena Forum