Commercial lead prices #33

Merged
akrdzic merged 11 commits from commercial-lead-prices into master 2018-10-17 11:29:55 +02:00
akrdzic commented 2018-10-11 07:39:46 +02:00 (Migrated from gitlab.com)

Implement support for commercial leads to set extra prices on package

NOTE: This PR must wait on https://gitlab.com/saburly/wiaas/new-wiaas/merge_requests/32 to be merged

Also note: Since logic for this is not fully completed there are few places with that will be changed during implementation
of linking customers to commercial leads and commercial leads catalogue. For now it is very simplified where every
customer belongs to every commercial lead and there is only default catalogue for commercial leads.

Execute composer install and composer update-db

Smoke test:

  1. Login to backend interface as admin

  2. Create new package bundle (set country and prices)

  3. Create new organization and give it role of Commercial Lead

  4. Create new user and assign him to new organization

  5. Login on frontend as customer (different organization than commercial lead)

  6. Validate that new commercial lead is visible in commercial lead dropdowns

  7. Validate that new package is not visible in coMarket

  8. Login as new commercial lead to backend

  9. Go to Products tab

  10. Find newly created package and click on it

  11. Validate that page for setting extra prices is loaded and displayed default price values are the same
    that are set with administrator.

  12. Validate that customers tab is disabled

  13. Set extra prices and Save changes

  14. Validate that after refresh prices displayed are correct and that customers tab is enabled

  15. Go to frontend

  16. Select newly created commercial lead

  17. Validate that package is retrieved

  18. Open package and validate that prices are the same as calculated final customer prices
    on page where commercial lead edited extra prices

  19. Go back to commercial lead backend and open extra prices editor for package

  20. Go to Customers tab

  21. Find customer organization in dropdown and add new prices for him

  22. Save changes

  23. Validate changes are correctly saved after refresh

  24. Go back to frontend intergace

  25. Validate that package displays new prices (those that are specific only for his organization)

  26. Order page

  27. Check that prices in cart are prices specific for customer organization

  28. Complete checkout process for package and create order

  29. Validate that order prices are prices specific for customer organization

**Implement support for commercial leads to set extra prices on package** **NOTE**: This PR must wait on https://gitlab.com/saburly/wiaas/new-wiaas/merge_requests/32 to be merged Also note: Since logic for this is not fully completed there are few places with that will be changed during implementation of linking customers to commercial leads and commercial leads catalogue. For now it is very simplified where every customer belongs to every commercial lead and there is only default catalogue for commercial leads. Execute `composer install` and `composer update-db` Smoke test: 1. Login to backend interface as admin 2. Create new package bundle (set country and prices) 3. Create new organization and give it role of Commercial Lead 4. Create new user and assign him to new organization 5. Login on frontend as customer (different organization than commercial lead) 6. Validate that new commercial lead is visible in commercial lead dropdowns 7. Validate that new package is not visible in coMarket 8. Login as new commercial lead to backend 9. Go to `Products` tab 10. Find newly created package and click on it 11. Validate that page for setting extra prices is loaded and displayed default price values are the same that are set with administrator. 12. Validate that customers tab is disabled 13. Set extra prices and Save changes 14. Validate that after refresh prices displayed are correct and that customers tab is enabled 15. Go to frontend 16. Select newly created commercial lead 17. Validate that package is retrieved 18. Open package and validate that prices are the same as calculated final customer prices on page where commercial lead edited extra prices 19. Go back to commercial lead backend and open extra prices editor for package 20. Go to Customers tab 21. Find customer organization in dropdown and add new prices for him 22. Save changes 23. Validate changes are correctly saved after refresh 24. Go back to frontend intergace 25. Validate that package displays new prices (those that are specific only for his organization) 26. Order page 27. Check that prices in cart are prices specific for customer organization 28. Complete checkout process for package and create order 29. Validate that order prices are prices specific for customer organization
akrdzic commented 2018-10-11 07:45:16 +02:00 (Migrated from gitlab.com)

unmarked as a Work In Progress

unmarked as a **Work In Progress**
akrdzic commented 2018-10-11 07:45:16 +02:00 (Migrated from gitlab.com)

changed the description

changed the description
akrdzic commented 2018-10-11 07:52:18 +02:00 (Migrated from gitlab.com)

added 1 commit

  • a830a47d - retrieve all commercial leads on request

Compare with previous version

added 1 commit <ul><li>a830a47d - retrieve all commercial leads on request</li></ul> [Compare with previous version](https://gitlab.com/saburly/wiaas/new-wiaas/merge_requests/33/diffs?diff_id=24884337&start_sha=61109e9bf0fa0844e32f5cb2a51c88b7d01800af)
akrdzic commented 2018-10-11 07:54:29 +02:00 (Migrated from gitlab.com)

changed the description

changed the description
akrdzic commented 2018-10-11 13:20:10 +02:00 (Migrated from gitlab.com)

assigned to @nedimu

assigned to @nedimu
akrdzic commented 2018-10-15 05:07:01 +02:00 (Migrated from gitlab.com)

added 28 commits

  • a830a47d...8789eb14 - 26 commits from branch master
  • e810dd08 - Merge branch 'master' into commercial-lead-prices
  • f14d35b1 - Fix tests

Compare with previous version

added 28 commits <ul><li>a830a47d...8789eb14 - 26 commits from branch <code>master</code></li><li>e810dd08 - Merge branch &#39;master&#39; into commercial-lead-prices</li><li>f14d35b1 - Fix tests</li></ul> [Compare with previous version](https://gitlab.com/saburly/wiaas/new-wiaas/merge_requests/33/diffs?diff_id=25083140&start_sha=a830a47d3118d9bc41678301debb0ef0249e1986)
akrdzic commented 2018-10-15 15:00:07 +02:00 (Migrated from gitlab.com)

added 1 commit

  • b7ac53d1 - use only customer specific prices if set

Compare with previous version

added 1 commit <ul><li>b7ac53d1 - use only customer specific prices if set</li></ul> [Compare with previous version](https://gitlab.com/saburly/wiaas/new-wiaas/merge_requests/33/diffs?diff_id=25141778&start_sha=f14d35b1aa39785f0c32f2c6d00a30a0df5c4851)
akrdzic commented 2018-10-15 16:36:44 +02:00 (Migrated from gitlab.com)

changed the description

changed the description
akrdzic commented 2018-10-15 17:21:38 +02:00 (Migrated from gitlab.com)

added 1 commit

  • d7103df6 - add view admin dashboard to cl

Compare with previous version

added 1 commit <ul><li>d7103df6 - add view admin dashboard to cl</li></ul> [Compare with previous version](https://gitlab.com/saburly/wiaas/new-wiaas/merge_requests/33/diffs?diff_id=25153243&start_sha=b7ac53d195142cceabb253ec28700789ead59653)
akrdzic commented 2018-10-15 17:23:04 +02:00 (Migrated from gitlab.com)

added 1 commit

  • 2d7b6c55 - add view admin dashboard to cl

Compare with previous version

added 1 commit <ul><li>2d7b6c55 - add view admin dashboard to cl</li></ul> [Compare with previous version](https://gitlab.com/saburly/wiaas/new-wiaas/merge_requests/33/diffs?diff_id=25153346&start_sha=d7103df6dc37bae8cbfe0762689cc28b9743c12a)
akrdzic commented 2018-10-15 18:08:19 +02:00 (Migrated from gitlab.com)

added 1 commit

Compare with previous version

added 1 commit <ul><li>dc1a1c64 - Add default roles</li></ul> [Compare with previous version](https://gitlab.com/saburly/wiaas/new-wiaas/merge_requests/33/diffs?diff_id=25167255&start_sha=2d7b6c55e6d0cd35945fcbcb0728ef59e98c6df4)
akrdzic commented 2018-10-16 06:50:14 +02:00 (Migrated from gitlab.com)

added 1 commit

  • 554dc37a - updated timestamp of role related db updates so they get triggered again

Compare with previous version

added 1 commit <ul><li>554dc37a - updated timestamp of role related db updates so they get triggered again</li></ul> [Compare with previous version](https://gitlab.com/saburly/wiaas/new-wiaas/merge_requests/33/diffs?diff_id=25196276&start_sha=dc1a1c64d298014859ce776c16995684b6a4cfaa)
nedimu commented 2018-10-16 11:34:11 +02:00 (Migrated from gitlab.com)

This class's access is marked as private. That means it is not intended for use by plugin and theme developers as it is subject to change without warning in any future WordPress release. If you would still like to make use of the class, you should make a copy to use and distribute with your own project, or else use it at your own risk.

https://codex.wordpress.org/Class_Reference/WP_List_Table

Just a warning, it is up to you to decide should this stay this way

This class's access is marked as private. That means it is not intended for use by plugin and theme developers as it is subject to change without warning in any future WordPress release. If you would still like to make use of the class, you should make a copy to use and distribute with your own project, or else use it at your own risk. https://codex.wordpress.org/Class_Reference/WP_List_Table Just a warning, it is up to you to decide should this stay this way
nedimu commented 2018-10-16 11:36:09 +02:00 (Migrated from gitlab.com)

What is this function for ? If it is reaaly supposed to return empmty array, than a propriet comment would be good

What is this function for ? If it is reaaly supposed to return empmty array, than a propriet comment would be good
nedimu commented 2018-10-16 11:45:01 +02:00 (Migrated from gitlab.com)

Please put javascript code in seperate javascript file in assets dir (you can use same project structure fot this folder as we are using in wiaas plugin For example this file coud be in /assets/js/admin/admin-cl/. We want our JS code in one place, so it is more managable.

Please put javascript code in seperate javascript file in assets dir (you can use same project structure fot this folder as we are using in wiaas plugin For example this file coud be in /assets/js/admin/admin-cl/. We want our JS code in one place, so it is more managable.
nedimu commented 2018-10-16 12:03:15 +02:00 (Migrated from gitlab.com)

Just interested, any reason why interest rate is hardcoded to 0.58 ??

Just interested, any reason why interest rate is hardcoded to 0.58 ??
akrdzic commented 2018-10-16 12:23:20 +02:00 (Migrated from gitlab.com)

In logic for calculating price on legacy there is only one interest rate and it is of this value, so I set it as a constant since it does not changes anywhere. Maybe later this will be changed.

In logic for calculating price on legacy there is only one interest rate and it is of this value, so I set it as a constant since it does not changes anywhere. Maybe later this will be changed.
akrdzic commented 2018-10-16 16:58:03 +02:00 (Migrated from gitlab.com)

changed this line in version 10 of the diff

changed this line in [version 10 of the diff](https://gitlab.com/saburly/wiaas/new-wiaas/merge_requests/33/diffs?diff_id=25248107&start_sha=554dc37a2d92b8a1b31bcdd3ee75a238c4fac706#918909acf2e12f4a1635a0589c5eecde0c839463_11_0)
akrdzic commented 2018-10-16 16:58:03 +02:00 (Migrated from gitlab.com)

changed this line in version 10 of the diff

changed this line in [version 10 of the diff](https://gitlab.com/saburly/wiaas/new-wiaas/merge_requests/33/diffs?diff_id=25248107&start_sha=554dc37a2d92b8a1b31bcdd3ee75a238c4fac706#918909acf2e12f4a1635a0589c5eecde0c839463_83_0)
akrdzic commented 2018-10-16 16:58:05 +02:00 (Migrated from gitlab.com)

added 1 commit

  • ddf7d445 - Refactor admin cl interface and handle product access with groups

Compare with previous version

added 1 commit <ul><li>ddf7d445 - Refactor admin cl interface and handle product access with groups</li></ul> [Compare with previous version](https://gitlab.com/saburly/wiaas/new-wiaas/merge_requests/33/diffs?diff_id=25248107&start_sha=554dc37a2d92b8a1b31bcdd3ee75a238c4fac706)
akrdzic commented 2018-10-16 16:58:19 +02:00 (Migrated from gitlab.com)

It was supposed to override default actions for table.

It was supposed to override default actions for table.
akrdzic commented 2018-10-16 17:01:51 +02:00 (Migrated from gitlab.com)

I was aware of this fact when rendering them with help of this class, since it was really unlikely that they are going to change that class soon and if they do it could be copied as our own copy.
I did not want to implement different UI for product list for different roles so I used that class.

Since then I reviewed some hooks and filters in woocommerce and default wp hooks and figure out how to get the same display with them.

So I will remove this class and used default table which will be customized with hooks and filters.

Also because of it automatic access management for products based on role is also implemented.

I was aware of this fact when rendering them with help of this class, since it was really unlikely that they are going to change that class soon and if they do it could be copied as our own copy. I did not want to implement different UI for product list for different roles so I used that class. Since then I reviewed some hooks and filters in woocommerce and default wp hooks and figure out how to get the same display with them. So I will remove this class and used default table which will be customized with hooks and filters. Also because of it automatic access management for products based on role is also implemented.
nedimu commented 2018-10-17 11:29:55 +02:00 (Migrated from gitlab.com)

merged

merged
nedimu commented 2018-10-17 11:29:56 +02:00 (Migrated from gitlab.com)

mentioned in commit ecde654ae9

mentioned in commit ecde654ae9c3dacd0ab244240e7b75c44f3f0d65
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: senaduka/old-new-wiaas#33