This repository was archived by the owner on Jan 23, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +32
-0
lines changed
Expand file tree Collapse file tree 3 files changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -179,6 +179,13 @@ Add/update the specified cart item.
179179$magento->api('guestCarts')->addItem($cartId, $sku, $quantity);
180180```
181181
182+ ` /V1/guest-carts/{cartId}/estimate-shipping-methods `
183+
184+ Estimate shipping by address and return list of available shipping methods.
185+ ``` php
186+ $magento->api('guestCarts')->estimateShippingMethods($cartId);
187+ ```
188+
182189<a id =" product-attributes " ></a >
183190### Product Attributes (catalogProductAttributeRepositoryV1)
184191
Original file line number Diff line number Diff line change @@ -62,4 +62,16 @@ public function totals($cartId)
6262 {
6363 return $ this ->get ('/guest-carts/ ' .$ cartId .'/totals ' );
6464 }
65+
66+ /**
67+ * Estimate shipping by address and return list of available shipping methods.
68+ *
69+ * @param string $cartId
70+ * @param array $body
71+ * @return array
72+ */
73+ public function estimateShippingMethods ($ cartId , $ body = [])
74+ {
75+ return $ this ->post ('/guest-carts/ ' .$ cartId .'/estimate-shipping-methods ' , $ body );
76+ }
6577}
Original file line number Diff line number Diff line change @@ -69,4 +69,17 @@ public function test_can_call_guest_carts_totals()
6969
7070 $ this ->assertTrue ($ api ->ok ());
7171 }
72+
73+ public function test_can_call_guest_carts_estimate_shipping_methods ()
74+ {
75+ Http::fake ([
76+ '*rest/all/V1/guest-carts/foo/estimate-shipping-methods ' => Http::response ([], 200 ),
77+ ]);
78+
79+ $ magento = new Magento ();
80+
81+ $ api = $ magento ->api ('guestCarts ' )->estimateShippingMethods ('foo ' );
82+
83+ $ this ->assertTrue ($ api ->ok ());
84+ }
7285}
You can’t perform that action at this time.
0 commit comments