Skip to content

Commit

Permalink
Merge pull request #85 from riha112/3391
Browse files Browse the repository at this point in the history
#3391 Added cart id to OrderData
  • Loading branch information
carinadues authored Sep 27, 2021
2 parents e3bb20a + 0dedb52 commit 81aa6c8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/Model/Resolver/GetCartForCustomer.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
use \Magento\Quote\Api\Data\AddressInterface;
use Magento\Downloadable\Model\LinkRepository;
use Magento\Downloadable\Model\Link;
use Magento\Quote\Model\QuoteIdToMaskedQuoteIdInterface;

class GetCartForCustomer extends CartResolver
{
Expand Down Expand Up @@ -64,6 +65,9 @@ class GetCartForCustomer extends CartResolver
/** @var LinkRepository */
protected $linkRepository;

/** @var QuoteIdToMaskedQuoteIdInterface */
protected $quoteIdToMaskedQuoteId;

/** @var IsInStorePickupDeliveryAvailableForCartInterface */
protected $inStorePickupDeliveryAvailableForCart;

Expand All @@ -77,7 +81,9 @@ class GetCartForCustomer extends CartResolver
* @param DataPostProcessor $productPostProcessor
* @param CustomizableOption $customizableOption
* @param BundleOptionDataProvider $bundleOptions
* @param Json $serializer
* @param LinkRepository $linkRepository
* @param QuoteIdToMaskedQuoteIdInterface $quoteIdToMaskedQuoteId
* @param IsInStorePickupDeliveryAvailableForCartInterface $inStorePickupDeliveryAvailableForCart
*/
public function __construct(
Expand All @@ -91,6 +97,7 @@ public function __construct(
BundleOptionDataProvider $bundleOptions,
Json $serializer,
LinkRepository $linkRepository,
QuoteIdToMaskedQuoteIdInterface $quoteIdToMaskedQuoteId,
IsInStorePickupDeliveryAvailableForCartInterface $inStorePickupDeliveryAvailableForCart
) {
parent::__construct(
Expand All @@ -106,6 +113,7 @@ public function __construct(
$this->bundleOptions = $bundleOptions;
$this->serializer = $serializer;
$this->linkRepository = $linkRepository;
$this->quoteIdToMaskedQuoteId = $quoteIdToMaskedQuoteId;
$this->inStorePickupDeliveryAvailableForCart = $inStorePickupDeliveryAvailableForCart;
}

Expand Down Expand Up @@ -256,11 +264,13 @@ public function resolve(
$shipping_amount = $address->getShippingAmount();
$shipping_incl_tax = $address->getShippingInclTax();
$shipping_method = $address->getShippingMethod();
$masked_id = $this->quoteIdToMaskedQuoteId->execute(intval($cart->getId()));
$isInStorePickupAvailable = $this->inStorePickupDeliveryAvailableForCart->execute((int) $cart->getId());

return array_merge(
$cartData,
[
'id' => $masked_id,
'items' => $itemsData,
'tax_amount' => $tax_amount,
'subtotal_incl_tax' => $subtotal_incl_tax,
Expand Down
1 change: 1 addition & 0 deletions src/etc/schema.graphqls
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ type Braintree {
}

type QuoteData implements TotalsObject {
id: String
is_virtual: Boolean
applied_taxes: [AppliedTaxItem]
}
Expand Down

0 comments on commit 81aa6c8

Please sign in to comment.