DCAS Open EdX Documentation

DCAS Open EdX Documentation

  • Docs

›Configure Ecommerce

Creating a Course

  • Create a New Online Course
  • Set Course Schedule & Details
  • Add Sections, Subsections & Units
  • Managing Unit and Component
  • Adding Videos
  • Adding HTML
  • Adding Discussions
  • Adding Problems

    • Adding Problems
    • Problem Types
    • Drag and Drop
    • Pointing on a picture
  • Adding Images and Figures
  • Uploading Static Content
  • Course Visibility
  • Creating pages
  • Grading
  • Commonly Used Advanced Settings

Running a Course

  • Managing Certificates
  • Common Instructor Dashboard Tasks
  • Managing Course Discussions

Advanced Management

  • Importing / Exporting Courses
  • Change a user’s password
  • Inactivate / Activate a User
  • Understanding User Roles
  • Set a user to staff or superuser
  • Server Tasks

    • SSH into Server
    • Set or Change a Password

Migration

  • Migrate EdX (Single-Server)
  • Migrate the Theme

Migrate MySQL

  • Migrating MySQL Database off of Single-Server

Migrate Mongo

  • Migrating Mongo Database off of Single-Server

Configuration

  • Enable and Update Additional Languages
  • Enable Downloads from Instructor tab in LMS
  • Configure and Enable Certificate
  • Configure Open Response Assessment

Configure Ecommerce

  • Basic Ecommerce Setup
  • Setup JWT Keys
  • Getting Course Details on Checkout Page
  • Troubleshoot Ecommerce

Discovery Setup

  • Configure Discovery

Comprehensive theming

  • Setup Comprehensive Theming

Microsites

  • Setup Microsites
  • Common Microsite Configurations

API

  • Setup API
  • Common APIs Demonstration
  • Customizing an API
  • DCAS API Handoff for LMS

Xblock

  • Xblock introduction
  • Xblock installation and uninstallation
  • Xblock Development

Scaling the architecture

  • Scaling Mongo
  • Scaling MySQL
  • Dedicated Storage Configuration Outline
  • Azure Storage Configuration

    • Azure Storage Configuration
    • Basic Configuration
    • Private Blob Configuration

SCORM

  • SCORM Azure Storage

Trouble-Shooting

  • Forgot admin username or password
  • Server error
  • Can't reach your site
  • Problems with RabbitMQ
  • Can't login to LMS or CMS
  • Locate the error
  • Jobs are stucking
  • Mongodb not working
  • Forums Breaking Issue
  • Check open edx services status
  • Problem with mysql
  • Can't receive email
  • CSRF token error

Getting Course Details on Checkout Page

Problem:

On the eCommerce Checkout Page it is noted that getting the Product Title (course name?) , Product Description and Course image requires some additional steps to perform in order to get the correct course details of that particular course on the checkout/basket page. See Screenshot for reference:

963e9c38-eba1-4090-956c-6c8ca2e06e56.png

Solution:

This can be solved by making some configuration changes and executing the command, whose details are given below. Please make sure to follow them properly:

NOTE: Make sure to have everything on SSL (i.e. HTTPS enabled) and then 
do the OAuth Client configuration properly for Ecommerce and Discovery
Services.

Following are the configuration example:

ECommerce Oauth2 Clients configuration:

Name: ecommerce
Url: https://studygo.net:8002
Redirect uri: https://studygo.net:8002/complete/edx-oidc/
Client id: your-id
Client secret: your-secret
Client type: Confidential (Web applications)
Logout uri: https://studygo.net:8002/logout/

Screenshot for reference:

4e948bc3-87cc-42a0-90d2-431c9da3acb5.png

Do the OAuth2 Clients settings for Discovery as well:

Name: discovery
Url: https://studygo.net:18381
Redirect uri: https://studygo.net:18381/complete/edx-oidc/
Client id: your-id
Client secret: yout-secret
Client type: Confidential (Web applications)
Logout uri: https://studygo.net:18381/logout/

Screenshot for reference:
2d4efb20-9d26-4c41-8de5-ae3118d44e42.png

Also make sure to add these clients to the Trusted Clients:
Home › Edx_Oauth2_Provider › Trusted clients
649a10aa-9de6-4a21-9962-66513514f496.png

Now, make sure to have the following key values set under the lms.env.json:

"DEFAULT_JWT_ISSUER": {
    "AUDIENCE": "Ecommerce Client Id", 
    "ISSUER": "https://studygo.net/oauth2", 
    "SECRET_KEY": "Ecommerce Client Secret."
    }, 
Here, AUDIENCE= Ecommerce Client Id and SECRET_KEY= Ecommerce Client Secret.

"JWT_AUTH": {
    "JWT_AUDIENCE": "SET-ME-PLEASE", 
    "JWT_ISSUER": "https://studygo.net/oauth2", 
    "JWT_ISSUERS": [
    {
        "AUDIENCE": "ecommerce Client id", 
        "ISSUER": "https://studygo.net/oauth2", 
        "SECRET_KEY": "ecommerce Client secret"
    } 
    ], 
    "JWT_SECRET_KEY": "SET-ME-PLEASE"
}, 
"JWT_EXPIRATION": 30,     
"JWT_EXPIRED_PRIVATE_SIGNING_KEYS": [],     
"JWT_ISSUER": "https://studygo.net/oauth2",     
"JWT_PRIVATE_SIGNING_KEY": null, 

For cms.env.json:

"DEFAULT_JWT_ISSUER": {        '
    "AUDIENCE": "SET-ME-PLEASE",         
    "ISSUER": "https://studygo.net/oauth2",         
    "SECRET_KEY": "SET-ME-PLEASE"    
    }, 
    "JWT_AUTH": {
        "JWT_AUDIENCE": "SET-ME-PLEASE",         
        "JWT_ISSUER": "https://studygo.net/oauth2",         
        "JWT_ISSUERS": [            
            {                
            "AUDIENCE": "ecommerce Client Id",                 
            "ISSUER": "https://studygo.net/oauth2",               
            "SECRET_KEY": "ecommerce Client secret"           
            }         
        ],         
        "JWT_SECRET_KEY": "SET-ME-PLEASE"    
        },     
        "JWT_EXPIRATION": 30,     
        "JWT_EXPIRED_PRIVATE_SIGNING_KEYS": [],     
        "JWT_ISSUER": "https://studygo.net/oauth2",     
        "JWT_PRIVATE_SIGNING_KEY": null, 

Do the following under the **ecommerce.yml **(/edx/etc/ecommerce.yml):

NOTE: Please set these URLs according to your URLs (These are for example):

ECOMMERCE_URL_ROOT: https://studygo.net:8002 
OAUTH2_USER_INFO_URL: https://studygo.net/oauth2/user_info
ENTERPRISE_SERVICE_URL: https://studygo.net/enterprise/
SOCIAL_AUTH_EDX_OIDC_ID_TOKEN_DECRYPTION_KEY: ecommerce Client secret
SOCIAL_AUTH_EDX_OIDC_ISSUER: https://studygo.net/oauth2
SOCIAL_AUTH_EDX_OIDC_KEY: ecommerce Client id
SOCIAL_AUTH_EDX_OIDC_LOGOUT_URL: https://studygo.net/logout
SOCIAL_AUTH_EDX_OIDC_PUBLIC_URL_ROOT: https://studygo.net/oauth2
SOCIAL_AUTH_EDX_OIDC_SECRET: ecommerce Client secret
SOCIAL_AUTH_EDX_OIDC_URL_ROOT: https://studygo.net/oauth2
SOCIAL_AUTH_REDIRECT_IS_HTTPS: false

Go to discovery.yml file and make sure to modify the **discovery.yml **to match the JWT_Auth settings as that of the ECommerce:
Located at (/edx/etc/discovery.yml)

8074a560-eabc-4767-8646-ddfb0290861d.png

Set the above with the values Here, AUDIENCE= Ecommerce Client Id and SECRET_KEY= Ecommerce Client Secret and keep the OAuth Client Id and Client Secret of discovery client created initially into **SOCIAL_\*** settings under this file:
c1183624-c60e-49b6-8298-662e33ed0312.png

Restart ecommerce and discovery services:

sudo /edx/bin/supervisorctl restart ecommerce ecomworker discovery

Now, make sure to execute the following commands whenever you add a new course from the course administration tool on ecommerce platform:
Switch the user to discovery, activate the virtual environment for discovery:

ubuntu@ip-172-31-7-29:~$ sudo su discovery -s /bin/bash
discovery@ip-172-31-7-29:/home/ubuntu$ cd
discovery@ip-172-31-7-29:~$ source discovery_env 
discovery@ip-172-31-7-29:~$ cd discovery/

9b4c1461-f29c-4391-91b1-d24963452fb9.png

discovery@ip-172-31-7-29:~$ ./manage.py refresh_course_metadata --partner_code edX
NOTE: Please make sure to give the correct partner_code this is what you must have already defined while creating ecommerce site.
See Example (This command is to be run initially while setting up the ecommerce, mentioning here, just for reference):
python manage.py create_or_update_site \    
    --site-id=1 \   
    --site-domain=studygo.net:8002 \    
    --partner-code=edX \    
    --partner-name='Open edX' \ 
    --lms-url-root=https://studygo.net \    
    --payment-processors=wechatpay \    
    --client-id=ecommerce-key \ 
    --client-secret=ecommerce-secret \  
    --from-email=uahmed.knysys@gmail.com \  
    --discovery_api_url=https://studygo.net:18381/

Then, continue with executing the following command:

discovery@ip-172-31-7-29:~/discovery$ ./manage.py update_index --disable-change-limit

Now, there are some details that you have to input using the 'Discovery Service Administration':
Filling the details, will serve the Product Description and Course Card Image on the Basket/Checkout Page:
Go to https://your-discovery-url/admin/course_metadata/course/

Home › Course Metadata › Courses › Your Course

7a3a7ad4-4b72-4cff-9c6c-7ee6c199d5ac.png

In this form, scroll down and you will see another field as Card image url:

In this field, we have give the image asset URL:
For e.ghttps://studygo.net/asset-v1:Discovery+DS101+2019+type@asset+block@ecommerce.png

Then, test the basket page and you will get the page populated with the data.
2591197b-b69a-4e0d-825c-a76b6b2a3f7c.png

← Setup JWT KeysTroubleshoot Ecommerce →
DCAS Open EdX Documentation
Docs
Create an Online Course
More
Curricu.me Website
Copyright © 2022 DCAS