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

#   Add order or cart from another component

##

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

Less More

- Posts: 18
- Thank you received: 0
-
-

15 years 7 months ago [\#13749](#13749) by [Jiwoks](/forum/user/2023-jiwoks "View Jiwoks's Profile")  *[Add order or cart from another component](/forum/4-how-to/13749-add-order-or-cart-from-another-component#13749 "Hello,  I have to create orders or carts from backend for other users. I think there is no way to do this from HikaShop backend, so I think I will make my own component to create orders or carts. Is there a way to do this properly by helper inclusion or some other stuff? Or maybe I have to insert it directly into the database.  Thanks.  Jiwoks")* was created by *[Jiwoks](/forum/user/2023-jiwoks "View Jiwoks's Profile")*

Hello,

I have to create orders or carts from backend for other users.
I think there is no way to do this from HikaShop backend, so I think I will make my own component to create orders or carts.
Is there a way to do this properly by helper inclusion or some other stuff?
Or maybe I have to insert it directly into the database.

Thanks.

Jiwoks

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzEzNzQ5LWFkZC1vcmRlci1vci1jYXJ0LWZyb20tYW5vdGhlci1jb21wb25lbnQ/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: 86561
- Thank you received: 14307
-
-

15 years 7 months ago [\#13754](#13754) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Add order or cart from another component](/forum/4-how-to/13749-add-order-or-cart-from-another-component#13754 "Hello,  I have to create orders or carts from backend for other users. I think there is no way to do this from HikaShop backend, so I think I will make my own component to create orders or carts. Is there a way to do this properly by helper inclusion or some other stuff? Or maybe I have to insert it directly into the database.  Thanks.  Jiwoks")*

Hi,

It depends on how you want to do it. How do you know which products to add to the orders ? And the user of the order ? What is your goal ?

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

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

Less More

- Posts: 18
- Thank you received: 0
-
-

15 years 7 months ago [\#13789](#13789) by [Jiwoks](/forum/user/2023-jiwoks "View Jiwoks's Profile")  Replied by *[Jiwoks](/forum/user/2023-jiwoks "View Jiwoks's Profile")* on topic *[Re: Add order or cart from another component](/forum/4-how-to/13749-add-order-or-cart-from-another-component#13789 "Hello,  I have to create orders or carts from backend for other users. I think there is no way to do this from HikaShop backend, so I think I will make my own component to create orders or carts. Is there a way to do this properly by helper inclusion or some other stuff? Or maybe I have to insert it directly into the database.  Thanks.  Jiwoks")*

Hi Nicolas,

Thanks for your reply.

Hikashop will be used for phone prospection.¨
Prospector will create the new user from the backend, create the cart or the order (should be the better solution) and send a link by mail to the customer.

The customer will be able to complete the order with the paiement.

The products are already in the database.

All this backend operations will be developed on a new component.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzEzNzQ5LWFkZC1vcmRlci1vci1jYXJ0LWZyb20tYW5vdGhlci1jb21wb25lbnQ/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: 86561
- Thank you received: 14307
-
-

15 years 7 months ago [\#13791](#13791) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Add order or cart from another component](/forum/4-how-to/13749-add-order-or-cart-from-another-component#13791 "Hello,  I have to create orders or carts from backend for other users. I think there is no way to do this from HikaShop backend, so I think I will make my own component to create orders or carts. Is there a way to do this properly by helper inclusion or some other stuff? Or maybe I have to insert it directly into the database.  Thanks.  Jiwoks")*

Ok.

In the order class of hikashop there are no easy functions to add a product to an order or the like as the complete information of orders is taken from the cart on the front end at the end of the checkout.
You have 2 possibilities here. Either you override the views of the order edition page in order to do what you want, or create a totally new component for that.

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

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

Less More

- Posts: 18
- Thank you received: 0
-
-

15 years 7 months ago [\#13795](#13795) by [Jiwoks](/forum/user/2023-jiwoks "View Jiwoks's Profile")  Replied by *[Jiwoks](/forum/user/2023-jiwoks "View Jiwoks's Profile")* on topic *[Re: Add order or cart from another component](/forum/4-how-to/13749-add-order-or-cart-from-another-component#13795 "Hello,  I have to create orders or carts from backend for other users. I think there is no way to do this from HikaShop backend, so I think I will make my own component to create orders or carts. Is there a way to do this properly by helper inclusion or some other stuff? Or maybe I have to insert it directly into the database.  Thanks.  Jiwoks")*

I think I will create my own component to insert cart into HikaShop tables.
But I have another question: in the table hikashop_cart what are the fields session_id and cart_modified, and cart_product_modified in hikashop_cart_product?

Are the cart deleted automaticaly if the user isn't connected during a long time?

Thanks in advance.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzEzNzQ5LWFkZC1vcmRlci1vci1jYXJ0LWZyb20tYW5vdGhlci1jb21wb25lbnQ/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: 86561
- Thank you received: 14307
-
-

15 years 7 months ago [\#13801](#13801) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Add order or cart from another component](/forum/4-how-to/13749-add-order-or-cart-from-another-component#13801 "Hello,  I have to create orders or carts from backend for other users. I think there is no way to do this from HikaShop backend, so I think I will make my own component to create orders or carts. Is there a way to do this properly by helper inclusion or some other stuff? Or maybe I have to insert it directly into the database.  Thanks.  Jiwoks")*

The session_id is the id of the session of the user. When users are not logged in on the website, the cart of the user is attached to his session id. When the user logs in, the session id field is emptied and the cart_user_id field is set with the id of the user. In your case, you could set the cart_user_id directly and ignore the session id field.

The cart_modified and cart_product_modified fields contain the timestamp of the modification date. In the config, you can define a cart retaining period after which the carts are deleted automatically.

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

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

Less More

- Posts: 18
- Thank you received: 0
-
-

15 years 7 months ago [\#13816](#13816) by [Jiwoks](/forum/user/2023-jiwoks "View Jiwoks's Profile")  Replied by *[Jiwoks](/forum/user/2023-jiwoks "View Jiwoks's Profile")* on topic *[Re: Add order or cart from another component](/forum/4-how-to/13749-add-order-or-cart-from-another-component#13816 "Hello,  I have to create orders or carts from backend for other users. I think there is no way to do this from HikaShop backend, so I think I will make my own component to create orders or carts. Is there a way to do this properly by helper inclusion or some other stuff? Or maybe I have to insert it directly into the database.  Thanks.  Jiwoks")*

Thank you very much for your really good quality and so quick support.

It's my first use of HikaShop but I think not the last.

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

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