public function testProductDoesNotMatchByQuantity()
 {
     $product1 = $this->dummyData->getProduct();
     $cartItem = $this->dummyData->getCartItem($product1, 1);
     $priceRule = new CartPriceRuleProductItem($product1, 2);
     $this->assertFalse($priceRule->matches($cartItem));
 }
 /**
  * @return static
  */
 public function withProduct()
 {
     $product = $this->entity->getProduct();
     if ($product !== null) {
         $this->entityDTO->product = $this->dtoBuilderFactory->getProductDTOBuilder($product)->build();
     }
     return $this;
 }
Exemple #3
0
 public function getCartPriceRuleProductItem(Product $product = null, $quantity = 1)
 {
     if ($product === null) {
         $product = $this->getProduct();
     }
     $productItem = new CartPriceRuleProductItem($product, $quantity);
     $productItem->setUpdated();
     return $productItem;
 }