From e1b4c2fa6eef43932d4a13d1689f77aca02ecf63 Mon Sep 17 00:00:00 2001 From: Alexander Campos Date: Wed, 3 Feb 2021 22:06:05 -0300 Subject: [PATCH] OnePageCheckout calculando em duplicidade no meio do checkout. #16 Add method for clear arrays of product and quantity --- .../Akhilleus/Model/Carrier/Akhilleus.php | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/app/code/community/LithiumSoftware/Akhilleus/Model/Carrier/Akhilleus.php b/app/code/community/LithiumSoftware/Akhilleus/Model/Carrier/Akhilleus.php index 7ed269c..437706e 100644 --- a/app/code/community/LithiumSoftware/Akhilleus/Model/Carrier/Akhilleus.php +++ b/app/code/community/LithiumSoftware/Akhilleus/Model/Carrier/Akhilleus.php @@ -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; @@ -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) {