PluginProbe
Tiered Pricing Table for WooCommerce / 7.1.1
Tiered Pricing Table for WooCommerce v7.1.1
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 / Settings / Sections / Integrations / IntegrationSection.php

IntegrationSection.php in Tiered Pricing Table for WooCommerce 7.1.1, at src/Settings/Sections/Integrations/IntegrationSection.php

108 lines 3.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php namespace TierPricingTable\Settings\Sections\Integrations;
2
3 use TierPricingTable\Core\ServiceContainerTrait;
4 use TierPricingTable\Settings\Sections\SectionAbstract;
5 use TierPricingTable\Settings\Settings;
6
7 class IntegrationSection extends SectionAbstract {
8
9 use ServiceContainerTrait;
10
11 public function getSettings(): array {
12
13 $settings = array();
14
15 $categories = array(
16 'other' => array(
17 'title' => __( 'General integrations', 'tier-pricing-table' ),
18 'description' => __( 'Integrations with most popular plugins that are not related to a specific category.' ),
19 'tier-pricing-table',
20 ),
21 'multicurrency' => array(
22 'title' => __( 'Multicurrency integrations', 'tier-pricing-table' ),
23 'description' => __( 'Integrations with multicurrency plugins.', 'tier-pricing-table' ),
24 ),
25 'product_addons' => array(
26 'title' => __( 'Product Addons', 'tier-pricing-table' ),
27 'description' => __( 'Integrations with product add-ons (custom fields) plugins.',
28 'tier-pricing-table' ),
29 ),
30 'seo' => array(
31 'title' => __( 'SEO', 'tier-pricing-table' ),
32 'description' => __( 'Integrations with SEO plugins.', 'tier-pricing-table' ),
33 ),
34 'custom_product_types' => array(
35 'title' => __( 'Custom Product Types', 'tier-pricing-table' ),
36 'description' => __( 'Integrations plugins that provides custom product types.', 'tier-pricing-table' ),
37 ),
38 );
39
40 /**
41 * Integration categories
42 *
43 * @since 5.5.0
44 */
45 $categories = apply_filters( 'tiered_pricing_table/settings/integrations_categories', $categories );
46
47 /**
48 * Integration section settings
49 */
50 $_integrations = apply_filters( 'tiered_pricing_table/settings/integrations_settings', array() );
51 $integrations = [];
52
53 foreach ( $_integrations as $integration ) {
54 $integrations[ $integration['integration_category'] ][] = $integration;
55 }
56
57 foreach ( $categories as $categoryID => $category ) {
58
59 if ( empty( $integrations[ $categoryID ] ) ) {
60 continue;
61 }
62
63 $settings[] = array(
64 'title' => $category['title'],
65 'desc' => $category['description'],
66 'id' => Settings::SETTINGS_PREFIX . $categoryID . '__integration_section',
67 'type' => 'title',
68 );
69
70 foreach ( $integrations[ $categoryID ] as $integration ) {
71 $settings[] = $integration;
72 }
73
74 $settings[] = array(
75 'type' => 'sectionend',
76 'id' => Settings::SETTINGS_PREFIX . $categoryID . '__integration_section_end',
77 );
78 }
79
80 return $settings;
81 }
82
83 public function getSectionCSS(): string {
84 return '.form-table tbody { display: flex; flex-wrap: wrap; margin: 10px 0 20px 0; }';
85 }
86
87 public function getSlug(): string {
88 return 'integrations';
89 }
90
91 public function getName(): string {
92 return __( 'Integrations', 'tier-pricing-table' );
93 }
94
95 public static function deleteOptions() {
96 delete_option( Settings::SETTINGS_PREFIX . 'table_integrations' );
97 delete_option( Settings::SETTINGS_PREFIX . '_integration_elementor' );
98 delete_option( Settings::SETTINGS_PREFIX . '_integration_wpallimport' );
99 delete_option( Settings::SETTINGS_PREFIX . '_integration_mix-match-for-woocommerce' );
100 delete_option( Settings::SETTINGS_PREFIX . '_integration_product-add-ons' );
101 delete_option( Settings::SETTINGS_PREFIX . '_integration_woocommerce-deposits' );
102 delete_option( Settings::SETTINGS_PREFIX . '_integration_product-bundles-for-woocommerce' );
103 delete_option( Settings::SETTINGS_PREFIX . '_integration_aelia-multicurrency' );
104 delete_option( Settings::SETTINGS_PREFIX . '_integration_wcpa' );
105 delete_option( Settings::SETTINGS_PREFIX . 'integrations' );
106 }
107 }
108