Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
apex_micro_site
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Merge Requests
0
Merge Requests
0
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Ali Arshad
apex_micro_site
Commits
d6b233b2
Commit
d6b233b2
authored
Feb 15, 2018
by
Muhammad Usman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
promo fix
parent
0ab6c275
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
27 deletions
+21
-27
functions.php
WWW_DATA/wp-content/plugins/apex_global_lms/functions.php
+21
-27
No files found.
WWW_DATA/wp-content/plugins/apex_global_lms/functions.php
View file @
d6b233b2
...
@@ -122,6 +122,24 @@ function vq_lms_process_order()
...
@@ -122,6 +122,24 @@ function vq_lms_process_order()
if
(
$code
!=
""
){
$val
=
-
1
;
$terms
=
get_terms
(
array
(
'taxonomy'
=>
'vq_course_promo'
,
'hide_empty'
=>
false
,
));
foreach
(
$terms
as
$term
)
{
if
(
$code
===
$term
->
name
)
{
$val
=
get_term_meta
(
$term
->
term_id
,
'vq_course_promo_value'
,
true
);
}
}
}
foreach
(
$data
as
$user
)
{
foreach
(
$data
as
$user
)
{
$coursesId
=
array_column
(
$user
[
'courses'
],
"id"
);
$coursesId
=
array_column
(
$user
[
'courses'
],
"id"
);
...
@@ -137,7 +155,9 @@ function vq_lms_process_order()
...
@@ -137,7 +155,9 @@ function vq_lms_process_order()
echo
"Unable to process your request"
;
echo
"Unable to process your request"
;
die
;
die
;
}
}
if
(
$val
!=
-
1
)
{
$cost
=
ceil
(((
100
-
$val
)
/
100
)
*
$cost
);
}
$totalCost
+=
floatval
(
$cost
);
$totalCost
+=
floatval
(
$cost
);
$itemsXML
.=
"<Items><itemname>"
.
$item
.
"</itemname><quantity>1</quantity><amount>"
.
number_format
((
float
)
$cost
,
$itemsXML
.=
"<Items><itemname>"
.
$item
.
"</itemname><quantity>1</quantity><amount>"
.
number_format
((
float
)
$cost
,
2
,
'.'
,
''
)
.
"</amount></Items>"
;
2
,
'.'
,
''
)
.
"</amount></Items>"
;
...
@@ -149,32 +169,6 @@ function vq_lms_process_order()
...
@@ -149,32 +169,6 @@ function vq_lms_process_order()
}
}
}
}
if
(
$code
!=
""
){
$val
=
-
1
;
$terms
=
get_terms
(
array
(
'taxonomy'
=>
'vq_course_promo'
,
'hide_empty'
=>
false
,
));
foreach
(
$terms
as
$term
)
{
if
(
$code
===
$term
->
name
)
{
$val
=
get_term_meta
(
$term
->
term_id
,
'vq_course_promo_value'
,
true
);
}
}
if
(
$val
!=
-
1
)
{
$discount
=
((
$val
/
100
)
*
$totalCost
)
*
-
1
;
$itemsXML
.=
"<Items><itemname> Discount (
{
$val
}
%) </itemname><quantity>1</quantity><amount>"
.
number_format
(
$discount
,
2
)
.
"</amount></Items>"
;
$postContent
.=
"<b>Discount (
{
$val
}
%)</b>: "
.
number_format
((
float
)
$discount
,
2
,
'.'
,
''
)
.
"<br />"
;
$totalCost
+=
$discount
;
}
}
if
(
$oid
>
0
)
{
if
(
$oid
>
0
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment