| @@ -1,9 +1,8 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | namespace TierPricingTable\Admin; |
| 4 | 4 | |
| 5 | -use TierPricingTable\Admin\ProductManagers\ProductManager ; | |
| 6 | 5 | use TierPricingTable\Freemius ; |
| 7 | 6 | use TierPricingTable\Settings\Settings ; |
| 8 | 7 | use TierPricingTable\TierPricingTablePlugin ; |
| 9 | 8 | use Premmerce\SDK\V2\FileManager\FileManager ; |
| @@ -54,12 +53,18 @@ | ||
| 54 | 53 | add_action( 'admin_notices', [ $this, 'showActivationMessage' ] ); |
| 55 | 54 | } |
| 56 | 55 | |
| 57 | 56 | if ( $this->licence->isFree() ) { |
| 58 | - $template = 'upgrade-alert.php'; | |
| 57 | + | |
| 58 | + if ( tpt_fs()->is_anonymous() || !tpt_fs()->is_installed_on_site() ) { | |
| 59 | + $template = 'opt-in-alert.php'; | |
| 60 | + } else { | |
| 61 | + $template = 'upgrade-alert.php'; | |
| 62 | + } | |
| 63 | + | |
| 59 | 64 | add_action( 'woocommerce_settings_' . Settings::SETTINGS_PAGE, function () use( $template ) { |
| 60 | 65 | $this->fileManager->includeTemplate( 'admin/alerts/' . $template, [ |
| 61 | - 'upgradeUrl' => tpt_fs()->get_upgrade_url(), | |
| 66 | + 'upgradeUrl' => $this->licence->getUpgradeLink(), | |
| 62 | 67 | 'contactUsUrl' => $this->licence->getContactUsPageUrl(), |
| 63 | 68 | ] ); |
| 64 | 69 | $this->fileManager->includeTemplate( 'admin/only-in-premium-script.php' ); |
| 65 | 70 | } ); |
| @@ -72,9 +77,9 @@ | ||
| 72 | 77 | */ |
| 73 | 78 | public function initManagers() |
| 74 | 79 | { |
| 75 | 80 | $this->managers = [ |
| 76 | - ProductManager::class => new ProductManager( $this->fileManager, $this->settings, $this->licence ), | |
| 81 | + SimpleProductManager::class => new SimpleProductManager( $this->fileManager, $this->settings, $this->licence ), | |
| 77 | 82 | VariationProductManager::class => new VariationProductManager( $this->fileManager, $this->settings, $this->licence ), |
| 78 | 83 | WooCommerceExport::class => new WooCommerceExport(), |
| 79 | 84 | WooCommerceImport::class => new WooCommerceImport(), |
| 80 | 85 | ]; |