$shippingLocation =
$base->
getShippingLocation();
if ($customer) { /** @var CustomerAddressEntity $activeShippingAddress */
$activeShippingAddress =
$customer->
getActiveShippingAddress();
$shippingLocation = ShippingLocation::
createFromAddress($activeShippingAddress);
} $customerGroup =
$base->
getCurrentCustomerGroup();
if ($customer) { $criteria =
new Criteria([$customer->
getGroupId()]);
$criteria->
setTitle('context-factory::customer-group'
);
/** @var CustomerGroupEntity $customerGroup */
$customerGroup =
$this->customerGroupRepository->
search($criteria,
$base->
getContext())->
first() ??
$customerGroup;
} // loads tax rules based on active customer and delivery address
$taxRules =
$this->
getTaxRules($base,
$customer,
$shippingLocation);
// detect active payment method, first check if checkout defined other payment method, otherwise validate if customer logged in, at least use shop default
$payment =
$this->
getPaymentMethod($options,
$base,
$customer);
[