Add order or cart from another component

  • Posts: 18
  • Thank you received: 0
13 years 7 months ago #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

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

  • Posts: 82864
  • Thank you received: 13372
  • MODERATOR
13 years 7 months ago #13754

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 or Create an account to join the conversation.

  • Posts: 18
  • Thank you received: 0
13 years 7 months ago #13789

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 or Create an account to join the conversation.

  • Posts: 82864
  • Thank you received: 13372
  • MODERATOR
13 years 7 months ago #13791

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 or Create an account to join the conversation.

  • Posts: 18
  • Thank you received: 0
13 years 7 months ago #13795

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 or Create an account to join the conversation.

  • Posts: 82864
  • Thank you received: 13372
  • MODERATOR
13 years 7 months ago #13801

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 or Create an account to join the conversation.

  • Posts: 18
  • Thank you received: 0
13 years 7 months ago #13816

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 or Create an account to join the conversation.

Time to create page: 0.064 seconds
Powered by Kunena Forum