How to work out which cart is the users?

  • Posts: 217
  • Thank you received: 1
13 years 3 weeks ago #28834

How can I quickly work out, with php, which cart is the users?

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

  • Posts: 82868
  • Thank you received: 13378
  • MODERATOR
13 years 3 weeks ago #28870

I'm not sure I understand what you want to do. Could you explain more ?

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

  • Posts: 217
  • Thank you received: 1
13 years 3 weeks ago #28923

I was also thinking that if I could work out the cart_id I could create the user myself and load their details into hika shop directly and then just use hika shop to display this information.

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

  • Posts: 82868
  • Thank you received: 13378
  • MODERATOR
13 years 3 weeks ago #28925

Once a cart has been created, it's easy to get the id of the cart of the current user.
You can do like that:
$app =& JFactory::getApplication();
$cart_id = $app->getUserStateFromRequest( 'com_hikashop.cart_id', 'cart_id', 0, 'int' );

Create yourself the cart and the infos of the user in the database is not easy though as it involves at least 7 tables.

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

Time to create page: 0.057 seconds
Powered by Kunena Forum