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
c5c9ae5c
Commit
c5c9ae5c
authored
Feb 14, 2018
by
Muhammad Usman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
promo front-end
parent
3436d288
Pipeline
#314
passed with stage
in 0 seconds
Changes
6
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
132 additions
and
14 deletions
+132
-14
functions.php
WWW_DATA/wp-content/plugins/apex_global_lms/functions.php
+78
-8
lms.css
...A/wp-content/plugins/apex_global_lms/template/css/lms.css
+17
-0
file.txt
...DATA/wp-content/plugins/apex_global_lms/template/file.txt
+0
-2
lms.js
...ATA/wp-content/plugins/apex_global_lms/template/js/lms.js
+32
-1
learner-detail.php
...ntent/plugins/apex_global_lms/template/learner-detail.php
+4
-2
order-redirection.php
...nt/plugins/apex_global_lms/template/order-redirection.php
+1
-1
No files found.
WWW_DATA/wp-content/plugins/apex_global_lms/functions.php
View file @
c5c9ae5c
...
@@ -34,6 +34,64 @@ add_shortcode('vq_course_banner', 'vq_render_course_banner');
...
@@ -34,6 +34,64 @@ add_shortcode('vq_course_banner', 'vq_render_course_banner');
add_shortcode
(
'vq_lms_inquiry_form'
,
'vq_render_inquiry_form'
);
add_shortcode
(
'vq_lms_inquiry_form'
,
'vq_render_inquiry_form'
);
add_action
(
'vq_course_promo_add_form_fields'
,
'add_course_promo'
,
10
,
2
);
add_action
(
'vq_course_promo_edit_form_fields'
,
'edit_course_promo'
,
10
,
2
);
add_action
(
'created_vq_course_promo'
,
'save_course_promo'
,
10
,
2
);
add_action
(
'edited_vq_course_promo'
,
'save_course_promo'
,
10
,
2
);
add_action
(
'wp_ajax_nopriv_check_promo'
,
'vq_check_promo'
,
10
,
2
);
add_action
(
'wp_ajax_check_promo'
,
'vq_check_promo'
,
10
,
2
);
function
vq_check_promo
()
{
$code
=
$_POST
[
'data'
];
$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
);
}
}
echo
$val
;
wp_die
();
}
function
add_course_promo
()
{
?>
<div
class=
"form-field term-group"
>
<label
for=
"vq_course_taxonomy-image-id"
>
Value
</label>
<input
type=
"number"
name=
"vq_course_promo_value"
value=
"0"
min=
"0"
max=
"100"
required
>
%
</div>
<?php
}
function
edit_course_promo
(
$term
)
{
$value
=
get_term_meta
(
$term
->
term_id
,
'vq_course_promo_value'
,
true
);
?>
<tr
class=
"form-field term-group-wrap"
>
<th
scope=
"row"
>
<label
for=
"vq_course_taxonomy-id"
>
Value
</label>
</th>
<td>
<input
type=
"number"
name=
"vq_course_promo_value"
value=
"
<?php
echo
$value
;
?>
"
>
%
</td>
</tr>
<?php
}
function
save_course_promo
(
$term_id
)
{
if
(
isset
(
$_POST
[
'vq_course_promo_value'
]))
{
$val
=
$_POST
[
'vq_course_promo_value'
];
update_term_meta
(
$term_id
,
'vq_course_promo_value'
,
$val
);
}
}
function
vq_lms_process_order
()
function
vq_lms_process_order
()
{
{
if
(
!
isset
(
$_POST
[
'data'
]))
{
if
(
!
isset
(
$_POST
[
'data'
]))
{
...
@@ -336,25 +394,37 @@ function vq_apex_custom_posts()
...
@@ -336,25 +394,37 @@ function vq_apex_custom_posts()
register_post_type
(
'vq_lms_orders'
,
$args
);
register_post_type
(
'vq_lms_orders'
,
$args
);
}
}
function
vq_apex_custom_taxonomies
()
function
vq_apex_custom_taxonomies
()
{
{
$labels
=
array
(
'name'
=>
'LMS Category'
,
'add_new_item'
=>
'Add New LMS Category'
,
'new_item_name'
=>
'New LMS Category'
);
register_taxonomy
(
register_taxonomy
(
'vq_course_taxonomy'
,
'vq_course_taxonomy'
,
'vq_course'
,
'vq_course'
,
array
(
array
(
$labels
,
'label'
=>
'LMS Course Category'
,
'show_ui'
=>
true
,
'show_ui'
=>
true
,
'show_tagcloud'
=>
false
,
'show_tagcloud'
=>
false
,
'hierarchical'
=>
true
,
'hierarchical'
=>
true
,
'rewrite'
=>
array
(
'slug'
=>
'e-learning'
,
'with_front'
=>
false
),
'rewrite'
=>
array
(
'slug'
=>
'e-learning'
,
'with_front'
=>
false
),
)
)
);
);
$labels
=
array
(
'name'
=>
'Promo Code'
,
'add_new_item'
=>
'Add New Promo Code'
,
'new_item_name'
=>
'New Promo Code'
);
register_taxonomy
(
'vq_course_promo'
,
'vq_course'
,
array
(
'labels'
=>
$labels
,
'show_ui'
=>
true
,
'show_tagcloud'
=>
false
,
'description'
=>
null
,
'hierarchical'
=>
false
,
)
);
}
}
function
vq_add_lms_navigation
(
$items
,
$args
)
function
vq_add_lms_navigation
(
$items
,
$args
)
...
...
WWW_DATA/wp-content/plugins/apex_global_lms/template/css/lms.css
View file @
c5c9ae5c
...
@@ -699,6 +699,23 @@
...
@@ -699,6 +699,23 @@
animation
:
spin
2s
linear
infinite
;
animation
:
spin
2s
linear
infinite
;
}
}
.bootstrap-iso
.loader-sm
{
width
:
20px
;
height
:
20px
;
border
:
2px
solid
#f3f3f3
;
}
.bootstrap-iso
.loader-promo
{
position
:
absolute
;
border-color
:
black
;
border-top
:
transparent
;
border-bottom
:
transparent
;
border-right
:
transparent
;
right
:
22px
;
top
:
-20px
;
display
:
none
;
}
/* Safari */
/* Safari */
@-webkit-keyframes
spin
{
@-webkit-keyframes
spin
{
0
%
{
-webkit-transform
:
rotate
(
0deg
);
}
0
%
{
-webkit-transform
:
rotate
(
0deg
);
}
...
...
WWW_DATA/wp-content/plugins/apex_global_lms/template/file.txt
deleted
100644 → 0
View file @
3436d288
6254 : P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yX3Jlc3BvbnNlX2F1dGhjb2RlPjAyNDExMzwvcHJvY2Vzc29yX3Jlc3BvbnNlX2F1dGhjb2RlPjwvcmVzcG9uc2VTdGF0dXM PHN1Yl9kYXRhIC8 PHRyYW5zYWN0aW9uSGlzdG9yeT48dHJhbnNhY3Rpb24gLz48L3RyYW5zYWN0aW9uSGlzdG9yeT48L1NlcnZpY2VSZXNwb25zZVdQRj4=
\ No newline at end of file
WWW_DATA/wp-content/plugins/apex_global_lms/template/js/lms.js
View file @
c5c9ae5c
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
var
singleCourseTemplate
=
$
(
"#singleCourseTemplate"
).
html
();
var
singleCourseTemplate
=
$
(
"#singleCourseTemplate"
).
html
();
var
lmsSummeryCourse
=
$
(
"#lmsSummeryCourse"
).
html
();
var
lmsSummeryCourse
=
$
(
"#lmsSummeryCourse"
).
html
();
var
lmsSummerySingleLearner
=
$
(
"#lmsSummerySingleLearner"
).
html
();
var
lmsSummerySingleLearner
=
$
(
"#lmsSummerySingleLearner"
).
html
();
var
promoValue
=
0
;
var
addLearnerBtn
=
$
(
"#lms-add-learner"
);
var
addLearnerBtn
=
$
(
"#lms-add-learner"
);
var
learners
=
[];
var
learners
=
[];
...
@@ -72,6 +72,11 @@
...
@@ -72,6 +72,11 @@
totalCost
+=
parseFloat
(
course
.
cost
);
totalCost
+=
parseFloat
(
course
.
cost
);
courseSummeryHolder
.
append
(
lmsSummerySingleElem
);
courseSummeryHolder
.
append
(
lmsSummerySingleElem
);
});
});
if
(
promoValue
>
0
)
{
totalCost
=
((
100
-
promoValue
)
/
100
)
*
totalCost
;
}
});
});
$
(
".lms-total"
).
html
(
totalCost
+
" "
+
lmsSettings
.
vq_lms_settings_field_currency_symbol
);
$
(
".lms-total"
).
html
(
totalCost
+
" "
+
lmsSettings
.
vq_lms_settings_field_currency_symbol
);
...
@@ -258,4 +263,29 @@
...
@@ -258,4 +263,29 @@
}
}
$
(
"#pcode-value"
).
change
(
function
()
{
$
(
"#promo-loader"
).
show
();
$
(
"#pcode-value"
).
attr
(
'disabled'
,
true
);
promoValue
=
0
;
var
val
=
$
(
"#pcode-value"
).
val
();
if
(
$
(
"#pcode-value"
).
val
()
!=
""
)
{
$
.
post
(
ajaxurl
,
{
action
:
"check_promo"
,
data
:
val
},
function
(
data
){
$
(
"#promo-loader"
).
hide
();
$
(
"#pcode-value"
).
attr
(
'disabled'
,
false
);
if
(
data
<
0
)
{
alert
(
'Invalid Promo Code'
);
$
(
"#pcode-value"
).
val
(
''
);
}
else
{
promoValue
=
parseInt
(
data
);
renderLearnersPage
();
}
});
}
});
})(
jQuery
);
})(
jQuery
);
\ No newline at end of file
WWW_DATA/wp-content/plugins/apex_global_lms/template/learner-detail.php
View file @
c5c9ae5c
...
@@ -73,14 +73,16 @@ while (have_posts()):
...
@@ -73,14 +73,16 @@ while (have_posts()):
</div>
</div>
<div
class=
"col-sm-12"
>
<div
class=
"col-sm-12"
>
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<label
for=
"
exampleInputName2
"
>
<label
for=
"
pcode
"
>
<div
class=
"order-heading"
><h3
style=
"float: left; padding-top: 23px;"
>
Promo code
</h3>
<div
class=
"order-heading"
><h3
style=
"float: left; padding-top: 23px;"
>
Promo code
</h3>
</div>
</div>
</label>
</label>
<input
type=
"text"
class=
"form-control"
<input
type=
"text"
class=
"form-control"
style=
"float: right; width: 65%; border-radius: 0px; margin-top: 15px; padding-left: 20px;"
style=
"float: right; width: 65%; border-radius: 0px; margin-top: 15px; padding-left: 20px;"
id=
"exampleInputName2"
>
id=
"pcode-value"
/>
<span
id=
"promo-loader"
class=
"loader-promo loader loader-sm"
></span>
</div>
</div>
</div>
</div>
<div
class=
"col-sm-12"
>
<div
class=
"col-sm-12"
>
<div
class=
"order-heading"
>
<div
class=
"order-heading"
>
...
...
WWW_DATA/wp-content/plugins/apex_global_lms/template/order-redirection.php
View file @
c5c9ae5c
...
@@ -38,7 +38,7 @@ if($data && (string) $req_id === (string) $data->application->request_id) {
...
@@ -38,7 +38,7 @@ if($data && (string) $req_id === (string) $data->application->request_id) {
$sub
=
get_option
(
'vq_lms_payment_email_subject'
);
$sub
=
get_option
(
'vq_lms_payment_email_subject'
);
$body
=
get_option
(
'vq_lms_payment_email_template'
);
$body
=
get_option
(
'vq_lms_payment_email_template'
);
$content
=
htmlentities
(
get_post_field
(
'post_content'
,
$order_id
)
);
$content
=
get_post_field
(
'post_content'
,
$order_id
);
$price
=
get_post_meta
(
$order_id
,
'total_amount'
,
true
);
$price
=
get_post_meta
(
$order_id
,
'total_amount'
,
true
);
$status
=
get_post_meta
(
$order_id
,
'payment_status'
,
true
);
$status
=
get_post_meta
(
$order_id
,
'payment_status'
,
true
);
$pmsg
=
get_post_meta
(
$order_id
,
'payment_message'
,
true
);
$pmsg
=
get_post_meta
(
$order_id
,
'payment_message'
,
true
);
...
...
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