Exemple #1
0
 /**
  * {@inheritdoc}
  */
 public function removeAdjustment(AdjustmentInterface $adjustment)
 {
     if (!$adjustment->isLocked() && $this->hasAdjustment($adjustment)) {
         $adjustment->setAdjustable(null);
         $this->adjustments->removeElement($adjustment);
     }
 }
Exemple #2
0
 /**
  * {@inheritdoc}
  */
 public function removeAdjustment(AdjustmentInterface $adjustment)
 {
     if ($this->hasAdjustment($adjustment)) {
         $adjustment->setAdjustable(null);
         $this->adjustments->removeElement($adjustment);
     }
     return $this;
 }
Exemple #3
0
 /**
  * {@inheritdoc}
  */
 public function removeAdjustment(AdjustmentInterface $adjustment)
 {
     if ($adjustment->isLocked() || !$this->hasAdjustment($adjustment)) {
         return;
     }
     $this->adjustments->removeElement($adjustment);
     $this->subtractFromAdjustmentsTotal($adjustment);
     $this->orderItem->recalculateUnitsTotal();
     $adjustment->setAdjustable(null);
 }
Exemple #4
0
 /**
  * {@inheritdoc}
  */
 public function removeAdjustments($type)
 {
     foreach ($this->getAdjustments($type) as $adjustment) {
         if ($adjustment->isLocked()) {
             continue;
         }
         $adjustment->setAdjustable(null);
         $this->adjustments->removeElement($adjustment);
     }
 }