Skip to content

Commit

Permalink
feat : /dokan/v1/stores :POST args added
Browse files Browse the repository at this point in the history
  • Loading branch information
pronob1010 committed Nov 25, 2024
1 parent dcb6134 commit 15e49f4
Showing 1 changed file with 96 additions and 3 deletions.
99 changes: 96 additions & 3 deletions includes/REST/StoreController.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,99 @@ public function register_routes() {
'methods' => WP_REST_Server::CREATABLE,
'callback' => [ $this, 'create_store' ],
'permission_callback' => [ $this, 'permission_check_for_manageable_part' ],
'args' => [
'user_login' => [
'required' => false,
'type' => 'string',
'description' => __( 'The username for the store owner. If not provided, it will be auto-generated.', 'dokan-lite' ),
],
'email' => [
'required' => true,
'type' => 'string',
'format' => 'email',
'description' => __( 'The email address for the store owner.', 'dokan-lite' ),
],
'store_name' => [
'required' => true,
'type' => 'string',
'description' => __( 'The name of the store.', 'dokan-lite' ),
],
'social' => [
'required' => false,
'type' => 'array',
'description' => __( 'An array of social media details for the store.', 'dokan-lite' ),
],
'payment' => [
'required' => false,
'type' => 'array',
'description' => __( 'Payment details for the store. E.g., PayPal or bank details.', 'dokan-lite' ),
],
'phone' => [
'required' => false,
'type' => 'string',
'description' => __( 'The contact phone number for the store.', 'dokan-lite' ),
],
'show_email' => [
'required' => false,
'type' => 'string', // Updated from boolean
'description' => __( 'Whether to show the store email publicly.', 'dokan-lite' ),
],
'address' => [
'required' => false,
'type' => 'array',
'description' => __( 'Address details of the store.', 'dokan-lite' ),
],
'location' => [ // Newly added
'required' => false,
'type' => 'string',
'description' => __( 'Geographical location of the store.', 'dokan-lite' ),
],
'banner_id' => [
'required' => false,
'type' => 'integer',
'description' => __( 'ID of the banner image for the store.', 'dokan-lite' ),
],
'icon' => [
'required' => false,
'type' => 'string',
'description' => __( 'URL of the icon image for the store.', 'dokan-lite' ),
],
'gravatar_id' => [
'required' => false,
'type' => 'integer',
'description' => __( 'ID of the gravatar image for the store.', 'dokan-lite' ),
],
'enable_tnc' => [
'required' => false,
'type' => 'string', // Updated from boolean
'description' => __( 'Enable Terms and Conditions for the store.', 'dokan-lite' ),
],
'store_tnc' => [
'required' => false,
'type' => 'string',
'description' => __( 'Terms and Conditions text for the store.', 'dokan-lite' ),
],
'show_min_order_discount' => [
'required' => false,
'type' => 'string', // Updated from boolean
'description' => __( 'Whether to show minimum order discount information.', 'dokan-lite' ),
],
'store_seo' => [
'required' => false,
'type' => 'array',
'description' => __( 'SEO metadata for the store.', 'dokan-lite' ),
],
'store_open_close' => [
'required' => false,
'type' => 'array',
'description' => __( 'Opening and closing times for the store.', 'dokan-lite' ),
],
'notify_vendor' => [
'required' => false,
'type' => 'boolean',
'description' => __( 'Whether to notify the vendor after creation.', 'dokan-lite' ),
],
],
],
]
);
Expand Down Expand Up @@ -135,17 +228,17 @@ public function register_routes() {
'store_slug' => [
'required' => false,
'type' => 'string',
'description' => __('Slug of the store to check availability.', 'dokan-lite'),
'description' => __( 'Slug of the store to check availability.', 'dokan-lite' ),
],
'username' => [
'required' => false,
'type' => 'string',
'description' => __('Username to check availability.', 'dokan-lite'),
'description' => __( 'Username to check availability.', 'dokan-lite' ),
],
'email' => [
'required' => false,
'type' => 'string',
'description' => __('Email address to check availability.', 'dokan-lite'),
'description' => __( 'Email address to check availability.', 'dokan-lite' ),
'format' => 'email',
],
],
Expand Down

0 comments on commit 15e49f4

Please sign in to comment.