Helper/Discount.php
public function deleteRedundantAmastyGiftCards($quote)
    {
        if (! $this->isAmastyGiftCardAvailable()) {
            return;
        }
        $connection = $this->resource->getConnection();
        try {
            $giftCardTable = $this->resource->getTableName('amasty_amgiftcard_quote');
            $quoteTable = $this->resource->getTableName('quote');

            $sql = "DELETE FROM {$giftCardTable} WHERE quote_id IN 
                    (SELECT entity_id FROM {$quoteTable} 
                    WHERE bolt_parent_quote_id = :bolt_parent_quote_id AND entity_id != :entity_id)";
            $bind = [
                'bolt_parent_quote_id' => $quote->getBoltParentQuoteId(),
                'entity_id' => $quote->getBoltParentQuoteId()
            ];

            $connection->query($sql, $bind);
        } catch (\Zend_Db_Statement_Exception $e) {
            $this->bugsnag->notifyException($e);
        }
    }
public function deleteRedundantAmastyGiftCards($quote)
    {
        if (! $this->isAmastyGiftCardAvailable()) {
            return;
        }
        $connection = $this->resource->getConnection();
        try {
            $giftCardTable = $this->resource->getTableName('amasty_amgiftcard_quote');
            $quoteTable = $this->resource->getTableName('quote');

            $sql = "DELETE FROM {$giftCardTable} WHERE quote_id IN 
                    (SELECT entity_id FROM {$quoteTable} 
                    WHERE bolt_parent_quote_id = :bolt_parent_quote_id AND entity_id != :entity_id)";
            $bind = [
                'bolt_parent_quote_id' => $quote->getBoltParentQuoteId(),
                'entity_id' => $quote->getBoltParentQuoteId()
            ];

            $connection->query($sql, $bind);
        } catch (\Zend_Db_Statement_Exception $e) {
            $this->bugsnag->notifyException($e);
        }
    }
public function deleteRedundantAmastyGiftCards ( $ quote ) { if ( ! $ this -> isAmastyGiftCardAvailable ( ) ) { return ; } $ connection = $ this -> resource -> getConnection ( ) ; try { $ giftCardTable = $ this -> resource -> getTableName ( 'amasty_amgiftcard_quote' ) ; $ quoteTable = $ this -> resource -> getTableName ( 'quote' ) ; $ sql = "DELETE FROM {$giftCardTable} WHERE quote_id IN 
                    (SELECT entity_id FROM {$quoteTable} 
                    WHERE bolt_parent_quote_id = :bolt_parent_quote_id AND entity_id != :entity_id)" ; $ bind = [ 'bolt_parent_quote_id' => $ quote -> getBoltParentQuoteId ( ) , 'entity_id' => $ quote -> getBoltParentQuoteId ( ) ] ; $ connection -> query ( $ sql , $ bind ) ; } catch ( \ Zend_Db_Statement_Exception $ e ) { $ this -> bugsnag -> notifyException ( $ e ) ; } }
Try to clear Amasty Gift Cart data for the unused immutable quotes

@param Quote $quote parent quote
Try to clear Amasty Gift Cart data for the unused immutable quotes