<?php
/**
* ---------------------------------------------------------------------------------
*
* This file is part of the 'giftonordermodule' module feature (main || related module)
* Developped for Prestashop platform.
* You are not allowed to use it on several site
* You are not allowed to redistribute this module
* This header must not be removed
*
* @category  giftonordermodule
* @author    OleaCorner <contact@oleacorner.com> <www.oleacorner.com>
* @copyright OleaCorner
* @version   4.3
* @license   XXX
*         
* ---------------------------------------------------------------------------------
*/
class Cart extends CartCore
{
	/*
    * module: giftonordermodule
    * date: 2017-02-24 15:46:17
    * version: 5.0.7
    */
    public function getSummaryDetails($id_lang = null, $refresh = false)
	{
		$retour = parent::getSummaryDetails ($id_lang, $refresh);
		
		foreach ($retour['products'] as $k => $p)
		{
			if ($p['id_category_default'] == Configuration::get ('OLEA_GIFTONORDER_GIFT_CATEGORY'))
			{
				$p['gift'] = true;
				$retour['gift_products'][] = $p;
				unset ($retour['products'][$k]);
			}
		}
		
		return $retour;
	}
}