__( 'Tiered Pricing', 'tier-pricing-table' ), 'target' => 'tiered-pricing-data', 'class' => array( 'show_if_simple', 'show_if_variable' ), ); return $productTabs; } /** * Render content for the tiered pricing tab */ public function renderTieredPricingTab() { global $post ; $min = PriceManager::getProductQtyMin( $post->ID, 'edit' ); $desc = __( 'Set if you sell the product only from a specific quantity that is more than 1', 'tier-pricing-table' ); $tip = true; $customAttrs = array( 'min' => 1, 'step' => 1, ); if ( !tpt_fs()->is_premium() ) { $desc = ' ' . __( 'Available only in the premium version', 'tier-pricing-table' ) . ' ' . __( 'Upgrade', 'tier-pricing-table' ) . ''; $tip = false; $customAttrs['disabled'] = true; } ?>
get_id(), 'fixed', 'edit' ); $this->getContainer()->getFileManager()->includeTemplate( 'admin/add-price-rules.php', array( 'price_rules_fixed' => PriceManager::getFixedPriceRules( $product_object->get_id(), 'edit' ), 'price_rules_percentage' => PriceManager::getPercentagePriceRules( $product_object->get_id(), 'edit' ), 'type' => $type, 'prefix' => 'simple', 'isFree' => !tpt_fs()->is_premium(), ) ); } } public static function getProductTemplate( $productId ) { $template = get_post_meta( $productId, '_tiered_pricing_template', true ); return ( in_array( $template, array( 'default', 'table', 'blocks', 'dropdown', 'tooltip', 'options' ) ) ? $template : 'default' ); } public static function updateProductTemplate( $productId, $template ) { $template = ( in_array( $template, array( 'default', 'table', 'blocks', 'dropdown', 'tooltip', 'options' ) ) ? $template : 'default' ); update_post_meta( $productId, '_tiered_pricing_template', $template ); } }