• Модуль: sale
  • Путь к файлу: ~/bitrix/modules/sale/lib/discount/gift/manager.php
  • Класс: BitrixSaleDiscountGiftManager
  • Вызов: Manager::getBasketCopy
private function getBasketCopy(Basket $basket)
{
	if(!$this->basketCloneCache->contains($basket))
	{
		$this->basketCloneCache[$basket] = $basket->copy();
	}

	if($this->basketAddedProduct->contains($this->basketCloneCache[$basket]))
	{
		foreach($this->basketAddedProduct[$this->basketCloneCache[$basket]] as $product)
		{
			$this->deleteProductFromBasket($this->basketCloneCache[$basket], $product);
		}
		$this->basketAddedProduct->detach($this->basketCloneCache[$basket]);
	}

	return $this->basketCloneCache[$basket];
}