Include the chosen payment and shipping method

  • Posts: 107
  • Thank you received: 1
11 years 10 months ago #82802

Hi there,

I wonder how can I include the customer's chosen payment and shipping method in the order creation/status confirmation email?

Thank you so much. :)

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

  • Posts: 13201
  • Thank you received: 2322
11 years 10 months ago #82890

Hi,

You can edit the mail in HikaShop > System > Emails, then edit the order_creation_notification email (or status) and the payment method should be in the object "$data", try to do a var_dump($data) to see the name of the var.
Then do a echo $data->theVar.

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

  • Posts: 107
  • Thank you received: 1
11 years 10 months ago #83500

Dear X.,

I do not understand how to do var_dump($data)?

Can I do "echo $data->payment_type" and "echo $data->shipping_type" ?

Thank you so much. :)

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

  • Posts: 12953
  • Thank you received: 1778
11 years 10 months ago #83506

Hi Tinachou,

If you want to display the payment method name, you can use this PHP code :

<?php
$paymentClass = hikashop::get('class.payment');
$payment = $paymentClass->get($data->order_payment_id);
echo $payment->payment_name; ?>
And if you want to display the shipping method name :
<?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; ?>

Hope this will help you.

The following user(s) said Thank You: tinachou

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

  • Posts: 107
  • Thank you received: 1
11 years 10 months ago #83591

Hi M.,

I am very thankful for your sharing.

I have a shipping method which will send the product to a user-specified convenient store.

Thus, I need to email the customer to remind him/her about the convenient store's info.

I wonder how should I apply the conditional logic, like:

<?php

 if (shipping_method=="convenient_store")
{ echo "the convenient store address is:XXX" ; }

But I do not know what is the correct form to write shipping_method=="convenient_store" ? Should I check the id of that shipping method?

THank you so much. :)

Last edit: 11 years 10 months ago by tinachou.

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

  • Posts: 12953
  • Thank you received: 1778
11 years 10 months ago #83807

Hi,

I think that your conditionnal logic should be like this

<?php $shippingClass = hikashop_get('class.shipping'); 
$shipping = $shippingClass->get($data->order_shipping_id); 
$shipping->shipping_params = unserialize($shipping->shipping_params);
if($shipping->shipping_name == 'YOUR SHIPPING METHODE NAME'){
} 
?>

Hope this will help you.

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

Time to create page: 0.108 seconds
Powered by Kunena Forum