2

EE: 6.3.4

CartThrob: 6.3.0

I would like to get a user's current cart (the data that comes from the cart_items_info tag) using PHP.

I've been looking through the documentation and the database structure to find a way to do this, but I haven't had much luck.

Is there a PHP method or hook similar to the cart_items_info tag that I could use to get a users current cart items?

0

1 Answer 1

1

Take a look at:

ee()->cartthrob->cart->items()

It's an array of the user's cart.

Also, if you're curious about how any of the template tags work, they're stored at src/Tags

1
  • Thanks! That works!
    – Shayne
    Jun 10, 2022 at 19:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.