Skip to content

Conversation

@imehedi357
Copy link

@imehedi357 imehedi357 commented Dec 12, 2025

After creating a new vendor from the WordPress admin panel (Admin → Dokan → Vendor → Add Vendor), clicking the "Add Vendor" button was redirecting users to the vendor edit page instead of the vendor list page.

This change updates the redirect behavior in the Create component to navigate to /vendors (vendor list page) instead of /vendors/edit/{id} (edit page) after successful vendor creation.

All Submissions:

  • My code follow the WordPress' coding standards
  • My code satisfies feature requirements
  • My code is tested
  • My code passes the PHPCS tests
  • My code has proper inline documentation
  • I've included related pull request(s) (optional)
  • I've included developer documentation (optional)
  • I've added proper labels to this pull request

Changes proposed in this Pull Request:

Fixed the redirect behavior after vendor creation. Previously, after successfully creating a new vendor, users were redirected to the vendor edit page (/vendors/edit/{id}). This has been changed to redirect to the vendor list page (/vendors) instead, allowing users to see all vendors including the newly created one.

Related Pull Request(s)

  • Full PR Link

Closes

How to test the changes in this Pull Request:

  1. Navigate to WordPress Admin → Dokan → Vendor → Add Vendor
  2. Fill in the vendor details (Store Name, Email, Username, Password, Bank IBAN, Address Information, etc.)
  3. Optionally check/uncheck "Send an email to vendor about account."
  4. Click the "Add Vendor" button
  5. Expected Result: After successful creation, you should be redirected to the Vendor List page. where you can see all vendors, including the newly created one.
  6. Previous Behavior: Previously, clicking "Add Vendor" would redirect to the vendor edit page for the newly created vendor.

Changelog entry

Fix: Redirect to vendor list page after creating new vendor

Fixed the redirect behavior after vendor creation. Previously, after successfully creating a new vendor from the admin panel, users were redirected to the vendor edit page. Now, users are redirected to the vendor list page where they can see all vendors.

Before Changes

After clicking "Add Vendor" button, users were redirected to the vendor edit page instead of the vendor list page.

After Changes

After clicking "Add Vendor" button, users are now redirected to the vendor list page.

Feature Video (optional)

Link of detailed video if this PR is for a feature.
https://www.loom.com/share/cc50ff8a52b74921b0073b4b665c69f4

PR Self Review Checklist:

  • Code is not following code style guidelines
  • Bad naming: make sure you would understand your code if you read it a few months from now.
  • KISS: Keep it simple, Sweetie (not stupid!).
  • DRY: Don't Repeat Yourself.
  • Code that is not readable: too many nested 'if's are a bad sign.
  • Performance issues
  • Complicated constructions that need refactoring or comments: code should almost always be self-explanatory.
  • Grammar errors.

FOR PR REVIEWER ONLY:

As a reviewer, your feedback should be focused on the idea, not the person. Seek to understand, be respectful, and focus on constructive dialog.

As a contributor, your responsibility is to learn from suggestions and iterate your pull request should it be needed based on feedback. Seek to collaborate and produce the best possible contribution to the greater whole.

  • Correct — Does the change do what it’s supposed to? ie: code 100% fulfilling the requirements?
  • Secure — Would a nefarious party find some way to exploit this change? ie: everything is sanitized/escaped appropriately for any SQL or XSS injection possibilities?
  • Readable — Will your future self be able to understand this change months down the road?
  • Elegant — Does the change fit aesthetically within the overall style and architecture?

Summary by CodeRabbit

  • Bug Fixes
    • Corrected the post-creation redirect for vendors to display the vendors list page instead of the newly created vendor's edit page.

✏️ Tip: You can customize this high-level summary in your review settings.

After creating a new vendor from the WordPress admin panel (Admin →
Dokan → Vendor → Add Vendor), clicking the "Add Vendor" button was
redirecting users to the vendor edit page instead of the vendor list
page.

This change updates the redirect behavior in the Create component to
navigate to `/vendors` (vendor list page) instead of `/vendors/edit/{id}`
(edit page) after successful vendor creation.
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 12, 2025

Walkthrough

This change modifies the redirect behavior in the vendor creation flow. After successfully creating a new vendor, users are now redirected to the vendors list page instead of the newly created vendor's edit page.

Changes

Cohort / File(s) Change Summary
Vendor Creation Navigation
src/admin/dashboard/pages/vendor-create-edit/Create.tsx
Modified post-creation redirect to navigate to the vendors list page instead of the vendor edit page. Creation logic, validation, and error handling remain unchanged.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Suggested labels

Dev Review Done, Needs: Testing

Suggested reviewers

  • mrabbani
  • kzamanbd

Poem

🐰 A vendor springs to life with ease,
No lingering on edit page, if you please!
To the list we hop, to greet them all,
Where vendors gather, standing tall! 🌟

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'fix: redirect to vendor list page after creating new vendor' clearly and concisely summarizes the main change in the PR.
Linked Issues check ✅ Passed The PR successfully implements the fix requested in issue #5254, changing the post-creation redirect from the vendor edit page to the vendor list page.
Out of Scope Changes check ✅ Passed The PR contains only the necessary change to fix the redirect behavior, with no unrelated modifications or scope creep detected.
Description check ✅ Passed The pull request description comprehensively follows the template with all major sections completed, including clear problem statement, changes proposed, testing instructions, changelog entry, before/after descriptions, and a feature video.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@imehedi357 imehedi357 added Type: Bug Needs: Testing This requires further testing labels Dec 12, 2025
@imehedi357 imehedi357 self-assigned this Dec 12, 2025
@MdAsifHossainNadim MdAsifHossainNadim added Needs: Dev Review It requires a developer review and approval and removed Type: Bug labels Dec 18, 2025
@Aunshon Aunshon added Dev Review Done and removed Needs: Dev Review It requires a developer review and approval labels Dec 22, 2025
@dev-shahed dev-shahed added 🎉 QA Approved This PR is approved by the QA team and removed Needs: Testing This requires further testing labels Dec 23, 2025
@shohag121 shohag121 added the Needs: Discussion Some decisions are needed for this task to be done label Dec 26, 2025
@shohag121
Copy link
Member

This Change needs discussion; it is disrupting the natural flow of record creation.

@mrabbani mrabbani added the DO NOT MERGE Don't merge this PR label Dec 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Dev Review Done DO NOT MERGE Don't merge this PR Needs: Discussion Some decisions are needed for this task to be done 🎉 QA Approved This PR is approved by the QA team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants