protected function _getCarrierList()
 {
     if (!$this->isOpcModuleActive()) {
         return parent::_getCarrierList();
     }
     $address_delivery = new Address($this->context->cart->id_address_delivery);
     $cms = new CMS(Configuration::get('PS_CONDITIONS_CMS_ID'), $this->context->language->id);
     $link_conditions = $this->context->link->getCMSLink($cms, $cms->link_rewrite, true);
     if (!strpos($link_conditions, '?')) {
         $link_conditions .= '?content_only=1';
     } else {
         $link_conditions .= '&content_only=1';
     }
     $free_shipping = false;
     foreach ($this->context->cart->getCartRules() as $rule) {
         if ($rule['free_shipping'] && !$rule['carrier_restriction']) {
             $free_shipping = true;
             break;
         }
     }
     $carriers = $this->context->cart->simulateCarriersOutput();
     $delivery_option = $this->context->cart->getDeliveryOption(null, false, false);
     $wrapping_fees_tax = new Tax((int) Configuration::get('PS_GIFT_WRAPPING_TAX'));
     if (version_compare(_PS_VERSION_, "1.5.2.0") <= 0) {
         $wrapping_fees = (double) Configuration::get('PS_GIFT_WRAPPING_PRICE');
         $wrapping_fees_tax_inc = $wrapping_fees * (1 + (double) $wrapping_fees_tax->rate / 100);
     } else {
         $wrapping_fees = $this->context->cart->getGiftWrappingPrice(false);
         $wrapping_fees_tax_inc = $wrapping_fees = $this->context->cart->getGiftWrappingPrice();
     }
     $oldMessage = Message::getMessageByCartId((int) $this->context->cart->id);
     $vars = array('free_shipping' => $free_shipping, 'checkedTOS' => (int) $this->context->cookie->checkedTOS, 'recyclablePackAllowed' => (int) Configuration::get('PS_RECYCLABLE_PACK'), 'giftAllowed' => (int) Configuration::get('PS_GIFT_WRAPPING'), 'cms_id' => (int) Configuration::get('PS_CONDITIONS_CMS_ID'), 'conditions' => (int) Configuration::get('PS_CONDITIONS'), 'link_conditions' => $link_conditions, 'recyclable' => (int) $this->context->cart->recyclable, 'gift_wrapping_price' => (double) Configuration::get('PS_GIFT_WRAPPING_PRICE'), 'total_wrapping_cost' => Tools::convertPrice($wrapping_fees_tax_inc, $this->context->currency), 'total_wrapping_tax_exc_cost' => Tools::convertPrice($wrapping_fees, $this->context->currency), 'delivery_option_list' => $this->context->cart->getDeliveryOptionList(), 'carriers' => $carriers, 'checked' => $this->context->cart->simulateCarrierSelectedOutput(), 'delivery_option' => $delivery_option, 'address_collection' => $this->context->cart->getAddressCollection(), 'opc' => true, 'oldMessage' => isset($oldMessage['message']) ? $oldMessage['message'] : '', 'HOOK_BEFORECARRIER' => Hook::exec('displayBeforeCarrier', array('carriers' => $carriers, 'delivery_option_list' => $this->context->cart->getDeliveryOptionList(), 'delivery_option' => $delivery_option)));
     Cart::addExtraCarriers($vars);
     $this->context->smarty->assign($vars);
     $order_carrier_tpl = $this->default_ps_carriers ? '/order-carrier-def.tpl' : '/order-carrier.tpl';
     if (!Address::isCountryActiveById((int) $this->context->cart->id_address_delivery) && $this->context->cart->id_address_delivery != 0) {
         $this->errors[] = Tools::displayError('This address is not in a valid area.');
     } elseif ((!Validate::isLoadedObject($address_delivery) || $address_delivery->deleted) && $this->context->cart->id_address_delivery != 0) {
         $this->errors[] = Tools::displayError('This address is invalid.');
     } else {
         $result = array('HOOK_BEFORECARRIER' => Hook::exec('displayBeforeCarrier', array('carriers' => $carriers, 'delivery_option_list' => $this->context->cart->getDeliveryOptionList(), 'delivery_option' => $this->context->cart->getDeliveryOption(null, true))), 'carrier_block' => $this->context->smarty->fetch($this->opc_templates_path . $order_carrier_tpl));
         Cart::addExtraCarriers($result);
         return $result;
     }
     if (count($this->errors)) {
         return array('hasError' => true, 'errors' => $this->errors, 'carrier_block' => $this->context->smarty->fetch($this->opc_templates_path . $order_carrier_tpl));
     }
 }