| @@ -2,8 +2,9 @@ | ||
| 2 | 2 | |
| 3 | 3 | use Exception; |
| 4 | 4 | use TierPricingTable\Admin\ProductPage\TieredPricingTab; |
| 5 | 5 | use TierPricingTable\Core\ServiceContainerTrait; |
| 6 | +use TierPricingTable\Settings\Sections\GeneralSection\GeneralSection; | |
| 6 | 7 | use TierPricingTable\PriceManager; |
| 7 | 8 | use TierPricingTable\PricingTable; |
| 8 | 9 | use TierPricingTable\Settings\Sections\GeneralSection\Subsections\ProductPagePriceSubsection; |
| 9 | 10 | use TierPricingTable\TierPricingTablePlugin; |
| @@ -39,10 +40,9 @@ | ||
| 39 | 40 | // Wrap price |
| 40 | 41 | add_action( 'woocommerce_get_price_html', array( $this, 'wrapPrice' ), 101, 2 ); |
| 41 | 42 | |
| 42 | 43 | // Render price table |
| 43 | - add_action( $this->getContainer()->getSettings()->get( 'position_hook', | |
| 44 | - 'woocommerce_before_add_to_cart_button' ), array( | |
| 44 | + add_action( GeneralSection::getPositionHook(), array( | |
| 45 | 45 | $this, |
| 46 | 46 | 'renderPricingTableOnProductPage', |
| 47 | 47 | ), - 999 ); |
| 48 | 48 | |
| @@ -241,9 +241,9 @@ | ||
| 241 | 241 | */ |
| 242 | 242 | public function renderTooltip( ?string $price, WC_Product $_product ): ?string { |
| 243 | 243 | |
| 244 | 244 | // Do not render if not display |
| 245 | - if ( 'yes' !== $this->getContainer()->getSettings()->get( 'display', 'yes' ) ) { | |
| 245 | + if ( ! GeneralSection::isAutomaticDisplayEnabled() ) { | |
| 246 | 246 | return $price; |
| 247 | 247 | } |
| 248 | 248 | |
| 249 | 249 | $displayType = TieredPricingTab::getProductTemplate( $_product->get_parent_id() ? $_product->get_parent_id() : $_product->get_id() ); |