protected function RecalculateShipping()
    {
        $this->dCostShipping = 0;

        // validate shipping group - reset if not valid
        if (null !== $this->GetActiveShippingGroup()) {
            if (false === $this->SetActiveShippingGroup($this->GetActiveShippingGroup())) {
                $this->SetActiveShippingGroup(null);
            }
        }

        // if the basket contains a voucher that is set to free_shipping, then we keep costs to zero
        if (is_null($this->GetActiveVouchers()) || !$this->GetActiveVouchers()->HasFreeShippingVoucher()) {
            if (!is_null($this->GetActiveShippingGroup())) {
                $this->dCostShipping = $this->GetActiveShippingGroup()->GetShippingCostsForBasket();
            }
        }
    }