PluginProbe
Tiered Pricing Table for WooCommerce / 2.0
Tiered Pricing Table for WooCommerce v2.0
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 2.3.4 All 90 releases
← All changes | src/Admin/Admin.php +9 -21 2.3.22.0 View file →
@@ -1,16 +1,14 @@
1 1 <?php
2 2
3 3 namespace TierPricingTable\Admin;
4 4
5 +use Premmerce\SDK\V2\FileManager\FileManager ;
6 +use TierPricingTable\Admin\ProductManagers\SimpleProductManager ;
7 +use TierPricingTable\Admin\ProductManagers\VariationProductManager ;
5 8 use TierPricingTable\Freemius ;
6 9 use TierPricingTable\Settings\Settings ;
7 10 use TierPricingTable\TierPricingTablePlugin ;
8 -use Premmerce\SDK\V2\FileManager\FileManager ;
9 -use TierPricingTable\Admin\ProductManagers\SimpleProductManager ;
10 -use TierPricingTable\Admin\ProductManagers\VariationProductManager ;
11 -use TierPricingTable\Admin\Export\Woocommerce as WooCommerceExport ;
12 -use TierPricingTable\Admin\Import\Woocommerce as WooCommerceImport ;
13 11 /**
14 12 * Class Admin
15 13 *
16 14 * @package TierPricingTable\Admin
@@ -51,32 +49,22 @@
51 49 add_action( 'admin_enqueue_scripts', [ $this, 'enqueueAssets' ] );
52 50 if ( get_transient( 'tier_pricing_table_activated' ) ) {
53 51 add_action( 'admin_notices', [ $this, 'showActivationMessage' ] );
54 52 }
55 -
56 53 if ( $this->licence->isFree() ) {
57 - $template = 'upgrade-alert.php';
58 - add_action( 'woocommerce_settings_' . Settings::SETTINGS_PAGE, function () use( $template ) {
59 - $this->fileManager->includeTemplate( 'admin/alerts/' . $template, [
60 - 'upgradeUrl' => tpt_fs()->get_upgrade_url(),
61 - 'contactUsUrl' => $this->licence->getContactUsPageUrl(),
54 + add_action( 'woocommerce_settings_' . Settings::SETTINGS_PAGE, function () {
55 + $this->fileManager->includeTemplate( 'admin/upgrade-message.php', [
56 + 'upgradeLink' => $this->licence->getUpgradeLink(),
62 57 ] );
63 - $this->fileManager->includeTemplate( 'admin/only-in-premium-script.php' );
64 58 } );
65 59 }
66 -
67 60 }
68 61
69 - /**
70 - * Init Managers
71 - */
72 62 public function initManagers()
73 63 {
74 64 $this->managers = [
75 65 SimpleProductManager::class => new SimpleProductManager( $this->fileManager, $this->settings, $this->licence ),
76 66 VariationProductManager::class => new VariationProductManager( $this->fileManager, $this->settings, $this->licence ),
77 - WooCommerceExport::class => new WooCommerceExport(),
78 - WooCommerceImport::class => new WooCommerceImport(),
79 67 ];
80 68 }
81 69
82 70 /**
@@ -84,9 +72,9 @@
84 72 */
85 73 public function showActivationMessage()
86 74 {
87 75 $link = $this->settings->getLink();
88 - $this->fileManager->includeTemplate( 'admin/alerts/activation-alert.php', [
76 + $this->fileManager->includeTemplate( 'admin/activation-message.php', [
89 77 'link' => $link,
90 78 ] );
91 79 delete_transient( 'tiered_pricing_table_activated' );
92 80 }
@@ -97,11 +85,11 @@
97 85 * @param $page
98 86 */
99 87 public function enqueueAssets( $page )
100 88 {
101 - global $post, $page ;
89 + global $post ;
102 90
103 - if ( isset( $_GET['tab'] ) && $_GET['tab'] == Settings::SETTINGS_PAGE || ($page == 'post.php' || ($page = 'post_new.php')) && $post && $post->post_type == 'product' ) {
91 + if ( ($page == 'post.php' || ($page = 'post_new.php')) && $post && $post->post_type == 'product' ) {
104 92 wp_enqueue_script(
105 93 'tier-pricing-table-admin-js',
106 94 $this->fileManager->locateAsset( 'admin/main.js' ),
107 95 'jquery',