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

#   use "date format" twice for numbers

##

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

Less More

- Posts: 103
- Thank you received: 5
-
-

7 years 9 months ago [\#303608](#303608) by [n00bster](/forum/user/56367-n00bster "View n00bster's Profile")  *[use "date format" twice for numbers](/forum/35-orders-management/896873-use-date-format-twice-for-numbers#303608 "-- HikaShop version -- : 4.0.2  hi. i need to get this type of order and invoice number:  but it looks like that only one &quot;date format&quot; placeholder are working in the number fields, is this a bug or a feature? the output is:")* was created by *[n00bster](/forum/user/56367-n00bster "View n00bster's Profile")*

-- HikaShop version -- : 4.0.2

hi. i need to get this type of order and invoice number: Code:

{date format="dm"}-AB{date format="y"}-{order_id} {date format="dm"}-RE{date format="y"}-{order_id}

**but it looks like that only one "date format" placeholder are working in the number fields, is this a bug or a feature?**
the output is: Code:

0802-AB{date format="y"}-13 0802-RE{date format="y"}-13

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM1LW9yZGVycy1tYW5hZ2VtZW50Lzg5Njg3My11c2UtZGF0ZS1mb3JtYXQtdHdpY2UtZm9yLW51bWJlcnM/dG1wbD1tYXJrZG93bg==) 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: 86583
- Thank you received: 14324
-
-

7 years 9 months ago -  7 years 9 months ago [\#303609](#303609) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[use "date format" twice for numbers](/forum/35-orders-management/896873-use-date-format-twice-for-numbers#303609 "-- HikaShop version -- : 4.0.2  hi. i need to get this type of order and invoice number:  but it looks like that only one &quot;date format&quot; placeholder are working in the number fields, is this a bug or a feature? the output is:")*

Hi,

It's neither a bug nor a feature. It's something we just didn't thought would be needed and thus isn't implemented.
Now looking at the code it should be quite easy to add.

Change the code: Code:

if(preg_match('#\{date *format ?= ?(?:"&#124;\')(.*)(?:"&#124;\') *\}#Ui',$format,$matches)) { $format = str_replace($matches[0],date($matches[1],$data-&gt;order_modified),$format); }

to: Code:

if(preg_match_all('#\{date *format ?= ?(?:"&#124;\')(.*)(?:"&#124;\') *\}#Ui',$format,$matches)) { foreach($matches[0] as $k =&gt; $match) { $format = str_replace($match,date($matches[1][$k],$data-&gt;order_modified),$format); } }

in the file administrator/components/com_hikashop/helpers/helper.php and that should do it.

Last edit: 7 years 9 months ago by [Jerome](/forum/user/80-jerome "View Jerome's Profile").

The following user(s) said Thank You: [n00bster](/forum/user/56367-n00bster "View n00bster's Profile")

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

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

Less More

- Posts: 103
- Thank you received: 5
-
-

7 years 9 months ago [\#303627](#303627) by [n00bster](/forum/user/56367-n00bster "View n00bster's Profile")  Replied by *[n00bster](/forum/user/56367-n00bster "View n00bster's Profile")* on topic *[use "date format" twice for numbers](/forum/35-orders-management/896873-use-date-format-twice-for-numbers#303627 "-- HikaShop version -- : 4.0.2  hi. i need to get this type of order and invoice number:  but it looks like that only one &quot;date format&quot; placeholder are working in the number fields, is this a bug or a feature? the output is:")*

your snippet works perfect. is this code getting in the core?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM1LW9yZGVycy1tYW5hZ2VtZW50Lzg5Njg3My11c2UtZGF0ZS1mb3JtYXQtdHdpY2UtZm9yLW51bWJlcnM/dG1wbD1tYXJrZG93bg==) 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: 86583
- Thank you received: 14324
-
-

7 years 9 months ago [\#303653](#303653) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[use "date format" twice for numbers](/forum/35-orders-management/896873-use-date-format-twice-for-numbers#303653 "-- HikaShop version -- : 4.0.2  hi. i need to get this type of order and invoice number:  but it looks like that only one &quot;date format&quot; placeholder are working in the number fields, is this a bug or a feature? the output is:")*

Hi,

Now that you confirmed it works, yes, it will be in the next version ![:)](/media/kunena/emoticons/3.png ":)")

The following user(s) said Thank You: [n00bster](/forum/user/56367-n00bster "View n00bster's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM1LW9yZGVycy1tYW5hZ2VtZW50Lzg5Njg3My11c2UtZGF0ZS1mb3JtYXQtdHdpY2UtZm9yLW51bWJlcnM/dG1wbD1tYXJrZG93bg==) 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.053 seconds

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