How get cart content ? (prestashop)

11,833

Solution 1

You should take a look at the Cart class, located in classes/Cart.php. There's a method called getProducts().

/**  
 * Return cart products  
 *  
 * @result array Products  
 */  
 public function getProducts($refresh = false, $id_product = false)  
 {  
   // code...  
 } 

Hope this helps,

Br,

Solution 2

Simply use

Context::getContext()->cart

refer this link https://www.prestashop.com/forums/topic/440516-how-to-get-all-product-ids-in-current-cart/

Share:
11,833
Zozo Zozo
Author by

Zozo Zozo

Updated on August 31, 2022

Comments

  • Zozo Zozo
    Zozo Zozo over 1 year

    I'd like get cart content on prestashop os-commerce. How can do it ?