__( '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; } ?>
ID ); woocommerce_wp_text_input( array( 'id' => '_tiered_pricing_minimum', 'wrapper_class' => 'show_if_simple show_if_variable', 'type' => 'number', 'custom_attributes' => $customAttrs, 'value' => $min, 'label' => __( 'Minimum quantity', 'tier-pricing-table' ), 'description' => $desc, 'default' => 1, 'desc_tip' => $tip, ) ); ?> '_tiered_pricing_template', 'value' => self::getProductTemplate( $post->ID ), 'options' => array( 'default' => __( 'Default', 'tier-pricing-table' ), 'table' => __( 'Table', 'tier-pricing-table' ), 'blocks' => __( 'Blocks', 'tier-pricing-table' ), 'options' => __( 'Options', 'tier-pricing-table' ), 'dropdown' => __( 'Dropdown', 'tier-pricing-table' ), 'tooltip' => __( 'Tooltip', 'tier-pricing-table' ), ), 'label' => __( 'Layout', 'tier-pricing-table' ), 'description' => __( 'Specify a tiered pricing layout for the product. Leave the default to use the default layout from the settings', 'tier-pricing-table' ), 'default' => 'default', 'desc_tip' => true, ) ); ?> ID ); ?>

▼ ▲
ID ); ?>
ID ); ?>
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 ); } }