<?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
{

	public function getSummaryDetails($id_lang = null, $refresh = false)
	{
		$retour = parent::getSummaryDetails ($id_lang, $refresh);
		
		// Oleacorner for module OleaGiftOnOrder
		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]);
			}
		}
		// End Oleacorner
		
		return $retour;
	}
}