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 / Columns / Settings.php

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

68 lines 1.9 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\Columns;
2
3 use TierPricingTable\Addons\GlobalTieredPricing\GlobalPricingRule;
4 use TierPricingTable\CalculationLogic;
5
6 class Settings {
7
8 public function getName(): string {
9 return __( 'Priority Settings', 'tier-pricing-table' );
10 }
11
12 public function render( GlobalPricingRule $rule ) {
13
14 $prioritySlug = $rule->getSettings()->getPriorityType();
15
16 if ( $prioritySlug === 'default' ) {
17 $realPriority = CalculationLogic::globalRulesOverrideProductLevelRules() ? 'override' : 'prefer-product';
18 } else {
19 $realPriority = $prioritySlug;
20 }
21
22 $priorities = array(
23 'default' => __( 'Global', 'tier-pricing-table' ),
24 'prefer-product' => __( 'Prefer Product', 'tier-pricing-table' ),
25 'prefer-role-based-product' => __( 'Prefer Product', 'tier-pricing-table' ),
26 'override' => __( 'Override', 'tier-pricing-table' ),
27 'flexible' => __( 'Flexible', 'tier-pricing-table' ),
28 );
29
30
31 if ( ! array_key_exists( $prioritySlug, $priorities ) ) {
32 return;
33 }
34
35 ?>
36 <div>
37 <p>
38 <?php esc_html_e( 'Priority type', 'tier-pricing-table' ); ?>:
39 <b><?php echo esc_html( $priorities[ $realPriority ] ); ?></b>
40
41 <?php if ( $prioritySlug === 'flexible' ) : ?>
42 <br>
43 <br>
44 <?php esc_html_e( 'Regular prices priority' ); ?>:
45 <br>
46 <b>
47 <?php echo esc_html( $priorities[ $rule->getSettings()->getRegularPricingPriority() ] ); ?>
48 </b>
49 <br>
50 <br>
51 <?php esc_html_e( 'Tiered pricing priority' ); ?>:
52 <b>
53 <?php echo esc_html( $priorities[ $rule->getSettings()->getTieredPricingPriority() ] ); ?>
54 </b>
55 <br>
56 <br>
57 <?php esc_html_e( 'Quantity Limits Priority' ); ?>:
58 <b>
59 <?php echo esc_html( $priorities[ $rule->getSettings()->getQuantityLimitsPriority() ] ); ?>
60 </b>
61 <?php endif; ?>
62 </p>
63 </div>
64
65 <?php
66 }
67 }
68