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

#   Created Date when saving order

##

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

Less More

- Posts: 56
- Thank you received: 1
-
-

3 years 6 months ago [\#352043](#352043) by [jiawen](/forum/user/68179-jiawen "View jiawen's Profile")  *[Created Date when saving order](/forum/25-install-update/906466-created-date-when-saving-order#352043 "$orderClass = hikashop&#95;get('class.order'); $orderClass-&gt;save($order);  using this to manually save a hikashop order. it works fine when saving the fields excepting the created date. $order-&gt;order&#95;created = $timestamp;  using this to save the timestamp that order created, but always the current time be saved for the order.")* was created by *[jiawen](/forum/user/68179-jiawen "View jiawen's Profile")*

$orderClass = hikashop_get('class.order');
$orderClass-&gt;save($order);

using this to manually save a hikashop order. it works fine when saving the fields excepting the created date.
$order-&gt;order_created = $timestamp;

using this to save the timestamp that order created, but always the current time be saved for the order.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI1LWluc3RhbGwtdXBkYXRlLzkwNjQ2Ni1jcmVhdGVkLWRhdGUtd2hlbi1zYXZpbmctb3JkZXI/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: 86587
- Thank you received: 14327
-
-

3 years 6 months ago [\#352044](#352044) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Created Date when saving order](/forum/25-install-update/906466-created-date-when-saving-order#352044 "$orderClass = hikashop&#95;get('class.order'); $orderClass-&gt;save($order);  using this to manually save a hikashop order. it works fine when saving the fields excepting the created date. $order-&gt;order&#95;created = $timestamp;  using this to save the timestamp that order created, but always the current time be saved for the order.")*

Hi,

That's normal. The order_created is set by HikaShop inside the save function for new orders, regardless of what you provide.
What you can do is to resave the order with the order_created after the first save.
Otherwise, you can also implement the "onBeforeOrderCreate" event and set the order_created in there. The event happens after the save function sets the order_created with the current date, but before the order data is saved in the database. So it's a nice and lightweight method to force the order_created value to whatever you want.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI1LWluc3RhbGwtdXBkYXRlLzkwNjQ2Ni1jcmVhdGVkLWRhdGUtd2hlbi1zYXZpbmctb3JkZXI/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.041 seconds

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