Skip to content

Commit

Permalink
logs
Browse files Browse the repository at this point in the history
  • Loading branch information
AlbinaBaraliu committed Dec 23, 2024
1 parent 15c492e commit cdd4fae
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 21 deletions.
16 changes: 8 additions & 8 deletions Service/Applepay/Add.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,9 @@ public function process($request)
//}


$this->logger->addDebug('Cart Variable before: '. json_encode($cart->getAllItems()));
// $this->logger->addDebug('Cart Variable before: '. json_encode($cart->getAllItems()));
$cart->removeAllItems();
$this->logger->addDebug('Cart Variable after: '. json_encode($cart->getAllItems()));
// $this->logger->addDebug('Cart Variable after: '. json_encode($cart->getAllItems()));

try {
$productToBeAdded = $this->productRepository->getById(15);
Expand Down Expand Up @@ -215,13 +215,13 @@ public function process($request)
$this->logger->addDebug('Cart Variable (line 209): '. json_encode($cart));
$this->logger->addDebug('Cart shipping addressss: '. json_encode($cart->getShippingAddress()));
$this->logger->addDebug('Cart shipping address methodsss: '. json_encode($cart->getShippingAddress()->getGroupedAllShippingRates()));
// try {
// $shippingMethods = $this->appleShippingMethod->getAvailableMethods($cart);
// } catch (\Exception $e) {
// throw new \Exception(__('Unable to retrieve shipping methods.'));
// }
try {
$shippingMethods = $this->appleShippingMethod->getAvailableMethods($cart);
} catch (\Exception $e) {
throw new \Exception(__('Unable to retrieve shipping methods.'));
}

// $this->logger->addDebug('Shipping Methods Variable: '. json_encode($shippingMethods));
$this->logger->addDebug('Shipping Methods Variable: '. json_encode($shippingMethods));

$this->logger->addDebug('Cart Session: ' . json_encode($cart->getData()));

Expand Down
25 changes: 12 additions & 13 deletions Service/Applepay/ShippingMethod.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,19 +102,18 @@ public function getAvailableMethods($cart)
}
}


$testtt = $this->shipmentEstimation->estimateByExtendedAddress(
$cart->getId(),
$cart->getShippingAddress()
);

$aaa = $this->shipmentEstimation->getList($cart->getId());

$this->logger->addDebug('get list method: '. json_encode($aaa));

$this->logger->addDebug('testing shipment estimation::::: '. json_encode($testtt));

$this->logger->addDebug('Shipping methods retrieved successfully.');
// $testtt = $this->shipmentEstimation->estimateByExtendedAddress(
// $cart->getId(),
// $cart->getShippingAddress()
// );
//
// $aaa = $this->shipmentEstimation->getList($cart->getId());
//
// $this->logger->addDebug('get list method: '. json_encode($aaa));
//
// $this->logger->addDebug('testing shipment estimation::::: '. json_encode($testtt));
//
// $this->logger->addDebug('Shipping methods retrieved successfully.');

return $methods;
}
Expand Down

0 comments on commit cdd4fae

Please sign in to comment.