wcap_register_frontend_script_styles

The Woocommerce Coupon Selector wcap register frontend script styles class.

Defined (1)

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

/includes/wcap_register_frontend_script_style.php  
  1. class wcap_register_frontend_script_styles { 
  2. public function __construct() { 
  3. add_action( 'wp_enqueue_scripts', array(&$this, 'wcap_register_my_scripts' )); 
  4.  
  5.  
  6. public function wcap_register_my_scripts() { 
  7. global $post, $product; 
  8.  
  9. wp_register_style( 'wcap_frontend', wcap_PLUGIN_URL . 'assets/css/frontend.css' ); 
  10.  
  11. wp_register_script( 'wcap_frontend', wcap_PLUGIN_URL . 'assets/js/frontend.js' , array('jquery')); 
  12.  
  13. $translation_array = array( 'wait' => __( 'loading...' , 'wcap'), 'all_coupons' => __( 'All Coupons' , 'wcap'), 'wcap_validattion' => __( 'No Coupon Selected' , 'wcap'), 'ajax_loader' => '<center><img src="'.wcap_PLUGIN_URL .'/assets/images/ajax-loader.gif" id="wcaploading" alt="loading..." ></center>', ); 
  14. wp_localize_script( 'wcap_frontend', 'wcap_frontend', $translation_array ); 
  15.  
  16. if (is_cart() || is_checkout()) { 
  17. wp_enqueue_script('wcap_frontend'); 
  18. wp_enqueue_style('wcap_frontend'); 
  19.