Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
1fa2570a
Unverified
Commit
1fa2570a
authored
6 years ago
by
Brian Beggs
Committed by
GitHub
6 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #19459 from edx/amannan/DE-1171
Add revenue field to completed order event
parents
bd76eee0
ac81c5ea
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lms/djangoapps/shoppingcart/models.py
+3
-0
3 additions, 0 deletions
lms/djangoapps/shoppingcart/models.py
lms/djangoapps/shoppingcart/tests/test_models.py
+2
-0
2 additions, 0 deletions
lms/djangoapps/shoppingcart/tests/test_models.py
with
5 additions
and
0 deletions
lms/djangoapps/shoppingcart/models.py
+
3
−
0
View file @
1fa2570a
...
@@ -524,6 +524,9 @@ class Order(models.Model):
...
@@ -524,6 +524,9 @@ class Order(models.Model):
segment
.
track
(
self
.
user
.
id
,
event_name
,
{
segment
.
track
(
self
.
user
.
id
,
event_name
,
{
'
orderId
'
:
self
.
id
,
'
orderId
'
:
self
.
id
,
'
total
'
:
str
(
self
.
total_cost
),
'
total
'
:
str
(
self
.
total_cost
),
# For Rockerbox integration, we need a field named revenue since they cannot parse a field named total.
# TODO: DE-1188: Remove / move Rockerbox integration code.
'
revenue
'
:
str
(
self
.
total_cost
),
'
currency
'
:
self
.
currency
,
'
currency
'
:
self
.
currency
,
'
products
'
:
[
item
.
analytics_data
()
for
item
in
orderitems
]
'
products
'
:
[
item
.
analytics_data
()
for
item
in
orderitems
]
})
})
...
...
This diff is collapsed.
Click to expand it.
lms/djangoapps/shoppingcart/tests/test_models.py
+
2
−
0
View file @
1fa2570a
...
@@ -277,6 +277,7 @@ class OrderTest(ModuleStoreTestCase):
...
@@ -277,6 +277,7 @@ class OrderTest(ModuleStoreTestCase):
'
orderId
'
:
1
,
'
orderId
'
:
1
,
'
currency
'
:
'
usd
'
,
'
currency
'
:
'
usd
'
,
'
total
'
:
'
40.00
'
,
'
total
'
:
'
40.00
'
,
'
revenue
'
:
'
40.00
'
,
# value for revenue field is same as total.
'
products
'
:
[
'
products
'
:
[
{
{
'
sku
'
:
u
'
CertificateItem.honor
'
,
'
sku
'
:
u
'
CertificateItem.honor
'
,
...
@@ -876,6 +877,7 @@ class CertificateItemTest(ModuleStoreTestCase):
...
@@ -876,6 +877,7 @@ class CertificateItemTest(ModuleStoreTestCase):
'
orderId
'
:
1
,
'
orderId
'
:
1
,
'
currency
'
:
'
usd
'
,
'
currency
'
:
'
usd
'
,
'
total
'
:
'
40.00
'
,
'
total
'
:
'
40.00
'
,
'
revenue
'
:
'
40.00
'
,
# value for revenue field is same as total.
'
products
'
:
[
'
products
'
:
[
{
{
'
sku
'
:
u
'
CertificateItem.verified
'
,
'
sku
'
:
u
'
CertificateItem.verified
'
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment