Show Shipping method name on Email

  • Posts: 14
  • Thank you received: 0
12 years 1 month ago #42647

Hi,

Is it possible to show the chosen shipping method name on the email that is sent to the customer.

I have found where to edit the email - just need to know what code i should be using.

Cheers

CHRIS

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

  • Posts: 81540
  • Thank you received: 13071
  • MODERATOR
12 years 1 month ago #42794

If you want to display the shipping method name in the emails, you can add such code:

<?php $shippingClass = hikashop_get('class.shipping'); 
$shipping = $shippingClass->get($data->order_shipping_id); 
$shipping->shipping_params = unserialize($shipping->shipping_params);
echo 'Shipping method: '. $shipping->shipping_name; ?>

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

  • Posts: 14
  • Thank you received: 0
12 years 1 month ago #42795

thanks for that nicolas thats great

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

  • Posts: 3
  • Thank you received: 0
11 years 9 months ago #58527

Didn't show the name of the shipping method for me.
But this worked:

<?php echo 'Shipping Method: '.$data->order_shipping_id; ?>
Maybe it will help somebody...

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

  • Posts: 81540
  • Thank you received: 13071
  • MODERATOR
11 years 9 months ago #58563

It depends on the shipping plugin you're using actually. It's one or the other.

Thank you for your feedback.

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

  • Posts: 3
  • Thank you received: 1
11 years 4 months ago #79737

Could you please tell me where to insert that code.

Thanks.

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

  • Posts: 81540
  • Thank you received: 13071
  • MODERATOR
11 years 4 months ago #79809

You can add that via the menu System->Emails in the Business edition. There, edit the order creation/status notification emails and you can add that code there.

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

  • Posts: 234
  • Thank you received: 4
11 years 3 months ago #85383

Hello, how would i insert the payment method on the email?

Thanks.

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

  • Posts: 26008
  • Thank you received: 4004
  • MODERATOR
11 years 3 months ago #85597

Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 234
  • Thank you received: 4
11 years 3 months ago #85607

Jerome

Thank you, but that is a link to this article. Have i missed something?

Iain

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

  • Posts: 13201
  • Thank you received: 2322
11 years 3 months ago #85618

Hi,

He gave you a link to this topic because the method for the payment methods is the same than the shipping, just have to replace shipping by payment.

<?php $paymentClass = hikashop_get('class.payment'); 
$payment = $paymentClass->get($data->order_payment_id); 
$payment->payment_params = unserialize($payment->payment_params);
echo 'Payment method: '. $payment->payment_name; ?>

The following user(s) said Thank You: aheng5

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

  • Posts: 234
  • Thank you received: 4
11 years 3 months ago #85630

Thank you for that :)

Would there be somewhere that would list all of these classes. I am not that hot on PHP/coding. I would also like it to show the customer's e-mail address. Ideally in the From section of the e-mail. If not at least like the code you have given.

so
email address : This email address is being protected from spambots. You need JavaScript enabled to view it.

Yours
Iain

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

  • Posts: 13201
  • Thank you received: 2322
11 years 3 months ago #85647

You can find all the classes in the tree "administrator/components/com_hikashop/classes".
To display the customer's email address, you can use the var: "$mail->from_name", so "echo 'email address: '.$mail->from_name;"

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

  • Posts: 234
  • Thank you received: 4
11 years 3 months ago #85666

Star, thank you very much.

Perhaps you could point out to me where I am going wrong with this one...

<?php $mailClass = hikashop_get('class.mail');
$mail = $mailClass->get($data->from_name);
$mail->mail_params = unserialize($mail->mail_params);
echo 'email address: '. $mail->from_name; ?>

Iain

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

  • Posts: 81540
  • Thank you received: 13071
  • MODERATOR
11 years 3 months ago #85733

The variable $mail already exists in the emails code. So you just need to do:
<?php echo 'email address: '. $mail->from_name; ?>

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

  • Posts: 234
  • Thank you received: 4
11 years 3 months ago #85766

Thank you for that but it only shows my e-mail address (as in the shop) not the customers. Is there any way to have this in the email from header so that as I look down the list of e-mails I can see who they are from. At present, it says. Draganfly Motorcycles.

Thanks

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

  • Posts: 26008
  • Thank you received: 4004
  • MODERATOR
11 years 3 months ago #85783

Hi,

Maybe using "from_email" instead of "from_name" ?

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 234
  • Thank you received: 4
11 years 3 months ago #85800

Thank you, I tried that but it gave the from address of the website ie This email address is being protected from spambots. You need JavaScript enabled to view it. rather than the from address of the customer. I then tried removing the from details in System>e-mail but this didn't make a change.

Thanks
Iain

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

  • Posts: 81540
  • Thank you received: 13071
  • MODERATOR
11 years 3 months ago #85822

I was a bit fast and didn't read carefully all your messages.

The code to display the email address of the user is:
<?php
$userClass = hikashop_get('class.user');
$userClass->get(false);
$user = $userClass->get($data->order_user_id);
echo $user->user_email; ?>

The following user(s) said Thank You: mad-q, SG

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

  • Posts: 8
  • Thank you received: 0
10 years 7 months ago #125405

Xavier wrote: Hi,

He gave you a link to this topic because the method for the payment methods is the same than the shipping, just have to replace shipping by payment.

<?php $paymentClass = hikashop_get('class.payment'); 
$payment = $paymentClass->get($data->order_payment_id); 
$payment->payment_params = unserialize($payment->payment_params);
echo 'Payment method: '. $payment->payment_name; ?>


Hello, I feel a bit stupid, but can you tell me where exactly (what line?) I need to add this code in email?

Your advice is appriciated

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

Time to create page: 0.139 seconds
Powered by Kunena Forum