Commit eb7f05c9 by rajshah

feat: download resource count fix v1.2

parent af79ed45
...@@ -348,7 +348,7 @@ jQuery(document).ready(function ($) { ...@@ -348,7 +348,7 @@ jQuery(document).ready(function ($) {
console.log("Resource ID:", resourceId); console.log("Resource ID:", resourceId);
$.ajax({ $.ajax({
url: frontend_ajax_object.ajax_url, url: download_resource_object.ajax_url,
type: "POST", type: "POST",
data: { data: {
action: "increment_download_count", action: "increment_download_count",
......
...@@ -36,12 +36,19 @@ function conserve_register_styles() ...@@ -36,12 +36,19 @@ function conserve_register_styles()
wp_enqueue_script('counter-js', get_template_directory_uri() . '/assets/js/counterup.js', array('jquery'), $theme_version); wp_enqueue_script('counter-js', get_template_directory_uri() . '/assets/js/counterup.js', array('jquery'), $theme_version);
wp_enqueue_script('raphaelmin', 'https://cdnjs.cloudflare.com/ajax/libs/raphael/2.3.0/raphael.min.js', array('jquery'), $theme_version); wp_enqueue_script('raphaelmin', 'https://cdnjs.cloudflare.com/ajax/libs/raphael/2.3.0/raphael.min.js', array('jquery'), $theme_version);
wp_localize_script( wp_localize_script(
'custom-JS', 'custom',
'frontend_ajax_object', 'frontend_ajax_object',
array( array(
'ajaxurl' => admin_url('admin-ajax.php'), 'ajaxurl' => admin_url('admin-ajax.php'),
) )
); );
wp_localize_script(
'custom-JS',
'download_resource_object',
array(
'ajaxurl' => admin_url('admin-ajax.php'),
)
);
/** CUSTOM JS */ /** CUSTOM JS */
wp_enqueue_script('custom-JS', get_template_directory_uri() . '/assets/js/script.js', array('jquery'), null, true); wp_enqueue_script('custom-JS', get_template_directory_uri() . '/assets/js/script.js', array('jquery'), null, true);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment