/** * Get a refreshed cart fragment */ public static function get_refreshed_fragments($arr) { global $dvin_qlist_products; $data = array(); if ($arr['count_refresh'] == "true") { $data['fragments']['div#dvin-quotelist-count'] = '<div id="dvin-quotelist-count">' . dvin_get_wcql_count() . '<div>'; } // Get mini cart if ($arr['widget_refresh'] == "true") { ob_start(); wcql_get_mini_qlist(); $mini_qlist = ob_get_clean(); $data['fragments']['div#quotelist-widget'] = '<div id="quotelist-widget">' . $mini_qlist . '</div>'; } return $data; }
function dvin_qlist_scripts_styles() { global $dvin_wcql_settings, $dvin_qlist_products; wp_enqueue_style('dvin-wcql-stylesheet', plugins_url('/css/styles.css', __FILE__)); wp_enqueue_style('dvin-wcql-custom_stylesheet', plugins_url('/css/custom_styles.css', __FILE__)); wp_enqueue_style('dashicons'); //include js file if (file_exists(TEMPLATEPATH . '/' . Dvin_Wcql::template_path() . 'js/dvin_wcql.js')) { $js_path = get_template_directory_uri() . '/' . Dvin_Wcql::template_path() . 'js/dvin_wcql.js'; } elseif (file_exists(STYLESHEETPATH . '/' . Dvin_Wcql::template_path() . 'js/dvin_wcql.js')) { $js_path = get_stylesheet_directory_uri() . '/' . Dvin_Wcql::template_path() . 'js/dvin_wcql.js'; } else { $js_path = plugins_url('/js/dvin_wcql.js', __FILE__); } // if(!defined('DOING_AJAX') || !DOING_AJAX) wp_enqueue_script('dvin-wcql-js', $js_path, array('jquery'), '1.0.0', false); $dvin_quotelist_refresh_afteradd_url = ''; //initialize with null to avoid undefined notices if (isset($dvin_wcql_settings['redirect_to_listpage_afteradd']) && !empty($dvin_wcql_settings['redirect_to_listpage_afteradd'])) { $dvin_quotelist_refresh_afteradd_url = Dvin_Wcql::get_url(); } echo "<script>var dvin_quotelist_count ='" . dvin_get_wcql_count() . "';var dvin_wcql_ajax_url = '" . admin_url('admin-ajax.php') . "'; var dvin_quotelist_refresh_afteradd_url='" . $dvin_quotelist_refresh_afteradd_url . "';var login_redirect_url='" . addslashes(wp_login_url()) . "\\'?redirect_to=\\'" . urlencode($_SERVER['REQUEST_URI']) . "';</script>"; }