PluginProbe
Tiered Pricing Table for WooCommerce / 6.1.0
Tiered Pricing Table for WooCommerce v6.1.0
8.0.2 7.1.7 7.1.5 7.1.4 7.1.1 6.5.0 6.4.0 6.1.0 trunk 1.0 1.1 2.0 2.0.1 2.0.2 2.1 2.1.1 2.1.2 2.2.0 2.2.1 2.2.2 2.2.3 2.3.0 2.3.1 2.3.2 2.3.3 All 91 releases
tier-pricing-table / src / Addons / GlobalTieredPricing / CPT / Form / Tabs / Pricing.php

Pricing.php in Tiered Pricing Table for WooCommerce 6.1.0, at src/Addons/GlobalTieredPricing/CPT/Form/Tabs/Pricing.php

70 lines 2.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php namespace TierPricingTable\Addons\GlobalTieredPricing\CPT\Form\Tabs;
2
3 use TierPricingTable\Addons\GlobalTieredPricing\CPT\Form\FormTab;
4 use TierPricingTable\Addons\GlobalTieredPricing\GlobalPricingRule;
5 use TierPricingTable\Forms\RegularPricingForm;
6 use TierPricingTable\Forms\TieredPricingRulesForm;
7
8 class Pricing extends FormTab {
9
10 public function getId(): string {
11 return 'pricing';
12 }
13
14 public function getTitle(): string {
15 return __( 'Pricing', 'tier-pricing-table' );
16 }
17
18 public function getDescription(): string {
19 return __( 'Set up regular and tiered pricing.', 'tier-pricing-table' );
20 }
21
22 public function render( GlobalPricingRule $pricingRule ) {
23 ?>
24 <div>
25 <?php
26 $this->renderSectionTitle( __( 'Regular Pricing', 'tier-pricing-table' ), array(
27 'description' => __( 'This section controls the base product price, where tiered pricing is not applied. You can set new regular and sale prices or specify a percentage discount based on the original product price. This is useful for role-based pricing. ',
28 'tier-pricing-table' ),
29 'only_for_premium' => true,
30 ) );
31
32 RegularPricingForm::render( null, null, $pricingRule->getRegularPrice(), $pricingRule->getSalePrice(),
33 $pricingRule->getPricingType(), $pricingRule->getDiscount(), $pricingRule->getDiscountType() );
34 ?>
35 </div>
36
37 <div>
38 <?php
39 $this->renderSectionTitle( __( 'Tiered Pricing', 'tier-pricing-table' ), array(
40 'description' => __( 'Set up tiered pricing rules to apply discounts based on the quantity of products purchased. You can set up percentage or fixed discounts for each tier.',
41 'tier-pricing-table' ),
42 ) );
43
44 $this->renderHint( __( '<b>Mix & Match:</b> Combines the quantities of different products to reach tiered pricing thresholds, allowing discounts when products are purchased together. <br /><br />
45 <b>Individually:</b> Treats each product’s quantity separately in pricing calculations, ensuring that each product follows its own pricing tier independently without being combined with others.',
46 'tier-pricing-table' ), array( 'show_icon' => false, 'only_for_new_rules' => true ) );
47
48 $this->renderRadioOptions( array(
49 'id' => 'tpt_applying_type',
50 'title' => __( 'Calculation type', 'tier-pricing-table' ),
51 'options' => array(
52 'individual' => __( 'Individually', 'tier-pricing-table' ),
53 'cross' => __( 'Mix and Match', 'tier-pricing-table' ),
54 ),
55 'value' => $pricingRule->getApplyingType(),
56 ), true );
57
58 global $post;
59
60 TieredPricingRulesForm::render( $post->ID, null, null, $pricingRule->getTieredPricingType(),
61 $pricingRule->getPercentageTieredPricingRules(), $pricingRule->getFixedTieredPricingRules() );
62 ?>
63 </div>
64 <?php
65 }
66
67 public function getIcon(): string {
68 return '$';
69 }
70 }