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: add user friendly way to add atributes #18

Merged
merged 17 commits into from
Aug 4, 2023
Merged

Conversation

julianramirez2
Copy link
Contributor

Description

This pull request introduces a user-friendly feature to WooCommerce, allowing non-expert WordPress users to effortlessly create products with essential attributes for Open edX synchronization. The new implementation streamlines the process of adding "course_id" and "mode" attributes, making it easy for administrators to set up course-related products without technical complexity.

Testing instructions

To test it, simply access WordPress, navigate to any WooCommerce product, and scroll down to the product properties box to view the options.

Checklist for Merge

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

Comment on lines 221 to 228
'options' => array(
'Honor' => __('Honor', 'woocommerce'),
'Audit' => __('Audit', 'woocommerce'),
'Verified' => __('Verified', 'woocommerce'),
'Credit' => __('Credit', 'woocommerce'),
'Professional' => __('Professional', 'woocommerce'),
'No ID Professional' => __('No ID Professional', 'woocommerce'),
)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is the second place you are using this list of course modes. Maybe it's a good idea to put this array in another file, like utils or something like that, and reuse that array instead of having both.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, it's a great idea to have it. I have already added a new file called Openedx_Utils.php in utils/ folder. This file contains a function that returns an array with those mode options that are now being called using its namespace.

Copy link
Contributor

Choose a reason for hiding this comment

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

Can we use those utils in our Enrollment Request object form?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Apologies for the delay. I was mistaken and thought I had already uploaded the change. I will be making the necessary commit to implement the change shortly.

@MaferMazu
Copy link
Contributor

The rest looks good to me.

I wonder if @arangos has time to do a review of this PR.

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.

Looks good to me

@andres-arango-aptitude
Copy link

@MaferMazu ready for merge, apporved

@julianramirez2 julianramirez2 merged commit 7103742 into main Aug 4, 2023
@felipemontoya felipemontoya deleted the product-atributes branch March 21, 2024 17:31
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.

3 participants