PluginProbe
Tiered Pricing Table for WooCommerce / 8.0.2
Tiered Pricing Table for WooCommerce v8.0.2
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 8.0.2, at src/Addons/GlobalTieredPricing/CPT/Columns/Settings.php

61 lines 2.7 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 style="margin-bottom: 12px;">
37 <div style="display: flex; flex-wrap: wrap; gap: 4px;">
38 <span style="display: inline-block; background: #e0f0fa; color: #0070bc; border: 1px solid #bae0ff; padding: 4px 10px; border-radius: 4px; font-size: 13px; font-weight: 500; line-height: 1.4;">
39 <?php echo esc_html( $priorities[ $realPriority ] ); ?>
40 </span>
41 </div>
42
43 <?php if ( $prioritySlug === 'flexible' ) : ?>
44 <div style="margin-top: 8px; display: flex; flex-direction: column; gap: 4px; align-items: flex-start;">
45 <span style="display: inline-block; padding: 2px 8px; background: #f0f0f1; border-radius: 3px; font-size: 12px; color: #3c434a; border: 1px solid #dcdcdc; line-height: 1.4;">
46 <?php esc_html_e( 'Regular prices:', 'tier-pricing-table' ); ?> <b><?php echo esc_html( $priorities[ $rule->getSettings()->getRegularPricingPriority() ] ); ?></b>
47 </span>
48 <span style="display: inline-block; padding: 2px 8px; background: #f0f0f1; border-radius: 3px; font-size: 12px; color: #3c434a; border: 1px solid #dcdcdc; line-height: 1.4;">
49 <?php esc_html_e( 'Tiered pricing:', 'tier-pricing-table' ); ?> <b><?php echo esc_html( $priorities[ $rule->getSettings()->getTieredPricingPriority() ] ); ?></b>
50 </span>
51 <span style="display: inline-block; padding: 2px 8px; background: #f0f0f1; border-radius: 3px; font-size: 12px; color: #3c434a; border: 1px solid #dcdcdc; line-height: 1.4;">
52 <?php esc_html_e( 'Quantity limits:', 'tier-pricing-table' ); ?> <b><?php echo esc_html( $priorities[ $rule->getSettings()->getQuantityLimitsPriority() ] ); ?></b>
53 </span>
54 </div>
55 <?php endif; ?>
56 </div>
57
58 <?php
59 }
60 }
61