Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement/commission restructure #2027

Open
wants to merge 89 commits into
base: develop
Choose a base branch
from

Conversation

Aunshon
Copy link
Contributor

@Aunshon Aunshon commented Oct 2, 2023

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 developer documentation (optional)
  • I've added proper labels to this pull request

Changes proposed in this Pull Request:

Related PR

Resources

Videos

How to test the changes in this Pull Request:

  1. Vendor single edit page moved to dokan liite
  2. dokan subscription product commission setting style.
  3. Test all commission works properly.
  4. Test the dokan subscription product save and purchase works properly and that vendors commission is updated as the subscription product.
  5. Test if the setting is not updated and upgrader has not run the flat or percentage or combine works as expected.
  6. Test if the upgrader works properly
  7. Test the earning suggestion shows properly in product add and edit page in simple, variable, subscription and variable subscription product.
  8. Test the earning shows properly in vendor dashboard products list.
  9. Test the commission shows properly in admin dashboard product list.
  10. Test commission data shows properly in order details page in commission metabox.
  11. Test related orders shows propery in order details page related orders metabox.
  12. Refund and after refund the commission and earning is currect.
  13. Apply marketplace coupon and check if the commission and earning is currect. please check all setting for deduct discount from.
  14. Check the ui of the commissions settings in product, vendor , global, dookan subscripton product, setup wizard.
  15. Apply old commissions switch to enhancement/commission-restructore branch check all commissions refund it and check commissions.
  16. Check if any commission or earning or amount changes after switching this branch.
  17. New commission api dokan/v1/commission

Changelog entry

- **new:** Commission amount now displayed in the product list within the admin dashboard.
- **new:** Vendor earning amount displayed in the product list within the vendor dashboard.
- **new:** Vendor earning suggestions on the product add and edit pages in the vendor dashboard for simple and variable products.
- **new:** Commission details metabox on the order details page in the admin dashboard, visible for child orders or orders without a parent.
- **new:** Related order metabox on the order details page in the admin dashboard, displaying sibling orders for child orders and child orders for parent orders.
- **new:** Backward compatibility for flat, percentage, and combine commission types for older orders.
- **update:** Updated commission types from flat, percentage, and combine to fixed and category-based commissions.
- **update:** Overhauled the commission UI across Dokan global settings, vendor settings, product settings, Dokan subscription product settings, and the admin setup wizard.
- **update:** Updated the commission settings in the admin setup wizard.
- **update:** Enhanced responsiveness of the UI for Dokan admin dashboard settings menus.
- **fix:** Moved the vendor edit page from Dokan Pro to Dokan Lite and eliminated the commission setting from the WordPress default user profile page.
- **fix:** Removed the commission from every category, introducing category-based commission in global settings, vendor settings, Dokan subscription products, and the admin setup wizard.

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?

@Aunshon Aunshon added the In Progress The issues is being worked on label Oct 2, 2023
@Aunshon Aunshon self-assigned this Oct 2, 2023
…sion-restructore

# Conflicts:
#	package-lock.json
#	src/admin/components/Fields.vue
@shashwatahalder01 shashwatahalder01 changed the title Enhancement/commission restructore Enhancement/commission restructure May 3, 2024
includes/Commission.php Show resolved Hide resolved
includes/Commission.php Outdated Show resolved Hide resolved
includes/Commission.php Outdated Show resolved Hide resolved
templates/admin-setup-wizard/step-commission.php Outdated Show resolved Hide resolved
templates/orders/commission-meta-box-html.php Outdated Show resolved Hide resolved
templates/orders/commission-meta-box-html.php Outdated Show resolved Hide resolved
templates/orders/sub-order-related-order-meta-box-html.php Outdated Show resolved Hide resolved
templates/orders/sub-order-related-order-meta-box-html.php Outdated Show resolved Hide resolved
@shohag121 shohag121 added Needs: Author Reply and removed Needs: Dev Review It requires a developer review and approval labels May 6, 2024
@Aunshon Aunshon added Needs: Dev Review It requires a developer review and approval and removed Needs: Author Reply labels May 13, 2024
includes/Commission.php Outdated Show resolved Hide resolved
includes/Commission.php Outdated Show resolved Hide resolved
includes/Commission/Calculator.php Show resolved Hide resolved
includes/Commission/FormulaFactory.php Outdated Show resolved Hide resolved
includes/Commission/Model/Commission.php Outdated Show resolved Hide resolved
src/admin/pages/Settings.vue Outdated Show resolved Hide resolved
templates/orders/commission-meta-box-html.php Show resolved Hide resolved
templates/orders/commission-meta-box-html.php Show resolved Hide resolved
templates/orders/commission-meta-box-html.php Show resolved Hide resolved
@shohag121 shohag121 added 👍 Dev Review Done and removed Needs: Dev Review It requires a developer review and approval labels May 15, 2024
@shashwatahalder01 shashwatahalder01 added QA In Progress and removed Needs: Testing This requires further testing labels May 27, 2024
Copy link

coderabbitai bot commented May 28, 2024

Important

Review Skipped

More than 25% of the files skipped due to max files limit. The review is being skipped to prevent a low-quality review.

46 files out of 105 files are above the max files limit of 50. Please upgrade to Pro plan to get higher limits.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to full the review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Withdraw, provide the details on how the final amount was determined
4 participants