WC_Predictive_Search_WPML_Functions

WC Predictive Search WPML Functions.

Defined (1)

The class is defined in the following location(s).

/classes/class-wpml-functions.php  
  1. class WC_Predictive_Search_WPML_Functions 
  2. {  
  3. public $plugin_wpml_name = 'WooCommerce Predictive Search'; 
  4.  
  5. public function __construct() { 
  6.  
  7. add_action( 'plugins_loaded', array( $this, 'plugins_loaded' ) ); 
  8.  
  9. $this->wpml_ict_t(); 
  10.  
  11.  
  12. /**  
  13. * Register WPML String when plugin loaded 
  14. */ 
  15. public function plugins_loaded() { 
  16. $this->wpml_register_dynamic_string(); 
  17. $this->wpml_register_static_string(); 
  18.  
  19. /**  
  20. * Get WPML String when plugin loaded 
  21. */ 
  22. public function wpml_ict_t() { 
  23.  
  24. $plugin_name = 'woo_predictive_search'; 
  25.  
  26. add_filter( $plugin_name . '_' . 'wc_predictive_search_sidebar_template_settings' . '_get_settings', array( $this, 'ict_t_sidebar_template_settings' ) ); 
  27.  
  28.  
  29. // Registry Dynamic String for WPML 
  30. public function wpml_register_dynamic_string() { 
  31. global $wc_predictive_search_admin_interface; 
  32.  
  33. $wc_predictive_search_sidebar_template_settings = array_map( array( $wc_predictive_search_admin_interface, 'admin_stripslashes' ), get_option( 'wc_predictive_search_sidebar_template_settings', array() ) ); 
  34.  
  35. if ( function_exists('icl_register_string') ) { 
  36. icl_register_string($this->plugin_wpml_name, 'More result Text - Sidebar', $wc_predictive_search_sidebar_template_settings['sidebar_popup_seemore_text'] ); 
  37.  
  38. // Registry Static String for WPML 
  39. public function wpml_register_static_string() { 
  40. if ( function_exists('icl_register_string') ) { 
  41.  
  42. // Default Form 
  43. icl_register_string( $this->plugin_wpml_name, 'Product Name', __( 'Product Name', 'woops' ) ); 
  44. icl_register_string( $this->plugin_wpml_name, 'Product SKU', __( 'Product SKU', 'woops' ) ); 
  45. icl_register_string( $this->plugin_wpml_name, 'Product Categories', __( 'Product Categories', 'woops' ) ); 
  46. icl_register_string( $this->plugin_wpml_name, 'Product Tags', __( 'Product Tags', 'woops' ) ); 
  47. icl_register_string( $this->plugin_wpml_name, 'Posts', __( 'Posts', 'woops' ) ); 
  48. icl_register_string( $this->plugin_wpml_name, 'Pages', __( 'Pages', 'woops' ) ); 
  49. icl_register_string( $this->plugin_wpml_name, 'SKU', __( 'SKU', 'woops' ) ); 
  50. icl_register_string( $this->plugin_wpml_name, 'Priced', __( 'Priced', 'woops' ) ); 
  51. icl_register_string( $this->plugin_wpml_name, 'Price', __( 'Price', 'woops' ) ); 
  52. icl_register_string( $this->plugin_wpml_name, 'Category', __( 'Category', 'woops' ) ); 
  53. icl_register_string( $this->plugin_wpml_name, 'Tags', __( 'Tags', 'woops' ) ); 
  54. icl_register_string( $this->plugin_wpml_name, 'Nothing found', __( 'Nothing found for that name. Try a different spelling or name.', 'woops' ) ); 
  55. icl_register_string( $this->plugin_wpml_name, 'Viewing all', __( 'Viewing all', 'woops' ) ); 
  56. icl_register_string( $this->plugin_wpml_name, 'Search Result Text', __( 'search results for your search query', 'woops' ) ); 
  57. icl_register_string( $this->plugin_wpml_name, 'Sort Text', __( 'Sort Search Results by', 'woops' ) ); 
  58. icl_register_string( $this->plugin_wpml_name, 'Loading Text', __( 'Loading More Results...', 'woops' ) ); 
  59. icl_register_string( $this->plugin_wpml_name, 'No More Result Text', __( 'No More Results to Show', 'woops' ) ); 
  60. icl_register_string( $this->plugin_wpml_name, 'Fetching Text', __( 'Fetching search results...', 'woops' ) ); 
  61. icl_register_string( $this->plugin_wpml_name, 'No Fetching Result Text', __( 'No Results to Show', 'woops' ) ); 
  62. icl_register_string( $this->plugin_wpml_name, 'No Result Text', __( 'Nothing Found! Please refine your search and try again.', 'woops' ) ); 
  63.  
  64. public function ict_t_sidebar_template_settings( $current_settings = array() ) { 
  65. if ( is_array( $current_settings ) && isset( $current_settings['sidebar_popup_seemore_text'] ) )  
  66. $current_settings['sidebar_popup_seemore_text'] = ( function_exists('icl_t') ? icl_t( $this->plugin_wpml_name, 'More result Text - Sidebar', $current_settings['sidebar_popup_seemore_text'] ) : $current_settings['sidebar_popup_seemore_text'] ); 
  67.  
  68. return $current_settings; 
  69.  
  70.