PluginProbe
Tiered Pricing Table for WooCommerce / 7.1.1
Tiered Pricing Table for WooCommerce v7.1.1
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 7.1.1, at src/Addons/GlobalTieredPricing/CPT/Form/Tabs/Pricing.php

67 lines 2.4 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 __( 'Configure regular and tiered pricing rules', 'tier-pricing-table' );
20 }
21
22 public function render( GlobalPricingRule $pricingRule ) {
23 ?>
24 <div>
25 <?php
26 $this->renderSectionTitle( __( 'Base Pricing', 'tier-pricing-table' ), array(
27 'description' => __( 'Override the default regular product prices.',
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' ) );
40
41 $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 />
42 <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.',
43 'tier-pricing-table' ), array( 'show_icon' => false, 'only_for_new_rules' => true ) );
44
45 $this->renderRadioOptions( array(
46 'id' => 'tpt_applying_type',
47 'title' => __( 'Calculation type', 'tier-pricing-table' ),
48 'options' => array(
49 'individual' => __( 'Individual', 'tier-pricing-table' ),
50 'cross' => __( 'Mix and Match', 'tier-pricing-table' ),
51 ),
52 'value' => $pricingRule->getApplyingType(),
53 ), true );
54
55 global $post;
56
57 TieredPricingRulesForm::render( $post->ID, null, null, $pricingRule->getTieredPricingType(),
58 $pricingRule->getPercentageTieredPricingRules(), $pricingRule->getFixedTieredPricingRules() );
59 ?>
60 </div>
61 <?php
62 }
63
64 public function getIcon(): string {
65 return '$';
66 }
67 }