Controller/Front/AddressController.php
protected function copyShippingAddress(ParameterBag $parameters)
    {
        $billingAddress = $parameters->get('billingAddress');
        
        $shippingAddress = [
            'shippingAddress.copyBillingAddress' => true,
        ];
        
        foreach ($billingAddress as $key => $value) {
            list(, $fieldName) = explode('.', $key);
            $shippingAddress['shippingAddress.' . $fieldName] = $value;
        }
        
        $parameters->set('shippingAddress', $shippingAddress);
    }
protected function copyShippingAddress(ParameterBag $parameters)
    {
        $billingAddress = $parameters->get('billingAddress');
        
        $shippingAddress = [
            'shippingAddress.copyBillingAddress' => true,
        ];
        
        foreach ($billingAddress as $key => $value) {
            list(, $fieldName) = explode('.', $key);
            $shippingAddress['shippingAddress.' . $fieldName] = $value;
        }
        
        $parameters->set('shippingAddress', $shippingAddress);
    }
protected function copyShippingAddress ( ParameterBag $ parameters ) { $ billingAddress = $ parameters -> get ( 'billingAddress' ) ; $ shippingAddress = [ 'shippingAddress.copyBillingAddress' => true , ] ; foreach ( $ billingAddress as $ key => $ value ) { list ( , $ fieldName ) = explode ( '.' , $ key ) ; $ shippingAddress [ 'shippingAddress.' . $ fieldName ] = $ value ; } $ parameters -> set ( 'shippingAddress' , $ shippingAddress ) ; }
Copies billing address to shipping address

@param ParameterBag $parameters
Copies billing address to shipping address