Skip to content
This repository has been archived by the owner on Jun 29, 2023. It is now read-only.

Commit

Permalink
Atualizado modulo PedroTeixeira_Correios: ajuste para erro: Máximo de…
Browse files Browse the repository at this point in the history
… 1 código de serviço por consulta. (pedro-teixeira/correios#447)
  • Loading branch information
eneiasramos committed Jun 17, 2021
1 parent e0873d2 commit 86d2d63
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,23 @@ protected function _getNominalWeight($request)
protected function _getQuotes()
{
$softErrors = explode(',', $this->getConfigData('soft_errors'));
/*
$correiosReturn = $this->_getCorreiosReturn();
*/
// Início: Isolamento das consultas de cálculo de frete, para lojas sem contrato.
$dataServices = array('<Servicos>');
foreach ($this->_postMethodsExplode as $method) {
$this->_postMethods = $method;
$returnTemp = $this->_getCorreiosReturn();
if (!empty($returnTemp) && $returnTemp instanceof SimpleXMLElement) {
$dataServices[] = $returnTemp->asXML();
}
}
$dataServices[] = '</Servicos>';
$this->_postMethods = implode(',', $this->_postMethodsExplode);
$xml = new SimpleXMLElement(implode('', $dataServices));
$correiosReturn = isset($xml->cServico) ? $xml->cServico : false;
// Fim: Isolamento das consultas de cálculo de frete, para lojas sem contrato.

if ($correiosReturn !== false) {
$errorList = array();
Expand Down
13 changes: 7 additions & 6 deletions app/code/community/PedroTeixeira/Correios/etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,11 @@
<active>1</active>
<model>PedroTeixeira_Correios_Model_Carrier_CorreiosMethod</model>
<title>Correios</title>
<postmethods>40010</postmethods>
<postmethods>04014,04510</postmethods>
<hard_errors>-3,-6,-10,-33,-888,7,99</hard_errors>
<soft_errors>009,010,011</soft_errors>
<show_soft_errors>0</show_soft_errors>
<prazo_entrega>0</prazo_entrega>
<show_soft_errors>1</show_soft_errors>
<prazo_entrega>1</prazo_entrega>
<check_dimensions>1</check_dimensions>
<min_order_value>0</min_order_value>
<max_order_value>10000</max_order_value>
Expand Down Expand Up @@ -691,10 +691,11 @@
</validate>

<!-- CONFIG -->
<free_method>40010</free_method>
<weight_type>kg</weight_type>
<free_method>04014</free_method>
<weight_type>gr</weight_type>
<add_prazo>0</add_prazo>
<showmethod>1</showmethod>
<unique_city_zip>1</unique_city_zip>
<filter_by_item>0</filter_by_item>
<split_pack>1</split_pack>

Expand Down Expand Up @@ -757,7 +758,7 @@
<zip>8</zip>
<size>0</size>
</cache_accuracy>
<cache_mode>0</cache_mode>
<cache_mode>1</cache_mode>

<!-- ADDITIONAL POST METHODS -->
<add_postmethods>
Expand Down

0 comments on commit 86d2d63

Please sign in to comment.