Total Price In Email

  • Posts: 129
  • Thank you received: 0
6 years 7 months ago #277010

hi,
i got some questions and need some codes and help in customizing my email tempales.

1.
i'd like to add a custom variable to show total price inside couple of hikashop email templates.
i think i have to define that in preload file and then add the echo code in html
how can i do that ?
by total price i mean the price that user has paid
total price - coupoun discount - point discount + shipping costs
and any other changes !

Thanks

Last edit: 6 years 7 months ago by nic7071.

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

  • Posts: 129
  • Thank you received: 0
6 years 7 months ago #277022

2.

this code :
<?php echo hikashop_getDate($data->cart->order_created); ?>
is returning Shamsi/Persian Date in Admin notification email
but in Status notification email this code is returning English Date Format.
i want a code to return the order creation date in Shamsi/Persian Format in StatusNotification Email !


P.S: My Joomla Admin is in English and my Joomla Front End is in Persian RTL format!

Last edit: 6 years 7 months ago by nic7071.

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

  • Posts: 129
  • Thank you received: 0
6 years 7 months ago #277027

3.
i'd like to show the name of order statuses instead of namekey.
cause it looks like i cannot change the name key but i have changed the name of my statuses and i want to use my status names instead of name keys inside my email templates.

is it possible ?

Last edit: 6 years 7 months ago by nic7071.

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

  • Posts: 81539
  • Thank you received: 13069
  • MODERATOR
6 years 7 months ago #277014

Hi,

1.
I don't understand what you mean by total price.
The total price is available like that in the HTML version of the email:
<?php echo $data->cart->order_full_price; ?>

This already includes the shipping costs, the points and coupon discounts, etc. It'a actually already displayed in the email and labelled as "total", so I'm not sure what you're trying to do.

2.
The second parameter of the hikashop_getDate function is the format:
php.net/manual/en/function.date.php
You can use the same formats than the examples there with the hikashop_getDate function so you can set exactly the format you want.

3.
Both the name and the namekey are available in the table #__hikashop_orderstatuses.
So you can load the corresponding row from that table with a MySQL query to get the name based on the namekey.

Last edit: 6 years 7 months ago by nicolas.
The following user(s) said Thank You: nic7071

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

  • Posts: 129
  • Thank you received: 0
6 years 7 months ago #277099

Hi Nicolas,
Thanks for your answer.
1.
i'm using the code u mentioned and it's working,
any way it's returning number like this: 5102000.00000
can i remove the additional zeros and add thousand separator like this: 5,102,000

2.
Thanks to the article you introduced it's done.

3.
can you tell me the code that echoes the Name of Order Statuses instead of name keys ?
i'm currently using this code and this is returning the namekey.

{VAR:order.order_status}

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

  • Posts: 81539
  • Thank you received: 13069
  • MODERATOR
6 years 7 months ago #277106

Hi,

1.
Sure. You can use the number_format function of PHP for that:
php.net/manual/en/function.number-format.php

3.
This one:
<?php echo $data->mail_status; ?>

The following user(s) said Thank You: nic7071

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

  • Posts: 129
  • Thank you received: 0
6 years 7 months ago #277197

Thanks Man ;-)

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

Time to create page: 0.067 seconds
Powered by Kunena Forum