wc_ajax_add_to_cart_variable_all_settings

The Woocommerce Add to cart Ajax for variable products wc ajax add to cart variable all settings function.

Description

wc_ajax_add_to_cart_variable_all_settings( $settings, $current_section ); 

Parameters (2)

0. $settings
The settings.
1. $current_section
The current section.

Usage

  1. if ( !function_exists( 'wc_ajax_add_to_cart_variable_all_settings' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'woocommerce-add-to-cart-ajax-for-variable-products/woocommerce-ajax-add-to-cart-variable-products.php'; 
  3.  
  4. // The settings. 
  5. $settings = null; 
  6.  
  7. // The current section. 
  8. $current_section = null; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = wc_ajax_add_to_cart_variable_all_settings($settings, $current_section); 
  12.  

Defined (1)

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

/woocommerce-ajax-add-to-cart-variable-products.php  
  1. function wc_ajax_add_to_cart_variable_all_settings( $settings, $current_section ) { 
  2.  
  3. /** 
  4. * Check the current section is what we want 
  5. **/ 
  6.  
  7. if ( $current_section == 'wc_ajax_add_to_cart_variable' ) { 
  8.  
  9. $settings_slider = array(); 
  10.  
  11. // Add Title to the Settings 
  12. $settings_slider[] = array( 'name' => __( 'WC Ajax for Variable Products Settings', 'text-domain' ), 'type' => 'title', 'desc' => __( 'The following options are used to configure WC Ajax for Variable Products', 'text-domain' ), 'id' => 'wc_ajax_add_to_cart_variable' ); 
  13.  
  14. // Add first checkbox option 
  15. $settings_slider[] = array( 
  16.  
  17. 'name' => __( 'Add Selection option to Category Page', 'text-domain' ),  
  18. 'desc_tip' => __( 'This will automatically insert variable selection options on product Category Archive Page', 'text-domain' ),  
  19. 'id' => 'wc_ajax_add_to_cart_variable_category_page',  
  20. 'type' => 'checkbox',  
  21. 'css' => 'min-width:300px;',  
  22. 'desc' => __( 'Enable Varition select option on Category Archive page', 'text-domain' ),  
  23.  
  24. ); 
  25.  
  26. $settings_slider[] = array( 'type' => 'sectionend', 'id' => 'wc_ajax_add_to_cart_variable' ); 
  27.  
  28. return $settings_slider; 
  29.  
  30. /** 
  31. * If not, return the standard settings 
  32. **/ 
  33.  
  34. } else { 
  35.  
  36. return $settings; 
  37.  
  38.