Skip to content

Commit

Permalink
changes done
Browse files Browse the repository at this point in the history
changes done
  • Loading branch information
gaminikhil committed Nov 22, 2024
1 parent 568194d commit 34ada27
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
11 changes: 9 additions & 2 deletions includes/admin/class-wc-call-for-price-settings-general.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,20 @@ class Alg_WC_Call_For_Price_Settings_General {
*/
public function __construct() {

$this->id = '';
$this->desc = __( 'General', 'woocommerce-call-for-price' );
$this->id = '';
add_action( 'init', array( &$this, 'add_cfp_desc_general' ) );

add_filter( 'woocommerce_get_sections_alg_call_for_price', array( $this, 'settings_section' ) );
add_filter( 'woocommerce_get_settings_alg_call_for_price_' . $this->id, array( $this, 'get_settings' ), PHP_INT_MAX );
}

/**
* Add desc to setting page.
*/
public function add_cfp_desc_general() {
$this->desc = __( 'General', 'woocommerce-call-for-price' );
}

/**
* Wettings_section.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@ class Alg_WC_Call_For_Price_Settings_Product_Types {
*/
public function __construct() {
add_filter( 'woocommerce_get_sections_alg_call_for_price', array( $this, 'settings_section' ) );
add_action( 'init', array( &$this, 'add_cfp_desc_product_types' ) );
add_action( 'woocommerce_admin_field_alg_wc_call_for_price_textarea', array( $this, 'output_custom_textarea' ) );
add_filter( 'woocommerce_admin_settings_sanitize_option', array( $this, 'unclean_custom_textarea' ), PHP_INT_MAX, 3 );
}
/**
* Add desc to setting page.
*/
public function add_cfp_desc_product_types() {
$this->product_types = array(
'simple' => __( 'Simple Products', 'woocommerce-call-for-price' ),
'variable' => __( 'Variable Products', 'woocommerce-call-for-price' ),
Expand All @@ -46,8 +54,6 @@ public function __construct() {
foreach ( $this->product_types as $product_type_id => $product_type_desc ) {
add_filter( 'woocommerce_get_settings_alg_call_for_price_' . $product_type_id, array( $this, 'get_settings' ), PHP_INT_MAX );
}
add_action( 'woocommerce_admin_field_alg_wc_call_for_price_textarea', array( $this, 'output_custom_textarea' ) );
add_filter( 'woocommerce_admin_settings_sanitize_option', array( $this, 'unclean_custom_textarea' ), PHP_INT_MAX, 3 );
}

/**
Expand Down

0 comments on commit 34ada27

Please sign in to comment.