[Skip to main content](#vessel-content)

#   Add due date of Advanced date picker module to admin email title

##

- **[wildweststudios](/forum/user/31720-wildweststudios "View wildweststudios's Profile")**
- [![wildweststudios's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/31720-wildweststudios "View wildweststudios's Profile") Topic Author
- [ Offline](/forum/user/31720-wildweststudios)

Less More

- Posts: 75
- Thank you received: 7
-
-

9 years 7 months ago [\#265684](#265684) by [wildweststudios](/forum/user/31720-wildweststudios "View wildweststudios's Profile")  *[Add due date of Advanced date picker module to admin email title](/forum/35-orders-management/889495-add-due-date-of-advanced-date-picker-module-to-admin-email-title#265684 "-- HikaShop version -- : 2.6.3 -- Joomla version -- : 3.6.5 -- PHP version -- : 5.6.3 -- Browser(s) name and version -- : Chrome 56.0.2924.87  Hello,  I need to put the due date of each order into the subject lines of our admin notification email subject lines.  I can do this sort of, but I have two problems:  1. even though I add the variable for my custom field 'yourdesiredduedate' (it's an Advanced date picker module), for some reason the date format comes out different in the subject line than it does in the email itself.  For example, in the email body it will read &quot;03/31/2017&quot;, but in the subject line it reads '20170331000000'.  Is there somewhere I can change that format?  2. For some reason my subject line leaves out one variable. Even though I have the placeholder '%s' in my 'NEW&#95;ORDER&#95;SUBJECT' language override.  So the entire subject line will read:  New Customer order No. WW-00855 created on site.com - 20170331000000  My NEW&#95;ORDER&#95;SUBJECT code is:  New %s order No. %s created on site.com%s%s%s  and the code I have in Order.php is:  You can see I have 5 placeholders in my override, and 4 variables in my order subject line in the code. I suppose HIKASHOP&#95;LIVE is a variable, but that one doesn't print in the subject line (which is fine, we don't want it to).  Please let me know of any help you can offer. Thanks!")* was created by *[wildweststudios](/forum/user/31720-wildweststudios "View wildweststudios's Profile")*

-- HikaShop version -- : 2.6.3
-- Joomla version -- : 3.6.5
-- PHP version -- : 5.6.3
-- Browser(s) name and version -- : Chrome 56.0.2924.87

Hello,

I need to put the due date of each order into the subject lines of our admin notification email subject lines.

I can do this sort of, but I have two problems:

**1.** even though I add the variable for my custom field 'yourdesiredduedate' (it's an Advanced date picker module), for some reason the date format comes out different in the subject line than it does in the email itself.

For example, in the email body it will read "03/31/2017", but in the subject line it reads '20170331000000'.

Is there somewhere I can change that format?

**2.** For some reason my subject line leaves out one variable. Even though I have the placeholder '%s' in my 'NEW_ORDER_SUBJECT' language override.

So the entire subject line will read:

New Customer order No. WW-00855 created on site.com - 20170331000000

My NEW_ORDER_SUBJECT code is:

New %s order No. %s created on site.com%s%s%s

and the code I have in Order.php is:

Code:

$order-&gt;customer-&gt;user_email = explode(',',$emails); $order-&gt;customer-&gt;name= ' '; $this-&gt;loadOrderNotification($order,'order_admin_notification'); $address_company = $order-&gt;cart-&gt;billing_address-&gt;address_company; $shipto_method = $order-&gt;cart-&gt;billing_address-&gt;shipto_method; $yourdesiredduedate = $order-&gt;cart-&gt;yourdesiredduedate; $order-&gt;mail-&gt;subject = JText::sprintf('NEW_ORDER_SUBJECT',$address_company,$order-&gt;order_number,' - ',$shipto_method,$yourdesiredduedate,HIKASHOP_LIVE);

You can see I have 5 placeholders in my override, and 4 variables in my order subject line in the code. I suppose HIKASHOP_LIVE is a variable, but that one doesn't print in the subject line (which is fine, we don't want it to).

Please let me know of any help you can offer. Thanks!

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM1LW9yZGVycy1tYW5hZ2VtZW50Lzg4OTQ5NS1hZGQtZHVlLWRhdGUtb2YtYWR2YW5jZWQtZGF0ZS1waWNrZXItbW9kdWxlLXRvLWFkbWluLWVtYWlsLXRpdGxlP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86540
- Thank you received: 14300
-
-

9 years 7 months ago [\#265688](#265688) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Add due date of Advanced date picker module to admin email title](/forum/35-orders-management/889495-add-due-date-of-advanced-date-picker-module-to-admin-email-title#265688 "-- HikaShop version -- : 2.6.3 -- Joomla version -- : 3.6.5 -- PHP version -- : 5.6.3 -- Browser(s) name and version -- : Chrome 56.0.2924.87  Hello,  I need to put the due date of each order into the subject lines of our admin notification email subject lines.  I can do this sort of, but I have two problems:  1. even though I add the variable for my custom field 'yourdesiredduedate' (it's an Advanced date picker module), for some reason the date format comes out different in the subject line than it does in the email itself.  For example, in the email body it will read &quot;03/31/2017&quot;, but in the subject line it reads '20170331000000'.  Is there somewhere I can change that format?  2. For some reason my subject line leaves out one variable. Even though I have the placeholder '%s' in my 'NEW&#95;ORDER&#95;SUBJECT' language override.  So the entire subject line will read:  New Customer order No. WW-00855 created on site.com - 20170331000000  My NEW&#95;ORDER&#95;SUBJECT code is:  New %s order No. %s created on site.com%s%s%s  and the code I have in Order.php is:  You can see I have 5 placeholders in my override, and 4 variables in my order subject line in the code. I suppose HIKASHOP&#95;LIVE is a variable, but that one doesn't print in the subject line (which is fine, we don't want it to).  Please let me know of any help you can offer. Thanks!")*

Hi,

1. That's the data of the custom field. It's stored like that in the database. If you want to convert it, you need to call the show function of class.field
Here is an example with a custom item field:
[ www.hikashop.com/forum/product-category-...e-picker.html#202906](https://www.hikashop.com/forum/product-category-display/877178-how-show-a-product-custom-field-date-picker.html#202906)

2. You indeed have 5 placeholders in your override, but I count 6 variables in your code:
$address_company
$order-&gt;order_number
' - '
$shipto_method
$yourdesiredduedate
HIKASHOP_LIVE

So it's normal that the last one, HIKASHOP_LIVE is missing.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM1LW9yZGVycy1tYW5hZ2VtZW50Lzg4OTQ5NS1hZGQtZHVlLWRhdGUtb2YtYWR2YW5jZWQtZGF0ZS1waWNrZXItbW9kdWxlLXRvLWFkbWluLWVtYWlsLXRpdGxlP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[wildweststudios](/forum/user/31720-wildweststudios "View wildweststudios's Profile")**
- [![wildweststudios's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/31720-wildweststudios "View wildweststudios's Profile") Topic Author
- [ Offline](/forum/user/31720-wildweststudios)

Less More

- Posts: 75
- Thank you received: 7
-
-

9 years 7 months ago [\#265984](#265984) by [wildweststudios](/forum/user/31720-wildweststudios "View wildweststudios's Profile")  Replied by *[wildweststudios](/forum/user/31720-wildweststudios "View wildweststudios's Profile")* on topic *[Add due date of Advanced date picker module to admin email title](/forum/35-orders-management/889495-add-due-date-of-advanced-date-picker-module-to-admin-email-title#265984 "-- HikaShop version -- : 2.6.3 -- Joomla version -- : 3.6.5 -- PHP version -- : 5.6.3 -- Browser(s) name and version -- : Chrome 56.0.2924.87  Hello,  I need to put the due date of each order into the subject lines of our admin notification email subject lines.  I can do this sort of, but I have two problems:  1. even though I add the variable for my custom field 'yourdesiredduedate' (it's an Advanced date picker module), for some reason the date format comes out different in the subject line than it does in the email itself.  For example, in the email body it will read &quot;03/31/2017&quot;, but in the subject line it reads '20170331000000'.  Is there somewhere I can change that format?  2. For some reason my subject line leaves out one variable. Even though I have the placeholder '%s' in my 'NEW&#95;ORDER&#95;SUBJECT' language override.  So the entire subject line will read:  New Customer order No. WW-00855 created on site.com - 20170331000000  My NEW&#95;ORDER&#95;SUBJECT code is:  New %s order No. %s created on site.com%s%s%s  and the code I have in Order.php is:  You can see I have 5 placeholders in my override, and 4 variables in my order subject line in the code. I suppose HIKASHOP&#95;LIVE is a variable, but that one doesn't print in the subject line (which is fine, we don't want it to).  Please let me know of any help you can offer. Thanks!")*

Hi Nicolas,

Thanks for your response.

Ok, I'll have to investigate the formatting of the custom field further.

For now, I still have trouble even displaying the value of the field in the subject line. The number of variables showing is still coming out wrong, despite me adding the new placeholder to my override.

So now I have this same code in the 'Order.php' file:
Code:

$order-&gt;customer-&gt;user_email = explode(',',$emails); $order-&gt;customer-&gt;name= ' '; $this-&gt;loadOrderNotification($order,'order_admin_notification'); $address_company = $order-&gt;cart-&gt;billing_address-&gt;address_company; $shipto_method = $order-&gt;cart-&gt;billing_address-&gt;shipto_method; $yourdesiredduedate = $order-&gt;cart-&gt;yourdesiredduedate; $order-&gt;mail-&gt;subject = JText::sprintf('NEW_ORDER_SUBJECT',$address_company,$order-&gt;order_number,' - ',$shipto_method,$yourdesiredduedate,HIKASHOP_LIVE);

and my override now looks like this:
Code:

New %s order No. %s created on Playerkits.com%s%s%s%s

so we can see that there are now 6 placeholders. However my subject line of my email comes out looking like this:
Code:

New Customer order No. WW-00855 created on Playerkits.com - 20170331000000http://www.site.com/

So for some reason it's only showing 5 of the available variables:
Code:

$address_company $order-&gt;order_number ' - ' $shipto_method $yourdesiredduedate HIKASHOP_LIVE

It's completely skipping my "shipto_method" for some reason. Do you have any idea what's going wrong here?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM1LW9yZGVycy1tYW5hZ2VtZW50Lzg4OTQ5NS1hZGQtZHVlLWRhdGUtb2YtYWR2YW5jZWQtZGF0ZS1waWNrZXItbW9kdWxlLXRvLWFkbWluLWVtYWlsLXRpdGxlP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86540
- Thank you received: 14300
-
-

9 years 7 months ago [\#265987](#265987) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Add due date of Advanced date picker module to admin email title](/forum/35-orders-management/889495-add-due-date-of-advanced-date-picker-module-to-admin-email-title#265987 "-- HikaShop version -- : 2.6.3 -- Joomla version -- : 3.6.5 -- PHP version -- : 5.6.3 -- Browser(s) name and version -- : Chrome 56.0.2924.87  Hello,  I need to put the due date of each order into the subject lines of our admin notification email subject lines.  I can do this sort of, but I have two problems:  1. even though I add the variable for my custom field 'yourdesiredduedate' (it's an Advanced date picker module), for some reason the date format comes out different in the subject line than it does in the email itself.  For example, in the email body it will read &quot;03/31/2017&quot;, but in the subject line it reads '20170331000000'.  Is there somewhere I can change that format?  2. For some reason my subject line leaves out one variable. Even though I have the placeholder '%s' in my 'NEW&#95;ORDER&#95;SUBJECT' language override.  So the entire subject line will read:  New Customer order No. WW-00855 created on site.com - 20170331000000  My NEW&#95;ORDER&#95;SUBJECT code is:  New %s order No. %s created on site.com%s%s%s  and the code I have in Order.php is:  You can see I have 5 placeholders in my override, and 4 variables in my order subject line in the code. I suppose HIKASHOP&#95;LIVE is a variable, but that one doesn't print in the subject line (which is fine, we don't want it to).  Please let me know of any help you can offer. Thanks!")*

Hi,

It's impossible that it's skipping it. Which means that your problem is that the variable $shipto_method is empty.
So probably there is no value in the billing address for the custom address field with the column name "shipto_method".

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM1LW9yZGVycy1tYW5hZ2VtZW50Lzg4OTQ5NS1hZGQtZHVlLWRhdGUtb2YtYWR2YW5jZWQtZGF0ZS1waWNrZXItbW9kdWxlLXRvLWFkbWluLWVtYWlsLXRpdGxlP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[wildweststudios](/forum/user/31720-wildweststudios "View wildweststudios's Profile")**
- [![wildweststudios's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/31720-wildweststudios "View wildweststudios's Profile") Topic Author
- [ Offline](/forum/user/31720-wildweststudios)

Less More

- Posts: 75
- Thank you received: 7
-
-

9 years 7 months ago [\#266096](#266096) by [wildweststudios](/forum/user/31720-wildweststudios "View wildweststudios's Profile")  Replied by *[wildweststudios](/forum/user/31720-wildweststudios "View wildweststudios's Profile")* on topic *[Add due date of Advanced date picker module to admin email title](/forum/35-orders-management/889495-add-due-date-of-advanced-date-picker-module-to-admin-email-title#266096 "-- HikaShop version -- : 2.6.3 -- Joomla version -- : 3.6.5 -- PHP version -- : 5.6.3 -- Browser(s) name and version -- : Chrome 56.0.2924.87  Hello,  I need to put the due date of each order into the subject lines of our admin notification email subject lines.  I can do this sort of, but I have two problems:  1. even though I add the variable for my custom field 'yourdesiredduedate' (it's an Advanced date picker module), for some reason the date format comes out different in the subject line than it does in the email itself.  For example, in the email body it will read &quot;03/31/2017&quot;, but in the subject line it reads '20170331000000'.  Is there somewhere I can change that format?  2. For some reason my subject line leaves out one variable. Even though I have the placeholder '%s' in my 'NEW&#95;ORDER&#95;SUBJECT' language override.  So the entire subject line will read:  New Customer order No. WW-00855 created on site.com - 20170331000000  My NEW&#95;ORDER&#95;SUBJECT code is:  New %s order No. %s created on site.com%s%s%s  and the code I have in Order.php is:  You can see I have 5 placeholders in my override, and 4 variables in my order subject line in the code. I suppose HIKASHOP&#95;LIVE is a variable, but that one doesn't print in the subject line (which is fine, we don't want it to).  Please let me know of any help you can offer. Thanks!")*

Yes, you are absolutely correct. My shipto_method field was indeed empty. So everything that should be showing is indeed showing in the subject of my email now.

However, this brings me back to the format of my date. I modified the code from the linked thread you provided, but it doesn't do anything at all.

I place this code into the preload section of my Admin email:
Code:

$fieldsClass = hikashop_get('class.field'); $element=null; $fields = $fieldsClass-&gt;getFields('',$element,'order'); echo $fieldsClass-&gt;show($fields['yourdesiredduedate'], $this-&gt;row-&gt;yourdesiredduedate);

I placed it at the end after the "ob_start" section, before the 'JPluginHelper' line.

Where should I be placing this code? And should I change the code at all? Thanks!

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM1LW9yZGVycy1tYW5hZ2VtZW50Lzg4OTQ5NS1hZGQtZHVlLWRhdGUtb2YtYWR2YW5jZWQtZGF0ZS1waWNrZXItbW9kdWxlLXRvLWFkbWluLWVtYWlsLXRpdGxlP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86540
- Thank you received: 14300
-
-

9 years 7 months ago [\#266098](#266098) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Add due date of Advanced date picker module to admin email title](/forum/35-orders-management/889495-add-due-date-of-advanced-date-picker-module-to-admin-email-title#266098 "-- HikaShop version -- : 2.6.3 -- Joomla version -- : 3.6.5 -- PHP version -- : 5.6.3 -- Browser(s) name and version -- : Chrome 56.0.2924.87  Hello,  I need to put the due date of each order into the subject lines of our admin notification email subject lines.  I can do this sort of, but I have two problems:  1. even though I add the variable for my custom field 'yourdesiredduedate' (it's an Advanced date picker module), for some reason the date format comes out different in the subject line than it does in the email itself.  For example, in the email body it will read &quot;03/31/2017&quot;, but in the subject line it reads '20170331000000'.  Is there somewhere I can change that format?  2. For some reason my subject line leaves out one variable. Even though I have the placeholder '%s' in my 'NEW&#95;ORDER&#95;SUBJECT' language override.  So the entire subject line will read:  New Customer order No. WW-00855 created on site.com - 20170331000000  My NEW&#95;ORDER&#95;SUBJECT code is:  New %s order No. %s created on site.com%s%s%s  and the code I have in Order.php is:  You can see I have 5 placeholders in my override, and 4 variables in my order subject line in the code. I suppose HIKASHOP&#95;LIVE is a variable, but that one doesn't print in the subject line (which is fine, we don't want it to).  Please let me know of any help you can offer. Thanks!")*

Hi,

That code is correct.
However, you need to understand that the show function require its first parameter to be a field data.
If Code:

$fields['yourdesiredduedate']

is empty, which I assume it is, then the show function won't work properly as it doesn't have the data of the custom field and thus it doesn't know how you configured the custom field.
And thus, you need to also understand how the getFields function works. It returns an array of the fields data available for the element given in its second parameter. Since you give it an empty parameter, it will give you back all the fields that apply to any order regardless of what you have in the order. So if your custom field is limited to only some products or some categories, then the data of that custom field won't be in the array returned by the getFields function.
Now you didn't provide a screenshot of the settings of your custom field, so I don't know if that's the case but I bet it is something along those lines.
An easy alternative would be to run your own MySQL query to load the field data yourself from the hikashop_field table.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM1LW9yZGVycy1tYW5hZ2VtZW50Lzg4OTQ5NS1hZGQtZHVlLWRhdGUtb2YtYWR2YW5jZWQtZGF0ZS1waWNrZXItbW9kdWxlLXRvLWFkbWluLWVtYWlsLXRpdGxlP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[wildweststudios](/forum/user/31720-wildweststudios "View wildweststudios's Profile")**
- [![wildweststudios's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/31720-wildweststudios "View wildweststudios's Profile") Topic Author
- [ Offline](/forum/user/31720-wildweststudios)

Less More

- Posts: 75
- Thank you received: 7
-
-

9 years 7 months ago [\#266188](#266188) by [wildweststudios](/forum/user/31720-wildweststudios "View wildweststudios's Profile")  Replied by *[wildweststudios](/forum/user/31720-wildweststudios "View wildweststudios's Profile")* on topic *[Add due date of Advanced date picker module to admin email title](/forum/35-orders-management/889495-add-due-date-of-advanced-date-picker-module-to-admin-email-title#266188 "-- HikaShop version -- : 2.6.3 -- Joomla version -- : 3.6.5 -- PHP version -- : 5.6.3 -- Browser(s) name and version -- : Chrome 56.0.2924.87  Hello,  I need to put the due date of each order into the subject lines of our admin notification email subject lines.  I can do this sort of, but I have two problems:  1. even though I add the variable for my custom field 'yourdesiredduedate' (it's an Advanced date picker module), for some reason the date format comes out different in the subject line than it does in the email itself.  For example, in the email body it will read &quot;03/31/2017&quot;, but in the subject line it reads '20170331000000'.  Is there somewhere I can change that format?  2. For some reason my subject line leaves out one variable. Even though I have the placeholder '%s' in my 'NEW&#95;ORDER&#95;SUBJECT' language override.  So the entire subject line will read:  New Customer order No. WW-00855 created on site.com - 20170331000000  My NEW&#95;ORDER&#95;SUBJECT code is:  New %s order No. %s created on site.com%s%s%s  and the code I have in Order.php is:  You can see I have 5 placeholders in my override, and 4 variables in my order subject line in the code. I suppose HIKASHOP&#95;LIVE is a variable, but that one doesn't print in the subject line (which is fine, we don't want it to).  Please let me know of any help you can offer. Thanks!")*

Hi Nicolas,

alright, so maybe I have inadvertently restricted the field from being loaded correctly? That same field shows correctly within the *body* of the email, so I assume it must be loaded correctly at some point.

I have included the screenshot of that field, so hopefully you can spot what I'm doing wrong here.

- [ ![desiredduedate-screen.jpg](/forum/attachment/37326) ](/forum/attachment/37326 "...ate-screen.jpg") [ ](/forum/attachment/37326?download=1 "...ate-screen.jpg")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM1LW9yZGVycy1tYW5hZ2VtZW50Lzg4OTQ5NS1hZGQtZHVlLWRhdGUtb2YtYWR2YW5jZWQtZGF0ZS1waWNrZXItbW9kdWxlLXRvLWFkbWluLWVtYWlsLXRpdGxlP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86540
- Thank you received: 14300
-
-

9 years 7 months ago [\#266197](#266197) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Add due date of Advanced date picker module to admin email title](/forum/35-orders-management/889495-add-due-date-of-advanced-date-picker-module-to-admin-email-title#266197 "-- HikaShop version -- : 2.6.3 -- Joomla version -- : 3.6.5 -- PHP version -- : 5.6.3 -- Browser(s) name and version -- : Chrome 56.0.2924.87  Hello,  I need to put the due date of each order into the subject lines of our admin notification email subject lines.  I can do this sort of, but I have two problems:  1. even though I add the variable for my custom field 'yourdesiredduedate' (it's an Advanced date picker module), for some reason the date format comes out different in the subject line than it does in the email itself.  For example, in the email body it will read &quot;03/31/2017&quot;, but in the subject line it reads '20170331000000'.  Is there somewhere I can change that format?  2. For some reason my subject line leaves out one variable. Even though I have the placeholder '%s' in my 'NEW&#95;ORDER&#95;SUBJECT' language override.  So the entire subject line will read:  New Customer order No. WW-00855 created on site.com - 20170331000000  My NEW&#95;ORDER&#95;SUBJECT code is:  New %s order No. %s created on site.com%s%s%s  and the code I have in Order.php is:  You can see I have 5 placeholders in my override, and 4 variables in my order subject line in the code. I suppose HIKASHOP&#95;LIVE is a variable, but that one doesn't print in the subject line (which is fine, we don't want it to).  Please let me know of any help you can offer. Thanks!")*

Hi,

That's what I thought ![:)](/media/kunena/emoticons/3.png ":)")
As I can see on your screenshot, the field is limited to the category "product category".
Remove that restriction and your code should work.
Otherwise, you can also change :
$fields = $fieldsClass-&gt;getFields('',$element,'order');
to:
$fields = $fieldsClass-&gt;getFields('',$order,'order'); / Or $order-&gt;cart ?
so that the fields loaded take into account the data of the order and include the fields with restrictions on the categories of the products of the order.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM1LW9yZGVycy1tYW5hZ2VtZW50Lzg4OTQ5NS1hZGQtZHVlLWRhdGUtb2YtYWR2YW5jZWQtZGF0ZS1waWNrZXItbW9kdWxlLXRvLWFkbWluLWVtYWlsLXRpdGxlP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[wildweststudios](/forum/user/31720-wildweststudios "View wildweststudios's Profile")**
- [![wildweststudios's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/31720-wildweststudios "View wildweststudios's Profile") Topic Author
- [ Offline](/forum/user/31720-wildweststudios)

Less More

- Posts: 75
- Thank you received: 7
-
-

9 years 7 months ago [\#266678](#266678) by [wildweststudios](/forum/user/31720-wildweststudios "View wildweststudios's Profile")  Replied by *[wildweststudios](/forum/user/31720-wildweststudios "View wildweststudios's Profile")* on topic *[Add due date of Advanced date picker module to admin email title](/forum/35-orders-management/889495-add-due-date-of-advanced-date-picker-module-to-admin-email-title#266678 "-- HikaShop version -- : 2.6.3 -- Joomla version -- : 3.6.5 -- PHP version -- : 5.6.3 -- Browser(s) name and version -- : Chrome 56.0.2924.87  Hello,  I need to put the due date of each order into the subject lines of our admin notification email subject lines.  I can do this sort of, but I have two problems:  1. even though I add the variable for my custom field 'yourdesiredduedate' (it's an Advanced date picker module), for some reason the date format comes out different in the subject line than it does in the email itself.  For example, in the email body it will read &quot;03/31/2017&quot;, but in the subject line it reads '20170331000000'.  Is there somewhere I can change that format?  2. For some reason my subject line leaves out one variable. Even though I have the placeholder '%s' in my 'NEW&#95;ORDER&#95;SUBJECT' language override.  So the entire subject line will read:  New Customer order No. WW-00855 created on site.com - 20170331000000  My NEW&#95;ORDER&#95;SUBJECT code is:  New %s order No. %s created on site.com%s%s%s  and the code I have in Order.php is:  You can see I have 5 placeholders in my override, and 4 variables in my order subject line in the code. I suppose HIKASHOP&#95;LIVE is a variable, but that one doesn't print in the subject line (which is fine, we don't want it to).  Please let me know of any help you can offer. Thanks!")*

Hi Nicolas,

for some reason it's still not working as I had hoped.

I'm still getting that default date formatting.

I've attached a screenshot of my custom field, where I have removed the restriction from the category.

And here is the code I tried. Both this:
Code:

$fieldsClass = hikashop_get('class.field'); $element=null; $fields = $fieldsClass-&gt;getFields('',$order-&gt;cart,'order'); echo $fieldsClass-&gt;show($fields['yourdesiredduedate'], $this-&gt;row-&gt;yourdesiredduedate);

and this:
Code:

$fieldsClass = hikashop_get('class.field'); $element=null; $fields = $fieldsClass-&gt;getFields('',$order,'order'); echo $fieldsClass-&gt;show($fields['yourdesiredduedate'], $this-&gt;row-&gt;yourdesiredduedate);

but my subject lines still come out like this:
Code:

New Customer order No. WW-00865 created on Playerkits.com - 20170428000000

I'm hoping here that I just mis-applied the code...?

- [ ![desiredduedate-screen2.jpg](/forum/attachment/37429) ](/forum/attachment/37429 "...te-screen2.jpg") [ ](/forum/attachment/37429?download=1 "...te-screen2.jpg")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM1LW9yZGVycy1tYW5hZ2VtZW50Lzg4OTQ5NS1hZGQtZHVlLWRhdGUtb2YtYWR2YW5jZWQtZGF0ZS1waWNrZXItbW9kdWxlLXRvLWFkbWluLWVtYWlsLXRpdGxlP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86540
- Thank you received: 14300
-
-

9 years 7 months ago [\#266754](#266754) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Add due date of Advanced date picker module to admin email title](/forum/35-orders-management/889495-add-due-date-of-advanced-date-picker-module-to-admin-email-title#266754 "-- HikaShop version -- : 2.6.3 -- Joomla version -- : 3.6.5 -- PHP version -- : 5.6.3 -- Browser(s) name and version -- : Chrome 56.0.2924.87  Hello,  I need to put the due date of each order into the subject lines of our admin notification email subject lines.  I can do this sort of, but I have two problems:  1. even though I add the variable for my custom field 'yourdesiredduedate' (it's an Advanced date picker module), for some reason the date format comes out different in the subject line than it does in the email itself.  For example, in the email body it will read &quot;03/31/2017&quot;, but in the subject line it reads '20170331000000'.  Is there somewhere I can change that format?  2. For some reason my subject line leaves out one variable. Even though I have the placeholder '%s' in my 'NEW&#95;ORDER&#95;SUBJECT' language override.  So the entire subject line will read:  New Customer order No. WW-00855 created on site.com - 20170331000000  My NEW&#95;ORDER&#95;SUBJECT code is:  New %s order No. %s created on site.com%s%s%s  and the code I have in Order.php is:  You can see I have 5 placeholders in my override, and 4 variables in my order subject line in the code. I suppose HIKASHOP&#95;LIVE is a variable, but that one doesn't print in the subject line (which is fine, we don't want it to).  Please let me know of any help you can offer. Thanks!")*

Hi,

Well, I don't know the context of your code.
Why do you have the custom field value in $this-&gt;row if you have $order ? Do you actually have the $order variable ?
And why do you echo the return of the show function ? Wasn't the goal to add it in the subject of the email ?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM1LW9yZGVycy1tYW5hZ2VtZW50Lzg4OTQ5NS1hZGQtZHVlLWRhdGUtb2YtYWR2YW5jZWQtZGF0ZS1waWNrZXItbW9kdWxlLXRvLWFkbWluLWVtYWlsLXRpdGxlP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[wildweststudios](/forum/user/31720-wildweststudios "View wildweststudios's Profile")**
- [![wildweststudios's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/31720-wildweststudios "View wildweststudios's Profile") Topic Author
- [ Offline](/forum/user/31720-wildweststudios)

Less More

- Posts: 75
- Thank you received: 7
-
-

9 years 7 months ago [\#266793](#266793) by [wildweststudios](/forum/user/31720-wildweststudios "View wildweststudios's Profile")  Replied by *[wildweststudios](/forum/user/31720-wildweststudios "View wildweststudios's Profile")* on topic *[Add due date of Advanced date picker module to admin email title](/forum/35-orders-management/889495-add-due-date-of-advanced-date-picker-module-to-admin-email-title#266793 "-- HikaShop version -- : 2.6.3 -- Joomla version -- : 3.6.5 -- PHP version -- : 5.6.3 -- Browser(s) name and version -- : Chrome 56.0.2924.87  Hello,  I need to put the due date of each order into the subject lines of our admin notification email subject lines.  I can do this sort of, but I have two problems:  1. even though I add the variable for my custom field 'yourdesiredduedate' (it's an Advanced date picker module), for some reason the date format comes out different in the subject line than it does in the email itself.  For example, in the email body it will read &quot;03/31/2017&quot;, but in the subject line it reads '20170331000000'.  Is there somewhere I can change that format?  2. For some reason my subject line leaves out one variable. Even though I have the placeholder '%s' in my 'NEW&#95;ORDER&#95;SUBJECT' language override.  So the entire subject line will read:  New Customer order No. WW-00855 created on site.com - 20170331000000  My NEW&#95;ORDER&#95;SUBJECT code is:  New %s order No. %s created on site.com%s%s%s  and the code I have in Order.php is:  You can see I have 5 placeholders in my override, and 4 variables in my order subject line in the code. I suppose HIKASHOP&#95;LIVE is a variable, but that one doesn't print in the subject line (which is fine, we don't want it to).  Please let me know of any help you can offer. Thanks!")*

Hi Nicolas,

I don't know the answer to any of your questions except for the last one - and the answer to that one is yes, I need a readable date in the subject of the email.

As for the rest, I don't know PHP well, so I don't know why most of that code is there, which is why I need help with this. I copied a lot of it from the thread you linked to earlier, and tried to adjust it the best i could.

At this point, the only thing that needs to be done is to format the date correctly. I do get the date itself in the subject, but it's in an unfriendly format that is not easily scanned. If you (or someone) could just tell me how to change that date format I'd be all set.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM1LW9yZGVycy1tYW5hZ2VtZW50Lzg4OTQ5NS1hZGQtZHVlLWRhdGUtb2YtYWR2YW5jZWQtZGF0ZS1waWNrZXItbW9kdWxlLXRvLWFkbWluLWVtYWlsLXRpdGxlP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86540
- Thank you received: 14300
-
-

9 years 7 months ago [\#266845](#266845) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Add due date of Advanced date picker module to admin email title](/forum/35-orders-management/889495-add-due-date-of-advanced-date-picker-module-to-admin-email-title#266845 "-- HikaShop version -- : 2.6.3 -- Joomla version -- : 3.6.5 -- PHP version -- : 5.6.3 -- Browser(s) name and version -- : Chrome 56.0.2924.87  Hello,  I need to put the due date of each order into the subject lines of our admin notification email subject lines.  I can do this sort of, but I have two problems:  1. even though I add the variable for my custom field 'yourdesiredduedate' (it's an Advanced date picker module), for some reason the date format comes out different in the subject line than it does in the email itself.  For example, in the email body it will read &quot;03/31/2017&quot;, but in the subject line it reads '20170331000000'.  Is there somewhere I can change that format?  2. For some reason my subject line leaves out one variable. Even though I have the placeholder '%s' in my 'NEW&#95;ORDER&#95;SUBJECT' language override.  So the entire subject line will read:  New Customer order No. WW-00855 created on site.com - 20170331000000  My NEW&#95;ORDER&#95;SUBJECT code is:  New %s order No. %s created on site.com%s%s%s  and the code I have in Order.php is:  You can see I have 5 placeholders in my override, and 4 variables in my order subject line in the code. I suppose HIKASHOP&#95;LIVE is a variable, but that one doesn't print in the subject line (which is fine, we don't want it to).  Please let me know of any help you can offer. Thanks!")*

Hi,

Please provide the whole code that you have in the function where you have your code. Because without context, I can't provide precise code, I can only provide examples where you need to adapt the variables to the context where you are.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM1LW9yZGVycy1tYW5hZ2VtZW50Lzg4OTQ5NS1hZGQtZHVlLWRhdGUtb2YtYWR2YW5jZWQtZGF0ZS1waWNrZXItbW9kdWxlLXRvLWFkbWluLWVtYWlsLXRpdGxlP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[wildweststudios](/forum/user/31720-wildweststudios "View wildweststudios's Profile")**
- [![wildweststudios's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/31720-wildweststudios "View wildweststudios's Profile") Topic Author
- [ Offline](/forum/user/31720-wildweststudios)

Less More

- Posts: 75
- Thank you received: 7
-
-

9 years 7 months ago [\#266888](#266888) by [wildweststudios](/forum/user/31720-wildweststudios "View wildweststudios's Profile")  Replied by *[wildweststudios](/forum/user/31720-wildweststudios "View wildweststudios's Profile")* on topic *[Add due date of Advanced date picker module to admin email title](/forum/35-orders-management/889495-add-due-date-of-advanced-date-picker-module-to-admin-email-title#266888 "-- HikaShop version -- : 2.6.3 -- Joomla version -- : 3.6.5 -- PHP version -- : 5.6.3 -- Browser(s) name and version -- : Chrome 56.0.2924.87  Hello,  I need to put the due date of each order into the subject lines of our admin notification email subject lines.  I can do this sort of, but I have two problems:  1. even though I add the variable for my custom field 'yourdesiredduedate' (it's an Advanced date picker module), for some reason the date format comes out different in the subject line than it does in the email itself.  For example, in the email body it will read &quot;03/31/2017&quot;, but in the subject line it reads '20170331000000'.  Is there somewhere I can change that format?  2. For some reason my subject line leaves out one variable. Even though I have the placeholder '%s' in my 'NEW&#95;ORDER&#95;SUBJECT' language override.  So the entire subject line will read:  New Customer order No. WW-00855 created on site.com - 20170331000000  My NEW&#95;ORDER&#95;SUBJECT code is:  New %s order No. %s created on site.com%s%s%s  and the code I have in Order.php is:  You can see I have 5 placeholders in my override, and 4 variables in my order subject line in the code. I suppose HIKASHOP&#95;LIVE is a variable, but that one doesn't print in the subject line (which is fine, we don't want it to).  Please let me know of any help you can offer. Thanks!")*

Hi Nicolas,

Ok, I think where you're asking for the "function", that's not something I quite understand. But, here's the bottom part of the code from the Preload section of my Admin Notification Override.

The only part of this I have changed is where I added the 4 line block of code staring with "$fieldsClass" after the first chunk of code.

Should this code be placed somewhere else?

Code:

ob_start(); $sep = ''; if(hikashop_level(2)) { $fields = $fieldsClass-&gt;getFields('frontcomp',$data,'order',''); foreach($fields as $fieldName =&gt; $oneExtraField) { if(empty($data-&gt;cart-&gt;$fieldName)) continue; echo '&lt;span class="top_pkinfo_headers"&gt;' .$sep . $fieldsClass-&gt;trans($oneExtraField-&gt;field_realname).' : &lt;span&gt;'.$fieldsClass-&gt;show($oneExtraField, $data-&gt;cart-&gt;$fieldName,'admin_email').'&lt;/span&gt;&lt;/span&gt;'; $sep = ' '; } } // This is the part added by wildweststudios $fieldsClass = hikashop_get('class.field'); $element=null; $fields = $fieldsClass-&gt;getFields('',$order-&gt;cart,'order'); echo $fieldsClass-&gt;show($fields['yourdesiredduedate'], $this-&gt;row-&gt;yourdesiredduedate); // End part added by wildweststudios JPluginHelper::importPlugin('hikashop'); $dispatcher = JDispatcher::getInstance(); $dispatcher-&gt;trigger('onAfterOrderProductsListingDisplay', array(&amp;$data-&gt;cart, 'email_notification_html')); $content = ob_get_clean(); $vars['ORDER_SUMMARY'] = $content; $vars['BILLING_ADDRESS'] = ''; $vars['SHIPPING_ADDRESS'] = ''; $params = null; $js = ''; $fieldsClass = hikashop_get('class.field'); $template = trim(hikashop_getLayout($view,'address_template',$params,$js)); if(!empty($data-&gt;cart-&gt;billing_address) &amp;&amp; !empty($data-&gt;cart-&gt;fields)){ $billing = ''.$template; foreach($data-&gt;cart-&gt;fields as $field){ $fieldname = $field-&gt;field_namekey; if(!empty($data-&gt;cart-&gt;billing_address-&gt;$fieldname)) $billing=str_replace('{'.$fieldname.'}',$fieldsClass-&gt;show($field,$data-&gt;cart-&gt;billing_address-&gt;$fieldname),$billing); } $vars['BILLING_ADDRESS'] = str_replace(array("\r\n","\r","\n"),'&lt;br/&gt;',preg_replace('#{(?:(?!}).)*}#i','',$billing)); } if(!empty($data-&gt;cart-&gt;override_shipping_address)) { $vars['SHIPPING_ADDRESS'] = $data-&gt;cart-&gt;override_shipping_address; } elseif(!empty($data-&gt;order_shipping_id) &amp;&amp; !empty($data-&gt;cart-&gt;shipping_address)) { $shipping = ''.$template; foreach($data-&gt;cart-&gt;fields as $field) { $fieldname = $field-&gt;field_namekey; if(!empty($data-&gt;cart-&gt;shipping_address-&gt;$fieldname)) $shipping=str_replace('{'.$fieldname.'}',$fieldsClass-&gt;show($field,$data-&gt;cart-&gt;shipping_address-&gt;$fieldname),$shipping); } $vars['SHIPPING_ADDRESS'] = str_replace(array("\r\n","\r","\n"),'&lt;br/&gt;',preg_replace('#{(?:(?!}).)*}#i','',$shipping)); } else { $vars['SHIPPING_ADDRESS'] = $vars['BILLING_ADDRESS']; }

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM1LW9yZGVycy1tYW5hZ2VtZW50Lzg4OTQ5NS1hZGQtZHVlLWRhdGUtb2YtYWR2YW5jZWQtZGF0ZS1waWNrZXItbW9kdWxlLXRvLWFkbWluLWVtYWlsLXRpdGxlP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26400
- Thank you received: 4079
-
- [](http://obsi.dev)
-

9 years 7 months ago [\#266959](#266959) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Add due date of Advanced date picker module to admin email title](/forum/35-orders-management/889495-add-due-date-of-advanced-date-picker-module-to-admin-email-title#266959 "-- HikaShop version -- : 2.6.3 -- Joomla version -- : 3.6.5 -- PHP version -- : 5.6.3 -- Browser(s) name and version -- : Chrome 56.0.2924.87  Hello,  I need to put the due date of each order into the subject lines of our admin notification email subject lines.  I can do this sort of, but I have two problems:  1. even though I add the variable for my custom field 'yourdesiredduedate' (it's an Advanced date picker module), for some reason the date format comes out different in the subject line than it does in the email itself.  For example, in the email body it will read &quot;03/31/2017&quot;, but in the subject line it reads '20170331000000'.  Is there somewhere I can change that format?  2. For some reason my subject line leaves out one variable. Even though I have the placeholder '%s' in my 'NEW&#95;ORDER&#95;SUBJECT' language override.  So the entire subject line will read:  New Customer order No. WW-00855 created on site.com - 20170331000000  My NEW&#95;ORDER&#95;SUBJECT code is:  New %s order No. %s created on site.com%s%s%s  and the code I have in Order.php is:  You can see I have 5 placeholders in my override, and 4 variables in my order subject line in the code. I suppose HIKASHOP&#95;LIVE is a variable, but that one doesn't print in the subject line (which is fine, we don't want it to).  Please let me know of any help you can offer. Thanks!")*

Hello,

I'm afraid that in the email context, the variables "$order-&gt;cart" and "$this-&gt;row" does not exist.
So, your code cannot work properly because you're not giving the right data to the functions.

Regards,

---

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

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM1LW9yZGVycy1tYW5hZ2VtZW50Lzg4OTQ5NS1hZGQtZHVlLWRhdGUtb2YtYWR2YW5jZWQtZGF0ZS1waWNrZXItbW9kdWxlLXRvLWFkbWluLWVtYWlsLXRpdGxlP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[wildweststudios](/forum/user/31720-wildweststudios "View wildweststudios's Profile")**
- [![wildweststudios's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/31720-wildweststudios "View wildweststudios's Profile") Topic Author
- [ Offline](/forum/user/31720-wildweststudios)

Less More

- Posts: 75
- Thank you received: 7
-
-

9 years 7 months ago [\#267106](#267106) by [wildweststudios](/forum/user/31720-wildweststudios "View wildweststudios's Profile")  Replied by *[wildweststudios](/forum/user/31720-wildweststudios "View wildweststudios's Profile")* on topic *[Add due date of Advanced date picker module to admin email title](/forum/35-orders-management/889495-add-due-date-of-advanced-date-picker-module-to-admin-email-title#267106 "-- HikaShop version -- : 2.6.3 -- Joomla version -- : 3.6.5 -- PHP version -- : 5.6.3 -- Browser(s) name and version -- : Chrome 56.0.2924.87  Hello,  I need to put the due date of each order into the subject lines of our admin notification email subject lines.  I can do this sort of, but I have two problems:  1. even though I add the variable for my custom field 'yourdesiredduedate' (it's an Advanced date picker module), for some reason the date format comes out different in the subject line than it does in the email itself.  For example, in the email body it will read &quot;03/31/2017&quot;, but in the subject line it reads '20170331000000'.  Is there somewhere I can change that format?  2. For some reason my subject line leaves out one variable. Even though I have the placeholder '%s' in my 'NEW&#95;ORDER&#95;SUBJECT' language override.  So the entire subject line will read:  New Customer order No. WW-00855 created on site.com - 20170331000000  My NEW&#95;ORDER&#95;SUBJECT code is:  New %s order No. %s created on site.com%s%s%s  and the code I have in Order.php is:  You can see I have 5 placeholders in my override, and 4 variables in my order subject line in the code. I suppose HIKASHOP&#95;LIVE is a variable, but that one doesn't print in the subject line (which is fine, we don't want it to).  Please let me know of any help you can offer. Thanks!")*

Hi Jerome, thanks for the response.

Ok, I see then that the current code will not work.

So the question still remains, what code actually *will* work? Thanks!

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM1LW9yZGVycy1tYW5hZ2VtZW50Lzg4OTQ5NS1hZGQtZHVlLWRhdGUtb2YtYWR2YW5jZWQtZGF0ZS1waWNrZXItbW9kdWxlLXRvLWFkbWluLWVtYWlsLXRpdGxlP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26400
- Thank you received: 4079
-
- [](http://obsi.dev)
-

9 years 7 months ago [\#267113](#267113) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Add due date of Advanced date picker module to admin email title](/forum/35-orders-management/889495-add-due-date-of-advanced-date-picker-module-to-admin-email-title#267113 "-- HikaShop version -- : 2.6.3 -- Joomla version -- : 3.6.5 -- PHP version -- : 5.6.3 -- Browser(s) name and version -- : Chrome 56.0.2924.87  Hello,  I need to put the due date of each order into the subject lines of our admin notification email subject lines.  I can do this sort of, but I have two problems:  1. even though I add the variable for my custom field 'yourdesiredduedate' (it's an Advanced date picker module), for some reason the date format comes out different in the subject line than it does in the email itself.  For example, in the email body it will read &quot;03/31/2017&quot;, but in the subject line it reads '20170331000000'.  Is there somewhere I can change that format?  2. For some reason my subject line leaves out one variable. Even though I have the placeholder '%s' in my 'NEW&#95;ORDER&#95;SUBJECT' language override.  So the entire subject line will read:  New Customer order No. WW-00855 created on site.com - 20170331000000  My NEW&#95;ORDER&#95;SUBJECT code is:  New %s order No. %s created on site.com%s%s%s  and the code I have in Order.php is:  You can see I have 5 placeholders in my override, and 4 variables in my order subject line in the code. I suppose HIKASHOP&#95;LIVE is a variable, but that one doesn't print in the subject line (which is fine, we don't want it to).  Please let me know of any help you can offer. Thanks!")*

Hello,

In the email context, you have the variable "$data".
And as you can see in the code just before what you have pasted, you will find the loading of the order custom field and the display of these fields ; just like what you want to do. Code:

$fields = $fieldsClass-&gt;getFields('frontcomp',$data,'order','');

Code:

$fieldsClass-&gt;show($oneExtraField, $data-&gt;cart-&gt;$fieldName,'admin_email')

Regards,

---

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

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM1LW9yZGVycy1tYW5hZ2VtZW50Lzg4OTQ5NS1hZGQtZHVlLWRhdGUtb2YtYWR2YW5jZWQtZGF0ZS1waWNrZXItbW9kdWxlLXRvLWFkbWluLWVtYWlsLXRpdGxlP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[wildweststudios](/forum/user/31720-wildweststudios "View wildweststudios's Profile")**
- [![wildweststudios's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/31720-wildweststudios "View wildweststudios's Profile") Topic Author
- [ Offline](/forum/user/31720-wildweststudios)

Less More

- Posts: 75
- Thank you received: 7
-
-

9 years 7 months ago [\#267217](#267217) by [wildweststudios](/forum/user/31720-wildweststudios "View wildweststudios's Profile")  Replied by *[wildweststudios](/forum/user/31720-wildweststudios "View wildweststudios's Profile")* on topic *[Add due date of Advanced date picker module to admin email title](/forum/35-orders-management/889495-add-due-date-of-advanced-date-picker-module-to-admin-email-title#267217 "-- HikaShop version -- : 2.6.3 -- Joomla version -- : 3.6.5 -- PHP version -- : 5.6.3 -- Browser(s) name and version -- : Chrome 56.0.2924.87  Hello,  I need to put the due date of each order into the subject lines of our admin notification email subject lines.  I can do this sort of, but I have two problems:  1. even though I add the variable for my custom field 'yourdesiredduedate' (it's an Advanced date picker module), for some reason the date format comes out different in the subject line than it does in the email itself.  For example, in the email body it will read &quot;03/31/2017&quot;, but in the subject line it reads '20170331000000'.  Is there somewhere I can change that format?  2. For some reason my subject line leaves out one variable. Even though I have the placeholder '%s' in my 'NEW&#95;ORDER&#95;SUBJECT' language override.  So the entire subject line will read:  New Customer order No. WW-00855 created on site.com - 20170331000000  My NEW&#95;ORDER&#95;SUBJECT code is:  New %s order No. %s created on site.com%s%s%s  and the code I have in Order.php is:  You can see I have 5 placeholders in my override, and 4 variables in my order subject line in the code. I suppose HIKASHOP&#95;LIVE is a variable, but that one doesn't print in the subject line (which is fine, we don't want it to).  Please let me know of any help you can offer. Thanks!")*

Hi Jerome,

alright great, I put in this code in place of my other code:
Code:

$fields = $fieldsClass-&gt;getFields('frontcomp',$data,'order',''); $fieldsClass-&gt;show($oneExtraField, $data-&gt;cart-&gt;$yourdesiredduedate,'admin_email');

While it doesn't send the admin email, it shows a mostly blank screen with only this text:
Code:

Your Desired Due Date : 04/28/2017

So the date is actually formatted correctly, but I can't tell if it's correct in the subject of the email, since it never sends.

How should I modify this to get it working?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM1LW9yZGVycy1tYW5hZ2VtZW50Lzg4OTQ5NS1hZGQtZHVlLWRhdGUtb2YtYWR2YW5jZWQtZGF0ZS1waWNrZXItbW9kdWxlLXRvLWFkbWluLWVtYWlsLXRpdGxlP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26400
- Thank you received: 4079
-
- [](http://obsi.dev)
-

9 years 7 months ago [\#267219](#267219) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Add due date of Advanced date picker module to admin email title](/forum/35-orders-management/889495-add-due-date-of-advanced-date-picker-module-to-admin-email-title#267219 "-- HikaShop version -- : 2.6.3 -- Joomla version -- : 3.6.5 -- PHP version -- : 5.6.3 -- Browser(s) name and version -- : Chrome 56.0.2924.87  Hello,  I need to put the due date of each order into the subject lines of our admin notification email subject lines.  I can do this sort of, but I have two problems:  1. even though I add the variable for my custom field 'yourdesiredduedate' (it's an Advanced date picker module), for some reason the date format comes out different in the subject line than it does in the email itself.  For example, in the email body it will read &quot;03/31/2017&quot;, but in the subject line it reads '20170331000000'.  Is there somewhere I can change that format?  2. For some reason my subject line leaves out one variable. Even though I have the placeholder '%s' in my 'NEW&#95;ORDER&#95;SUBJECT' language override.  So the entire subject line will read:  New Customer order No. WW-00855 created on site.com - 20170331000000  My NEW&#95;ORDER&#95;SUBJECT code is:  New %s order No. %s created on site.com%s%s%s  and the code I have in Order.php is:  You can see I have 5 placeholders in my override, and 4 variables in my order subject line in the code. I suppose HIKASHOP&#95;LIVE is a variable, but that one doesn't print in the subject line (which is fine, we don't want it to).  Please let me know of any help you can offer. Thanks!")*

Code:

$data-&gt;cart-&gt;yourdesiredduedate

---

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

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM1LW9yZGVycy1tYW5hZ2VtZW50Lzg4OTQ5NS1hZGQtZHVlLWRhdGUtb2YtYWR2YW5jZWQtZGF0ZS1waWNrZXItbW9kdWxlLXRvLWFkbWluLWVtYWlsLXRpdGxlP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.098 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
