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

feat: checkbox to enable options if product is a course #42

Merged
merged 4 commits into from
Oct 6, 2023

Conversation

julianramirez2
Copy link
Contributor

@julianramirez2 julianramirez2 commented Oct 4, 2023

Description

Created a checkbox that allows users to perform a 'double-check' of the product in case it's a course, enabling them to add their course_id and course mode properties.

Testing instructions

To test it, you should access a WooCommerce product and scroll down to the product options. You will see the new checkbox, and it will be sufficient to check it, uncheck it, and save.

4aca1f1d99adde557edba5be37279a70.mp4

Additional information

A JavaScript function has been added to control this checkbox, which will always check its state and, depending on it, show or disable the options. This JavaScript is inserted using 'wp_enqueue_script,' which is a WordPress function that processes custom JavaScript files.

Checklist for Merge

  • Tested in a remote environment
  • Updated documentation
  • Rebased master/main
  • Squashed commits

@julianramirez2
Copy link
Contributor Author

@MaferMazu @andres-arango-aptitude can you check this, please?

@julianramirez2
Copy link
Contributor Author

I just changed something about how to set if a product is an Open edX Course or not, it is working with a "product type" and not a custom form in general settings. Now the option appears at the top, next to "downloadable" and "virtual" options, and depending if the check is checked or not and validating if the course_id field is different from empty, allows the user or the process to create a new enrollment. It looks like this right now:

1faef1bee230fb33663034c4ea24de88.mp4

MaferMazu
MaferMazu previously approved these changes Oct 6, 2023
Copy link
Contributor

@MaferMazu MaferMazu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add new lines in the files it doesn't have it? The rest looks good to me.

@julianramirez2
Copy link
Contributor Author

Can you add new lines in the files it doesn't have it? The rest looks good to me.

Done

@julianramirez2 julianramirez2 merged commit 5fe899b into main Oct 6, 2023
3 checks passed
@felipemontoya felipemontoya deleted the product-course-type branch March 21, 2024 17:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants