Beispiel #1
0
 /**
  * Removing all quote items for specified product
  *
  * @param int $productId
  * @return void
  */
 public function dropAllQuoteChildItems($productId)
 {
     $select = $this->quoteResource->getReadConnection()->select();
     $adapter = $select->getAdapter();
     $quoteItemIds = $adapter->fetchCol($select->from($this->getTable('quote_item'), ['item_id'])->where('product_id = :product_id'), ['product_id' => $productId]);
     if ($quoteItemIds) {
         $adapter->delete($this->getTable('quote_item'), ['parent_item_id IN(?)' => $quoteItemIds]);
     }
 }