order number and email creation notification

  • Posts: 1119
  • Thank you received: 114
9 years 1 month ago #217053

Hi,

So I tried to modify order creation email. I want order number to be displayed above information.
Here is the code I used but cant get order number to be displayed.

JText::sprintf('PLEASE_TRANSFERT_MONEY',$amount).'<br/>'.JText::sprintf('INCLUDE_ORDER_NUMBER_TO_TRANSFER',$order_number).'<br/>'.$information.'<br/>'.

So order number is missing from page/email? why?

Last edit: 9 years 1 month ago by kyratn.

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

  • Posts: 82868
  • Thank you received: 13378
  • MODERATOR
9 years 1 month ago #217076

Hi,

There is no variable $order_number in the order creation email and there is no translation key INCLUDE_ORDER_NUMBER_TO_TRANSFER in HikaShop. So I suppose you're not telling everything.
Thus, it's hard to tell you why it doesn't work. It could be that you didn't define properly $order_number, or the way you added your new translation key (if you did at all), or the location where you added your code in the email, ...

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

  • Posts: 1119
  • Thank you received: 114
9 years 1 month ago #217099

If you look order creation notification email preload version line 430 you will find this code:

echo '<p>' . JText::sprintf('PLEASE_TRANSFERT_MONEY',$amount).'<br/>'.$information.'<br/>'.JText::sprintf('INCLUDE_ORDER_NUMBER_TO_TRANSFER',$data->order_number) . '</p>';

What I would like to have is to display include_order_number_to_transfer above information. So I changed as in my first message and everything is displayed correctly except no order id...As I am noob with php maybe I miss something?

This kind modification is working fine with banktransfer plugin....

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

  • Posts: 82868
  • Thank you received: 13378
  • MODERATOR
9 years 1 month ago #217132

Hi,

In the code of your first message, you're using $order_number instead of $data->order_number (like in your last message). Wouldn't that be the problem ?

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

  • Posts: 1119
  • Thank you received: 114
9 years 1 month ago #217182

Ahh, you are right. My mistake.

Another question regarding code.

I have added this code to after_end file which I took from bank transfer plugin.

<?php echo JText::_('ORDER_IS_COMPLETE').'<br/>'.
JText::sprintf('PLEASE_TRANSFERT_MONEY',$amount).'<br/>'.
JText::sprintf('INCLUDE_ORDER_NUMBER_TO_TRANSFER',$order_number).'<br/>'.
$information.'<br/>'.
JText::_('THANK_YOU_FOR_PURCHASE');?>

I want to have same thank you page for all my payments. Everything is fine but amount is not displayed. What code I should use?
Something like $data->order_amount ??

Thanks again Nicolas for your brilliant support!

Last edit: 9 years 1 month ago by kyratn.

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

  • Posts: 82868
  • Thank you received: 13378
  • MODERATOR
9 years 1 month ago #217199

No.

You unfortunately can't copy paste code randomly.

In the after_end view, the order data is loaded in $this->order
So you can do like that:

<?php echo JText::_('ORDER_IS_COMPLETE').'<br/>'.
JText::sprintf('PLEASE_TRANSFERT_MONEY',$this->order->order_full_price).'<br/>'.
JText::sprintf('INCLUDE_ORDER_NUMBER_TO_TRANSFER',$this->order->order_number).'<br/>'.
$information.'<br/>'.
JText::_('THANK_YOU_FOR_PURCHASE');?>

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

  • Posts: 1119
  • Thank you received: 114
9 years 1 month ago #217561

Hi,

Been away for few days and tried your code only now. It seems to work but order amount displayed not right.
I mean if order is for 8.10eur it will display 8.10000 and without euro sign. Is there any way to fix it?

Also, I tried to enable wishlist and everything is ok with Xavier help. However I use popup mode and after product added to wishlist how to modify show wishlist button? Right now if pressed it will display wishlist on same page but I would like some redirect to user cpanel>wishlist
Is there any code I could use. After few hours I couldn't do it :(

Thanks

Last edit: 9 years 1 month ago by kyratn.

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

  • Posts: 82868
  • Thank you received: 13378
  • MODERATOR
9 years 1 month ago #217611

Hi,

I've given you a simple solution. It's normally up to you to adapt it to your needs...
For example, by changing the line:
JText::sprintf('PLEASE_TRANSFERT_MONEY',$this->order->order_full_price).'<br/>'.

to:
$currencyClass = hikashop_get('class.currency');
JText::sprintf('PLEASE_TRANSFERT_MONEY',$currencyClass->format(round($this->order->order_full_price,2))).'<br/>'.

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

Time to create page: 0.063 seconds
Powered by Kunena Forum