How to get the Dokan Vendor's Warehouse Address from a WooCommerce Order?
The Long Version:
I'm working on a WordPress/WooCommerce plugin for Automated shipment booking for which I need the Pickup Address, the catch is that, it's a Multi-vendor WooCommerce setup using Dokan plugin, so I just wanted to understand the way to get the Vendor's warehouse address against the WooCommerce Order.
I've tried the WooCommerce Documentation to see if they have any seller
related helpers, I've checked various built-in classes provided by WooCommerce to see if there is any way to fetch the seller details.
I've tried searching for Dokan Documentation, but they don't have any concrete documentation to help me here.
With Dokan plugin, There is not really a vendor Warehouse Address.
You can get the vendor details from a defined WC_Order object
$order
via order items:The only case where the vendor can define a Warehouse Address is when enabling Cash on delivery shipping option, where a Warehouse Address can be optionally defined in the "description" field. See it here in the documentation.
This Warehouse Address should be stored in the database in Dokan proprietary tables, as in WooCommerce, there is NO description field in Cash on delivery shipping option.
This Warehouse Address could be available (without any guaranty) in order "shipping" items, from a defined WC_Order object
$order
:I hope it will help.
Related: