tabs = apply_filters( 'tiered_pricing_table/global_pricing/form_tabs', array( new Pricing( $this ), new ProductAndCategories( $this ), new UsersAndRoles( $this ), new Quantity( $this ), new Settings( $this ), ) ); } ); add_action( 'edit_form_after_title', function ( WP_Post $post ) { if ( GlobalTieredPricingCPT::SLUG !== $post->post_type ) { return; } $this->render( $post ); } ); new UpgradeTip(); } protected function includeAssets() { ?> includeAssets(); $rulesCount = (int) wp_count_posts( GlobalTieredPricingCPT::SLUG )->publish; if ( $this->isNewRule() && $rulesCount < 1 ) { $this->renderHelpingSteps(); } if ( ! $this->isNewRule() && ! $this->getPricingRuleInstance( $post )->isValidPricing() ) { $this->tabs[0]->renderHint( __( 'The pricing rule does not affect either prices or product quantity limits. The rule will be skipped.', 'tier-pricing-table' ), array( 'custom_class' => 'tpt-global-pricing-rule-hint--top-level' ) ); } ?>
tabs as $tab ) : ?>
render( $this->getPricingRuleInstance( $post ) ); do_action( 'tiered_pricing_table/global_pricing/form/tab_end', $tab, $this->getPricingRuleInstance( $post ) ); ?>
pricingRuleInstance ) ) { $this->pricingRuleInstance = GlobalPricingRule::build( $post->ID ); } return $this->pricingRuleInstance; } public function renderHelpingSteps() { ?> 'Add pricing', 'description' => 'Set up custom regular and/or tiered pricing.', 'icon' => '$', 'has_next_step' => true, ), array( 'title' => 'Select products', 'description' => 'Select products or product categories that the rule will apply to.', 'icon' => '', 'has_next_step' => true, ), array( 'title' => 'Select users', 'description' => 'Select users or user roles that the rule will apply to.', 'icon' => '', 'has_next_step' => true, ), array( 'title' => 'Specify quantity', 'description' => 'Specify the minimum, maximum, and quantity step for products.', 'icon' => '', 'has_next_step' => false, ), ) ?>

×