Helper/Cart.php
private function transferData(
        $parent,
        $child,
        $save = true,
        $emailFields = ['customer_email', 'email'],
        $excludeFields = ['entity_id', 'address_id', 'reserved_order_id']
    ) {
        foreach ($parent->getData() as $key => $value) {

            if (in_array($key, $excludeFields)) continue;
            if (in_array($key, $emailFields) && !$this->validateEmail($value)) continue;

            $child->setData($key, $value);
        }
        if ($save) $child->save();
    }
private function transferData(
        $parent,
        $child,
        $save = true,
        $emailFields = ['customer_email', 'email'],
        $excludeFields = ['entity_id', 'address_id', 'reserved_order_id']
    ) {
        foreach ($parent->getData() as $key => $value) {

            if (in_array($key, $excludeFields)) continue;
            if (in_array($key, $emailFields) && !$this->validateEmail($value)) continue;

            $child->setData($key, $value);
        }
        if ($save) $child->save();
    }
private function transferData ( $ parent , $ child , $ save = true , $ emailFields = [ 'customer_email' , 'email' ] , $ excludeFields = [ 'entity_id' , 'address_id' , 'reserved_order_id' ] ) { foreach ( $ parent -> getData ( ) as $ key => $ value ) { if ( in_array ( $ key , $ excludeFields ) ) continue ; if ( in_array ( $ key , $ emailFields ) && ! $ this -> validateEmail ( $ value ) ) continue ; $ child -> setData ( $ key , $ value ) ; } if ( $ save ) $ child -> save ( ) ; }
Set immutable quote and addresses data from the parent quote

@param Quote|QuoteAddress $parent parent object
@param Quote|QuoteAddress $child  child object
@param bool $save                 if set to true save the $child instance upon the transfer
@param array $emailFields         fields that need to pass email validation to be transfered, skipped otherwise
@param array $excludeFields       fields to be excluded from the transfer (e.g. unique identifiers)
@throws \Zend_Validate_Exception
Set immutable quote and addresses data from the parent quote