/**
  * @return static
  */
 public function withTag()
 {
     $tag = $this->entity->getTag();
     if ($tag !== null) {
         $this->entityDTO->tag = $this->dtoBuilderFactory->getTagDTOBuilder($tag)->build();
     }
     return $this;
 }
 public function testTagDoesNotMatchByQuantity()
 {
     $tag1 = $this->dummyData->getTag();
     $product1 = $this->dummyData->getProduct();
     $product1->addTag($tag1);
     $cartItem = $this->dummyData->getCartItem($product1, 1);
     $priceRule = new CartPriceRuleTagItem($tag1, 2);
     $this->assertFalse($priceRule->matches($cartItem));
 }
Ejemplo n.º 3
0
 public function getCartPriceRuleTagItem(Tag $tag = null, $quantity = 1)
 {
     if ($tag === null) {
         $tag = $this->getTag();
     }
     $tagItem = new CartPriceRuleTagItem($tag, $quantity);
     $tagItem->setUpdated();
     return $tagItem;
 }