PluginProbe
Tiered Pricing Table for WooCommerce / 6.1.0
Tiered Pricing Table for WooCommerce v6.1.0
8.0.2 7.1.7 7.1.5 7.1.4 7.1.1 6.5.0 6.4.0 6.1.0 trunk 1.0 1.1 2.0 2.0.1 2.0.2 2.1 2.1.1 2.1.2 2.2.0 2.2.1 2.2.2 2.2.3 2.3.0 2.3.1 2.3.2 2.3.3 All 91 releases
tier-pricing-table / src / Addons / Tools / Settings / Settings.php

Settings.php in Tiered Pricing Table for WooCommerce 6.1.0, at src/Addons/Tools/Settings/Settings.php

54 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php namespace TierPricingTable\Addons\Tools\Settings;
2
3 use TierPricingTable\Settings\Settings as MainSettings;
4
5 class Settings {
6
7 public function __construct() {
8
9 add_filter( 'tiered_pricing_table/settings/sections', function ( $sections ) {
10
11 $sections[] = new ToolsSettingsSection();
12
13 return $sections;
14 }, 10 );
15
16 add_action( 'woocommerce_admin_field_tiered-pricing_tools-ui', function () {
17 ?>
18 <style>
19 p.submit {
20 display: none !important;
21 }
22 </style>
23 <tr valign="top">
24 <td colspan="2" class="forminp">
25 <div id="tiered-pricing__feature__tools"></div>
26 </td>
27 </tr>
28 <?php
29 } );
30
31 add_action( 'admin_enqueue_scripts', function () {
32
33 $settingsTab = isset( $_GET['tab'] ) ? sanitize_text_field( $_GET['tab'] ) : '';
34 $section = isset( $_GET['section'] ) ? sanitize_text_field( $_GET['section'] ) : '';
35
36 if ( MainSettings::SETTINGS_PAGE !== $settingsTab ) {
37 return;
38 }
39
40 if ( 'tools' !== $section ) {
41 return;
42 }
43
44 $assetFile = include( plugin_dir_path( __FILE__ ) . '../build/index.asset.php' );
45
46 wp_enqueue_script( 'tiered-pricing/feature/tools',
47 plugins_url( 'build/index.js', dirname( __FILE__ . '../' ) ), $assetFile['dependencies'],
48 $assetFile['version'], true );
49
50 wp_enqueue_style( 'wp-components' );
51 } );
52 }
53 }
54