Skip to content

Commit

Permalink
OnePageCheckout calculando em duplicidade no meio do checkout. Frenet…
Browse files Browse the repository at this point in the history
…GatewaydeFretes#16

Add method for clear arrays of product and quantity
  • Loading branch information
alexandercamps committed Feb 4, 2021
1 parent 0120dfc commit e1b4c2f
Showing 1 changed file with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,9 @@ class LithiumSoftware_Akhilleus_Model_Carrier_Akhilleus
* @return Mage_Shipping_Model_Rate_Result
*/
public function collectRates(Mage_Shipping_Model_Rate_Request $request){
$this->_init($request);

$this->_init($request);

$this->_getQuotes($request);

return $this->_result;
Expand Down Expand Up @@ -606,8 +607,23 @@ protected function _getTrackingFromWS($tracking)
}
}

/**
* Prior the products arrays to be used, clean them avoid duplicating problem
*
* @return void
*/
private function _clearArray() {
unset($this->_productsQty);
$this->_productsQty = array();

unset($this->_simpleProducts);
$this->_simpleProducts = array();
}

private function getSimpleProducts($items)
{
$this->_clearArray();

$j = 0;
foreach ($items as $child)
{
Expand Down

1 comment on commit e1b4c2f

@alexandercamps
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Olá @romereza , tudo bem?
poderia realizar testes na correção?

Obrigado

Please sign in to comment.