# Need some help on Checkout page

**URL:** <https://forum.shopware.com/t/need-some-help-on-checkout-page/97954>\
**Category:** Programming (EN)\
**Created:** [11. Januar 2023 um 13:55 UTC](https://forum.shopware.com/t/need-some-help-on-checkout-page/97954 "2023-01-11T13:55:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![miro](https://avatars.discourse-cdn.com/v4/letter/m/f08c70/32.png) [@miro](https://forum.shopware.com/u/miro)\
**Post date:** [11. Januar 2023 um 13:55 UTC](https://forum.shopware.com/t/need-some-help-on-checkout-page/97954/1 "2023-01-11T13:55:10Z")

</div>

Hi to all!  
I am trying to create a payment plugin for ShopWare 6 and I am stuck when try to get the Shipping and the Billing address.  
I know I am new in Shopware development, but few directions will be very helpful.  
So, I am on the Checkout page and have access to the Cart and Shopware\Core\Framework\Context. From the Cart I can see the delivery address calling:

```auto
$this->cart->getDeliveries()->getAddresses();

```

but from this result I can not get the address details.  
The second problem is I can not get the Billing address. Looks like it is not into the Cart. I tried to use the Customer object, but if the Customer has more than one address I always get the first one.

Thanks!

PS - OK from the delivery address I got the first one, then got the customer id and did what I guy suggested into StackOverflow:

```auto
$criteria = (new Criteria())
            ->addFilter(new EqualsFilter('id', $first_address->getCustomerId()))
            ->addAssociation('activeBillingAddress');
        
$customer_data = $this->customerRepository->search($criteria, $this->context);

```

but this is still not the active address. Into the admin my user has selected another address.

---

<div class="post-metadata">

**Author:** ![miro](https://avatars.discourse-cdn.com/v4/letter/m/f08c70/32.png) [@miro](https://forum.shopware.com/u/miro)\
**Post date:** [12. Januar 2023 um 07:14 UTC](https://forum.shopware.com/t/need-some-help-on-checkout-page/97954/2 "2023-01-12T07:14:33Z")

</div>

Looks like I will answer to myself.  
Into the Cart there is defaultShippingAddresId and defaultBillignAddressId, with them and the customerId I can get the correct addresses from address repository.  
I hope this will help someone else.

Regards!

---

<div class="post-metadata">

**Author:** ![abdullah](https://avatars.discourse-cdn.com/v4/letter/a/aeb1de/32.png) [@abdullah](https://forum.shopware.com/u/abdullah)\
**Post date:** [12. Januar 2023 um 10:39 UTC](https://forum.shopware.com/t/need-some-help-on-checkout-page/97954/3 "2023-01-12T10:39:29Z")

</div>

The SalesChannelContext has a customer entity. If a customer is logged in then you can access to `activeBillingAddress` or `activeShippingAddress`.
