Example #1
0
 /**
  * @param \Extcode\Cart\Domain\Model\Cart\Product $newproduct
  *
  * @return void
  */
 private function addServiceAttributes($newproduct)
 {
     if ($this->maxServiceAttr1 > $newproduct->getServiceAttribute1()) {
         $this->maxServiceAttr1 = $newproduct->getServiceAttribute1();
     }
     if ($this->maxServiceAttr2 > $newproduct->getServiceAttribute2()) {
         $this->maxServiceAttr2 = $newproduct->getServiceAttribute2();
     }
     if ($this->maxServiceAttr3 > $newproduct->getServiceAttribute3()) {
         $this->maxServiceAttr3 = $newproduct->getServiceAttribute3();
     }
     $this->sumServiceAttr1 += $newproduct->getServiceAttribute1() * $newproduct->getQuantity();
     $this->sumServiceAttr2 += $newproduct->getServiceAttribute2() * $newproduct->getQuantity();
     $this->sumServiceAttr3 += $newproduct->getServiceAttribute3() * $newproduct->getQuantity();
 }