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