'', 'legal_name' => '', 'trade_name' => '', 'address' => '', 'pan' => '', 'store_state' => '', 'invoice_prefix' => 'INV-', 'tax_source' => 'inclusive', 'default_gst_slab' => '18', 'shipping_rate_mode' => 'principal', 'shipping_gst_slab' => '18', 'shipping_sac' => '996812', 'default_uqc' => 'NOS-NUMBERS', 'enforce_state_match' => 'yes', 'b2cl_threshold' => '100000', 'sync_tax_class' => 'no', 'signatory_name' => '', 'invoice_footer' => '', ); } /** * All settings merged with defaults. * * @return array */ public static function all() { $saved = get_option( self::OPTION, array() ); return wp_parse_args( is_array( $saved ) ? $saved : array(), self::defaults() ); } /** * One setting. * * @param string $key Key. * @return string */ public static function get( $key ) { $all = self::all(); return isset( $all[ $key ] ) ? (string) $all[ $key ] : ''; } /** * Seller state (WooCommerce code); falls back to the WooCommerce store base state. * * @return string */ public static function seller_state() { $state = self::get( 'store_state' ); if ( '' === $state && function_exists( 'WC' ) && WC()->countries ) { $state = WC()->countries->get_base_state(); } return strtoupper( (string) $state ); } }