setSellPrice() 공개 메소드

public setSellPrice ( WellCommerce\Bundle\AppBundle\Entity\PriceInterface $sellPrice )
$sellPrice WellCommerce\Bundle\AppBundle\Entity\PriceInterface
 public function create() : OrderProductInterface
 {
     $orderProduct = new OrderProduct();
     $orderProduct->setQuantity(1);
     $orderProduct->setWeight(0);
     $orderProduct->setBuyPrice(new Price());
     $orderProduct->setSellPrice(new DiscountablePrice());
     $orderProduct->setCreatedAt(new \DateTime());
     $orderProduct->setUpdatedAt(new \DateTime());
     $orderProduct->setOptions([]);
     return $orderProduct;
 }
예제 #2
0
 /**
  * {@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;
 }