edx-enterprise
edx-enterprise copied to clipboard
feat: adds attribute to hide course prices when zero
Description
This adds a new attribute hide_course_price_when_zero
to the EnterpriseCustomer model, which will hide the pricing information from the enrollment page when the final price of a premium course mode is Zero.
Testing instructions
- Setup a working devstack setup for edx-enterprise. Required services: LMS, ECommerce, Discovery and Enterprise Catalog (this needs to be setup separately)
- Check out the PR branch
- OPTIONAL: Install edx-enterprise in your LMS container if not already installed.
# From devstack dir make dev.shell.lms pip install -e /edx/src/edx-enterprise
- Apply the migrations
# From devstack dir make dev.shell.lms ./manage.py lms migrate
- Go to enterprise customer admin page copy the UUID of the test enterprise
- Go to enterprise catalog admin page and copy the UUID of the catalog attached to test enterprise
- Go to discovery search page and copy the
key
of one of the courses included in the enterprise catalog. If you are using the "All course runs" catalog used in the devstack setup, then it can be any course'skey
which has a paid seat. - Visit the URL
http://localhost:18000/enterprise/<enterprise_uuid>/course/<course_key>/enroll/
, eg., http://localhost:18000/enterprise/753e5f69-ef92-42ab-ba07-9326d76603e8/course/edX%2BP315/enroll/. This should show the course details along with the price of the course. - Go to the Ecommerce
/courses/
page and add an Enterprise Offer using the enterprise and catalog UUIDs and set the discount percent to 100% (this will mark the final price to zero). Note: Use006NFJHRVSD683NDI8
for the Salesforce opportunity ID for testing. - Now refresh the enrollment page, it should show the final price as zero.
- Go to the enterprise customer admin page and edit the test enterprise. Check the Hide course price when zero flag and save the customer.
- Refresh the enrollment page. The pricing information would have disappeared.
Merge checklist
- [ ] Any new requirements are in the right place (do not manually modify the
requirements/*.txt
files)-
base.in
if needed in production but edx-platform doesn't install it -
test-master.in
if edx-platform pins it, with a matching version -
make upgrade && make requirements
have been run to regenerate requirements
-
- [ ]
make static
has been run to update webpack bundling if any static content was updated - [x]
./manage.py makemigrations
has been run- Checkout the Database Migration Confluence page for helpful tips on creating migrations.
-
Note: This must be run if you modified any models.
- It may or may not make a migration depending on exactly what you modified, but it should still be run.
- This should be run from either a venv with all the lms/edx-enterprise requirements installed or if you checked out edx-enterprise into the src directory used by lms, you can run this command through an lms shell.
- It would be
./manage.py lms makemigrations
in the shell.
- It would be
- [ ] Version bumped
- [ ] Changelog record added
- [ ] Translations updated (see docs/internationalization.rst but also this isn't blocking for merge atm)
Post merge
- [ ] Tag pushed and a new version released
- Note: Assets will be added automatically. You just need to provide a tag (should match your version number) and title and description.
- [ ] After versioned build finishes in GitHub Actions, verify version has been pushed to PyPI
- Each step in the release build has a condition flag that checks if the rest of the steps are done and if so will deploy to PyPi. (so basically once your build finishes, after maybe a minute you should see the new version in PyPi automatically (on refresh))
- [ ] PR created in edx-platform to upgrade dependencies (including edx-enterprise)
- This must be done after the version is visible in PyPi as
make upgrade
in edx-platform will look for the latest version in PyPi. - Note: the edx-enterprise constraint in edx-platform must also be bumped to the latest version in PyPi.
- This must be done after the version is visible in PyPi as
Thanks for the pull request, @tecoholic!
What's next?
Please work through the following steps to get your changes ready for engineering review:
:radio_button: Get product approval
If you haven't already, check this list to see if your contribution needs to go through the product review process.
- If it does, you'll need to submit a product proposal for your contribution, and have it reviewed by the Product Working Group.
- This process (including the steps you'll need to take) is documented here.
- If it doesn't, simply proceed with the next step.
:radio_button: Provide context
To help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:
- Dependencies
This PR must be merged before / after / at the same time as ...
- Blockers
This PR is waiting for OEP-1234 to be accepted.
- Timeline information
This PR must be merged by XX date because ...
- Partner information
This is for a course on edx.org.
- Supporting documentation
- Relevant Open edX discussion forum threads
:radio_button: Get a green build
If one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green.
:radio_button: Let us know that your PR is ready for review:
Who will review my changes?
This repository is currently unmaintained.
To get help with finding a technical reviewer, tag the community contributions project manager for this PR in a comment and let them know that your changes are ready for review:
- On the right-hand side of the PR, find the Contributions project, click the caret in the top right corner to expand it, and check the "Primary PM" field for the name of your PM.
- Find their GitHub handle here.
Where can I find more information?
If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources:
- Overview of Review Process for Community Contributions
- Pull Request Status Guide
- Making changes to your pull request
When can I expect my changes to be merged?
Our goal is to get community contributions seen and reviewed as efficiently as possible.
However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:
- The size and impact of the changes that it introduces
- The need for product review
- Maintenance status of the parent repository
:bulb: As a result it may take up to several weeks or months to complete a review and merge your PR.
Hi @Agrendalath! Are you able to re-run the checks here?
@mphilbrick211, done.
@tecoholic, the failing TestEnterpriseUtils.test_get_all_field_names_1
test seems to be related to this PR. It's likely the order in the tests/test_utilities.py
file.
@Agrendalath I have fixed the test and updated the PR.
@Agrendalath - the tests need to be enabled again, if you wouldn't mind :)
@mphilbrick211, the tests were already green when I saw your comment, but I rebased the branch just in case.
Side note: I don't have permission to approve the CI in this repository, but the tests are running correctly when I rebase the branch.
@Agrendalath - thanks! is this now ready for review?
@mphilbrick211, yes. We will update the changelog and version after the review to avoid merge conflicts.
Hi @openedx/enterprise-titans! Would someone be able to please review this for us? Thanks!
@Agrendalath - hi there! Would you mind enabling tests again?
@tecoholic, it looks like we need to change the migration prefix from 0175 to 0178.
Hi @tecoholic! Some branch conflicts have popped up. Would you mind taking a look?
Hi @openedx/enterprise-titans! Is someone able to help review/merge this PR? If so, could you provide an ETA on when you'd be able to do so?
Hi @openedx/enterprise-titans - just following up to see when it will be possible to get this reviewed? Once you let us know, we'll address the failing tests.
Update: This PR has been rebased on the master and conflicts resolved.
@openedx/enterprise-titans This PR has been rebased on master and DB migration has been updated to the latest number. Kindly review.
cc: @e0d
Hi @openedx/2u-titans! Are you still still reviewing pull requests? If so, could you please review / merge this for us? Thank you!
Closing this as we don't use the ecommerce based flow anymore and won't be pursuing upstreaming of these changes.
cc: @Agrendalath
@tecoholic Even though your pull request wasn’t merged, please take a moment to answer a two question survey so we can improve your experience in the future.