PrestaCraft on Facebook

Please like our page on Facebook to get notifications about new tutorials :)


PrestaCraft

PrestaCraft on Facebook

Please like our page on Facebook to get notifications about new tutorials :)


PrestaCraft

Recently I’ve struggled with creating customer cart programatically. I’ve found that PrestaShop has already such code in CartController.php. So whenever you need to create cart in your module (in front controller, hook etc.) you can use this little snippet:

The cart is going to be created if it doesn’t exist. If you’d like to add some product(s), you can to it like this:

And that’s all. Thanks!

Leave a comment

Your email address will not be published.

Be the first to post a comment!

Leave a comment

Your email address will not be published.