/**
  * {@inheritdoc}
  */
 public function createFromCartProduct(CartProductInterface $cartProduct)
 {
     $orderProduct = new OrderProduct();
     $product = $cartProduct->getProduct();
     $attribute = $cartProduct->getAttribute();
     $orderProduct->setProductAttribute($attribute);
     $orderProduct->setProduct($product);
     $orderProduct->setSellPrice($cartProduct->getSellPrice());
     $orderProduct->setBuyPrice($product->getBuyPrice());
     $orderProduct->setQuantity($cartProduct->getQuantity());
     $orderProduct->setWeight($cartProduct->getWeight());
     return $orderProduct;
 }
 /**
  * @param CartProductInterface $cartProduct
  * @param OrderInterface       $order
  *
  * @return \WellCommerce\Bundle\OrderBundle\Entity\OrderProductInterface
  */
 public function prepareOrderProduct(CartProductInterface $cartProduct, OrderInterface $order)
 {
     $orderProduct = $this->orderProductFactory->create();
     $product = $cartProduct->getProduct();
     $attribute = $cartProduct->getAttribute();
     $sellPrice = $cartProduct->getSellPrice();
     $baseCurrency = $sellPrice->getCurrency();
     $targetCurrency = $order->getCurrency();
     $grossAmount = $this->getCurrencyHelper()->convert($sellPrice->getFinalGrossAmount(), $baseCurrency, $targetCurrency);
     $netAmount = $this->getCurrencyHelper()->convert($sellPrice->getFinalNetAmount(), $baseCurrency, $targetCurrency);
     $taxAmount = $this->getCurrencyHelper()->convert($sellPrice->getFinalTaxAmount(), $baseCurrency, $targetCurrency);
     $sellPrice = new Price();
     $sellPrice->setGrossAmount($grossAmount);
     $sellPrice->setNetAmount($netAmount);
     $sellPrice->setTaxAmount($taxAmount);
     $sellPrice->setTaxRate($sellPrice->getTaxRate());
     $sellPrice->setCurrency($targetCurrency);
     $orderProduct->setSellPrice($sellPrice);
     $orderProduct->setBuyPrice($product->getBuyPrice());
     $orderProduct->setQuantity($cartProduct->getQuantity());
     $orderProduct->setWeight($cartProduct->getWeight());
     $orderProduct->setProductAttribute($attribute);
     $orderProduct->setProduct($product);
     return $orderProduct;
 }