Billing and shipping address id

  • Posts: 278
  • Thank you received: 14
  • Hikashop Business
1 year 5 months ago #346865

-- HikaShop version -- : 4.4.5

We use massaction csv export for orders. In massaction export I get billing_address_user_id and shipping_address_user_id. Those should be diferent if customer enters diferent shipping address. But they are the same ids.

Please Log in or Create an account to join the conversation.

  • Posts: 81540
  • Thank you received: 13069
  • MODERATOR
1 year 5 months ago #346869

Hi,

No. These are the user_id attached to each address. And thus, it's normal they are always the same for one order since an order is linked to one user only.
If you want the id of the shipping / billing address, they are in billing_address_id and shipping_address_id, but you also have them in order_shipping_address_id and order_billing_address_id.

Please Log in or Create an account to join the conversation.

  • Posts: 278
  • Thank you received: 14
  • Hikashop Business
1 year 5 months ago #346907

OK, but billing_address_id and shipping_address_id are always diferent. I understand, its ID, but how we can know when billing address is diferent from shipping address?
We use csv file to import in accounting app.

Please Log in or Create an account to join the conversation.

  • Posts: 81540
  • Thank you received: 13069
  • MODERATOR
1 year 5 months ago #346910

It's normal they are different.
In HikaShop a user has two sets of addresses. One set with the type "billing" and one set with the type "shipping".
When the user check the checkbox "use the billing address as shipping address", the system will create a copy of the billing address with the type "shipping".
So you should actually never have a billing address and a shipping address with the same id.
In short, you can't base yourself on the id to know if they are the same or not. You'll have to compare each field of both address to see if they are the same or not.

Please Log in or Create an account to join the conversation.

  • Posts: 278
  • Thank you received: 14
  • Hikashop Business
1 year 4 months ago #346974

With your logic, our app cant check if adreess is the same or diferent, by ID? So we must compare every customer adress by ALL data to verify if it is diferent or the same?
And if there is returning customer, the problem is multiplying.

Please Log in or Create an account to join the conversation.

  • Posts: 81540
  • Thank you received: 13069
  • MODERATOR
1 year 4 months ago #346977

Well, you can check if the billing address is the same as the old billing address.
But even then, it would be possible the customer just create a new address with the same values.
If you really whant to check if an address is the same than another, I don't see another way than checking each field individually.

Please Log in or Create an account to join the conversation.

  • Posts: 278
  • Thank you received: 14
  • Hikashop Business
1 year 4 months ago #347083

Just for info. If using registration at checkout, is logic the same?
So returning users/customers have endless "diferent" addresses?

Please Log in or Create an account to join the conversation.

  • Posts: 81540
  • Thank you received: 13069
  • MODERATOR
1 year 4 months ago #347086

Hi,

If you register the billing address you enter will have one id, and its copy as shipping address will have another id. It will be the same ids in the order.
If you come back later on, and login and proceed to a payment without changing your billing/shipping addresses, they will have the same ids too.
However, if you modify an address, then the system will automatically unpublish the original address (so that it can still be attached to the old order you made in the past), and the modified address will have a new id.

If you do a guest checkout, then even if you use a the same addresses each time (you will have to re-enter them each time), the addresses will have different ids each time.

Please Log in or Create an account to join the conversation.

Time to create page: 0.065 seconds
Powered by Kunena Forum