12345678910111213141516171819202122232425262728293031323334 |
- <?php
- /**
- * Copyright © Magento, Inc. All rights reserved.
- * See COPYING.txt for license details.
- */
- namespace Magento\Braintree\Model\Paypal\Helper;
- use Magento\Quote\Model\Quote;
- /**
- * Abstract class AbstractHelper
- */
- abstract class AbstractHelper
- {
- /**
- * Make sure addresses will be saved without validation errors
- *
- * @param Quote $quote
- * @return void
- */
- protected function disabledQuoteAddressValidation(Quote $quote)
- {
- $billingAddress = $quote->getBillingAddress();
- $billingAddress->setShouldIgnoreValidation(true);
- if (!$quote->getIsVirtual()) {
- $shippingAddress = $quote->getShippingAddress();
- $shippingAddress->setShouldIgnoreValidation(true);
- if (!$billingAddress->getEmail()) {
- $billingAddress->setSameAsBilling(1);
- }
- }
- }
- }
|